From dda523716410774fcc65c6bcd22f3def79e2ef02 Mon Sep 17 00:00:00 2001 From: omermorad Date: Sun, 22 Nov 2026 10:00:55 +0200 Subject: [PATCH 1/3] chore(sdk): add reviewable Python generator candidate --- .github/workflows/sdk-candidate.yml | 30 + candidate/README.md | 13 + candidate/contract/openapi.yaml | 18968 ++++++++++++++++ .../generated/.github/workflows/python.yml | 34 + candidate/generated/.gitignore | 66 + candidate/generated/.gitlab-ci.yml | 31 + candidate/generated/.openapi-generator-ignore | 23 + candidate/generated/.openapi-generator/FILES | 399 + .../generated/.openapi-generator/VERSION | 1 + candidate/generated/.travis.yml | 17 + candidate/generated/README.md | 588 + candidate/generated/git_push.sh | 54 + candidate/generated/nimble_client/__init__.py | 802 + .../generated/nimble_client/api/__init__.py | 17 + .../nimble_client/api/batches_api.py | 805 + .../generated/nimble_client/api/crawl_api.py | 1126 + .../nimble_client/api/domain_knowledge_api.py | 324 + .../nimble_client/api/extract_api.py | 854 + .../api/extract_templates_public_api.py | 2334 ++ .../api/extraction_templates_api.py | 866 + .../nimble_client/api/jobs_public_v2_api.py | 3679 +++ .../generated/nimble_client/api/map_api.py | 308 + .../generated/nimble_client/api/media_api.py | 587 + .../nimble_client/api/public_api_api.py | 3682 +++ .../generated/nimble_client/api/search_api.py | 307 + .../generated/nimble_client/api/serp_api.py | 1172 + .../generated/nimble_client/api/tasks_api.py | 863 + .../generated/nimble_client/api_client.py | 865 + .../generated/nimble_client/api_response.py | 21 + .../generated/nimble_client/configuration.py | 691 + .../generated/nimble_client/exceptions.py | 218 + .../nimble_client/models/__init__.py | 381 + .../nimble_client/models/agent_batch_body.py | 102 + .../models/agent_batch_body_inputs_inner.py | 117 + .../models/agent_batch_body_shared_inputs.py | 111 + .../nimble_client/models/agent_body.py | 111 + .../models/agent_sources_public_v1.py | 130 + .../models/agent_sources_public_v2.py | 117 + .../agent_sources_response_public_v1.py | 130 + .../agent_sources_response_public_v2.py | 117 + .../generated/nimble_client/models/amount.py | 144 + .../models/answer_annotation_citation.py | 113 + .../models/answer_marker_citation.py | 99 + .../nimble_client/models/answer_request.py | 100 + .../nimble_client/models/answer_response.py | 96 + .../models/artifact_download_url_public_v1.py | 91 + .../models/artifact_download_url_public_v2.py | 91 + .../models/artifact_list_public_v1.py | 95 + .../models/artifact_list_public_v2.py | 95 + .../models/artifact_preview_public_v1.py | 92 + .../models/artifact_preview_public_v2.py | 92 + .../models/artifact_public_v1.py | 95 + .../models/artifact_public_v2.py | 95 + .../models/auto_scroll_action.py | 105 + .../models/auto_scroll_action_auto_scroll.py | 154 + .../auto_scroll_action_auto_scroll_one_of.py | 137 + ...roll_action_auto_scroll_one_of_required.py | 155 + ...o_scroll_action_auto_scroll_one_of_skip.py | 155 + .../models/avg_duration_seconds.py | 144 + .../models/batch_get_response.py | 129 + .../models/batch_get_response_tasks_inner.py | 171 + .../models/batch_progress_response.py | 105 + .../nimble_client/models/browser_action.py | 291 + .../nimble_client/models/citation.py | 91 + .../nimble_client/models/citation_config.py | 102 + .../nimble_client/models/citations.py | 140 + .../nimble_client/models/click_action.py | 105 + .../models/click_action_click.py | 137 + .../models/click_action_click_one_of.py | 137 + .../nimble_client/models/company_entity.py | 156 + .../models/company_financials.py | 119 + .../models/company_headquarters.py | 114 + .../models/company_web_traffic.py | 133 + .../generated/nimble_client/models/content.py | 138 + .../nimble_client/models/country_rank.py | 144 + .../models/crawl_api_response.py | 189 + .../models/crawl_api_response_completed_at.py | 144 + .../crawl_api_response_crawl_options.py | 131 + ...awl_api_response_crawl_options_callback.py | 136 + ..._response_crawl_options_callback_any_of.py | 110 + .../models/crawl_api_response_created_at.py | 138 + .../models/crawl_api_response_tasks_inner.py | 116 + .../models/crawl_by_filters_response.py | 114 + .../crawl_by_filters_response_pagination.py | 97 + .../nimble_client/models/crawl_payload.py | 131 + .../models/crawl_payload_callback.py | 136 + .../models/crawl_payload_callback_any_of.py | 136 + .../crawl_payload_callback_any_of_any_of.py | 105 + .../models/crawl_payload_extract_options.py | 311 + .../crawl_payload_extract_options_browser.py | 136 + ..._payload_extract_options_browser_any_of.py | 97 + .../crawl_payload_extract_options_cookies.py | 139 + ...ad_extract_options_cookies_any_of_inner.py | 190 + ...ct_options_cookies_any_of_inner_expires.py | 138 + ...ct_options_cookies_any_of_inner_max_age.py | 161 + ...ad_extract_options_file_parsing_options.py | 101 + ...l_payload_extract_options_headers_value.py | 144 + ...d_extract_options_network_capture_inner.py | 123 + ...ons_network_capture_inner_resource_type.py | 139 + ...tract_options_network_capture_inner_url.py | 100 + .../crawl_payload_extract_options_parser.py | 138 + .../crawl_payload_extract_options_render.py | 138 + .../crawl_payload_extract_options_session.py | 97 + .../crawl_payload_extract_options_skill.py | 138 + ...t_template_generation_request_public_v2.py | 136 + ...ate_extract_template_metadata_public_v2.py | 102 + ...t_template_refinement_request_public_v2.py | 90 + .../models/create_job_request_public_v1.py | 137 + .../models/create_job_request_public_v2.py | 137 + ...e_template_generation_request_public_v1.py | 123 + .../create_template_metadata_public_v1.py | 102 + ...e_template_refinement_request_public_v1.py | 90 + .../generated/nimble_client/models/default.py | 178 + .../models/delete_crawl200_response.py | 108 + .../models/driver_resolution_response.py | 98 + .../nimble_client/models/duration.py | 144 + .../generated/nimble_client/models/effort.py | 40 + .../nimble_client/models/eval_action.py | 105 + .../nimble_client/models/eval_action_eval.py | 140 + .../models/eval_action_eval_one_of.py | 103 + .../models/extract200_response.py | 140 + .../models/extract200_response_data.py | 149 + ...xtract200_response_data_browser_actions.py | 115 + ...onse_data_browser_actions_results_inner.py | 134 + ...200_response_data_network_capture_inner.py | 121 + ...ponse_data_network_capture_inner_filter.py | 136 + ...work_capture_inner_filter_resource_type.py | 137 + ...etwork_capture_inner_filter_status_code.py | 139 + ...e_data_network_capture_inner_filter_url.py | 115 + ...ata_network_capture_inner_results_inner.py | 111 + ...ork_capture_inner_results_inner_request.py | 131 + ...rk_capture_inner_results_inner_response.py | 126 + .../extract200_response_data_parsing.py | 151 + ...xtract200_response_data_redirects_inner.py | 109 + .../models/extract200_response_debug.py | 118 + .../models/extract200_response_metadata.py | 118 + .../models/extract200_response_pagination.py | 137 + .../extract200_response_pagination_any_of.py | 101 + ...ct200_response_pagination_any_of1_inner.py | 88 + .../models/extract_async_request.py | 321 + .../models/extract_async_response.py | 114 + .../models/extract_async_response_task.py | 171 + .../models/extract_batch_payload.py | 102 + .../extract_batch_payload_inputs_inner.py | 321 + ...atch_payload_inputs_inner_all_of_render.py | 138 + .../extract_batch_payload_shared_inputs.py | 321 + .../models/extract_batch_response.py | 112 + .../extract_batch_response_tasks_inner.py | 171 + .../nimble_client/models/extract_payload.py | 311 + .../extract_template_filter_public_v2.py | 97 + ..._template_generation_response_public_v2.py | 159 + .../extract_template_response_public_v2.py | 140 + .../extract_template_sample_public_v2.py | 106 + ...act_template_version_metadata_public_v2.py | 130 + ...act_template_version_response_public_v2.py | 120 + .../models/extraction_template_batch_body.py | 102 + ...action_template_batch_body_inputs_inner.py | 104 + ...ction_template_batch_body_shared_inputs.py | 106 + .../models/extraction_template_body.py | 106 + .../nimble_client/models/fetch_action.py | 105 + .../models/fetch_action_fetch.py | 140 + .../models/fetch_action_fetch_one_of.py | 129 + .../nimble_client/models/fill_action.py | 92 + .../nimble_client/models/fill_options.py | 137 + .../models/fill_options_one_of.py | 162 + .../models/fill_options_one_of1.py | 130 + .../generated/nimble_client/models/focus.py | 138 + .../models/full_template_public_v1.py | 154 + .../nimble_client/models/funding_round.py | 111 + .../nimble_client/models/funding_total.py | 144 + ...eway_def033cecba0ba3d1d3_text_run_trust.py | 109 + ...ay_def07f3b31eb3e5e2cb_trust_confidence.py | 39 + ...ay_def07f55f9a59071b48_json_claim_trust.py | 102 + ...f62cadb20_task_run_progress_stats_event.py | 104 + ...way_def1d511972aa34af3c_source_category.py | 42 + ...ef21e0e16cb4d7d291_task_run_text_output.py | 120 + ...ef2e37feaa5480a045_task_run_json_output.py | 124 + ...eway_def30520b8ccd213fdc_text_run_trust.py | 109 + ...f386b2024130bc052_task_run_source_stats.py | 92 + ...3a5c7c6bfa027c89_task_run_output_source.py | 95 + ...ay_def3b1480fbbf8bec18_text_claim_trust.py | 102 + ...ab2bb4e1911_task_run_progress_msg_event.py | 99 + ...ay_def54179423f3a3b0a8_json_claim_trust.py | 102 + ...f6651fbad4f19182d_task_run_status_value.py | 40 + ...ef6d6a3bc063952be8_task_run_state_event.py | 115 + ...ateway_def74786d0cba87c515_trust_source.py | 120 + ...y_def7feddd7d853a299b_trust_source_type.py | 37 + ...6b662c6aa9dee9_task_run_state_event_run.py | 114 + ...eway_def977107e4b1c6ce11_trust_citation.py | 132 + ...way_def_a7c1b2a8ffcc3b45_json_run_trust.py | 109 + ...f_bc5dc0ea1fc57012_task_run_text_output.py | 120 + ...9c374a83b_task_run_progress_stats_event.py | 104 + ...teway_def_ce9019f9e67ae903_trust_source.py | 120 + ...833882d7d67018_task_run_state_event_run.py | 114 + ...f_dc279d13fafb2038_task_run_json_output.py | 124 + ...way_def_eb0114a225123d8d_json_run_trust.py | 109 + ...way_def_f23bf5d9e6e07ed3_trust_citation.py | 132 + ...y_def_fb397fec4dcf2a13_text_claim_trust.py | 102 + ...f_fd08b460e1d38459_task_run_state_event.py | 115 + .../models/get_cookies_action.py | 92 + .../models/get_cookies_action_get_cookies.py | 140 + .../get_cookies_action_get_cookies_one_of.py | 111 + ...get_domain_knowledge_driver400_response.py | 115 + .../nimble_client/models/goto_action.py | 105 + .../nimble_client/models/goto_action_goto.py | 140 + .../models/goto_action_goto_one_of.py | 127 + .../models/http_validation_error.py | 95 + .../nimble_client/models/input_data.py | 144 + .../models/job_context_public_v1.py | 123 + .../models/job_context_public_v2.py | 123 + .../models/job_destination_public_v1.py | 109 + .../models/job_destination_public_v2.py | 109 + .../models/job_inputs_public_v1.py | 116 + .../models/job_inputs_public_v2.py | 116 + .../models/job_list_filter_public_v2.py | 100 + .../models/job_list_public_v1.py | 101 + .../nimble_client/models/job_public_v1.py | 191 + .../nimble_client/models/job_public_v2.py | 191 + .../job_run_cancel_response_public_v1.py | 105 + .../job_run_cancel_response_public_v2.py | 105 + .../models/job_run_detail_public_v1.py | 166 + .../models/job_run_detail_public_v2.py | 166 + .../models/job_run_error_public_v1.py | 107 + .../models/job_run_error_public_v2.py | 107 + .../models/job_run_list_filter_public_v2.py | 93 + .../models/job_run_list_public_v1.py | 101 + .../nimble_client/models/job_run_public_v1.py | 154 + .../nimble_client/models/job_run_public_v2.py | 154 + .../models/job_run_summary_public_v1.py | 107 + .../models/job_run_summary_public_v2.py | 107 + .../models/job_schedule_public_v1.py | 90 + .../models/job_schedule_public_v2.py | 90 + .../nimble_client/models/json_claim_trust.py | 102 + .../nimble_client/models/json_patch_op.py | 114 + .../nimble_client/models/json_run_trust.py | 109 + ...nse_extract_template_response_public_v2.py | 101 + ...act_template_version_response_public_v2.py | 101 + .../models/list_response_job_public_v2.py | 101 + .../models/list_response_job_run_public_v2.py | 101 + ...st_response_task_run_response_public_v1.py | 101 + ...st_response_task_run_response_public_v2.py | 101 + ...nse_web_search_agent_response_public_v1.py | 101 + ...nse_web_search_agent_response_public_v2.py | 101 + ...earch_agent_template_response_public_v1.py | 101 + ...earch_agent_template_response_public_v2.py | 101 + .../nimble_client/models/location_inner.py | 138 + .../nimble_client/models/managed_by.py | 38 + .../nimble_client/models/map_payload.py | 139 + .../nimble_client/models/map_response.py | 112 + .../models/map_response_links_inner.py | 107 + .../models/media_async_payload.py | 143 + ..._payload_all_of_media_extractor_options.py | 89 + .../media_async_payload_all_of_storage.py | 102 + .../models/media_async_response.py | 101 + .../nimble_client/models/media_payload.py | 118 + .../media_payload_media_extractor_options.py | 89 + .../nimble_client/models/metadata.py | 134 + .../models/metadata_filter_public_v2.py | 135 + .../generated/nimble_client/models/output.py | 140 + .../generated/nimble_client/models/output1.py | 140 + .../generated/nimble_client/models/output2.py | 134 + .../generated/nimble_client/models/output3.py | 134 + .../models/parsing_error_result.py | 97 + .../models/parsing_success_result.py | 97 + .../nimble_client/models/parsing_type.py | 38 + .../nimble_client/models/press_action.py | 105 + .../models/press_action_press.py | 140 + .../models/press_action_press_one_of.py | 111 + .../models/privacy_filter_public_v1.py | 38 + .../models/privacy_filter_public_v2.py | 38 + .../models/privacy_level_public_v2.py | 37 + .../generated/nimble_client/models/request.py | 134 + ..._agents_agent_id_runs_run_id_result_get.py | 134 + .../nimble_client/models/result_model.py | 128 + .../nimble_client/models/revenue_annual.py | 144 + .../run_extract_template200_response.py | 140 + .../run_extract_template200_response_data.py | 136 + ...mplate200_response_data_browser_actions.py | 102 + ...onse_data_browser_actions_results_inner.py | 116 + ...200_response_data_network_capture_inner.py | 103 + ...ponse_data_network_capture_inner_filter.py | 123 + ...e_data_network_capture_inner_filter_url.py | 97 + ...ata_network_capture_inner_results_inner.py | 98 + ...ork_capture_inner_results_inner_request.py | 103 + ...rk_capture_inner_results_inner_response.py | 103 + ...mplate200_response_data_redirects_inner.py | 91 + .../run_extract_template200_response_debug.py | 105 + ...n_extract_template200_response_metadata.py | 105 + ...extract_template200_response_pagination.py | 136 + .../run_extract_template404_response.py | 110 + .../run_extract_template_async200_response.py | 110 + .../run_extract_template_async_request.py | 116 + .../models/run_stats_public_v2.py | 96 + .../nimble_client/models/safe_search.py | 38 + .../nimble_client/models/screenshot_action.py | 105 + .../models/screenshot_action_screenshot.py | 140 + .../screenshot_action_screenshot_one_of.py | 115 + .../nimble_client/models/scroll_action.py | 105 + .../models/scroll_action_scroll.py | 157 + .../models/scroll_action_scroll_one_of.py | 115 + .../models/sdk_string_variant7a06ddd6b0fd.py | 54 + .../nimble_client/models/search_depth.py | 37 + .../nimble_client/models/search_request.py | 174 + .../nimble_client/models/search_response.py | 135 + .../nimble_client/models/selector.py | 144 + .../models/serp_async_request.py | 142 + .../models/serp_async_response.py | 114 + .../models/serp_batch_payload.py | 102 + .../models/serp_batch_payload_inputs_inner.py | 145 + .../serp_batch_payload_shared_inputs.py | 145 + .../models/serp_batch_response.py | 112 + .../nimble_client/models/serp_metadata.py | 101 + .../nimble_client/models/serp_payload.py | 132 + .../stream_agent_run_events200_response.py | 154 + .../models/submit_async_extract_request.py | 321 + .../models/submit_async_serp_request.py | 142 + .../models/task_error_response.py | 97 + .../models/task_failed_response.py | 116 + .../models/task_failed_response_task.py | 171 + .../models/task_list_response.py | 114 + .../models/task_list_response_pagination.py | 97 + .../models/task_not_found_error_response.py | 104 + .../models/task_pending_response.py | 104 + .../nimble_client/models/task_progress.py | 95 + .../models/task_response_schema.py | 105 + .../models/task_response_schema_task.py | 177 + .../models/task_run_error_public_v1.py | 90 + .../models/task_run_error_public_v2.py | 90 + .../task_run_failed_result_public_v1.py | 98 + .../task_run_failed_result_public_v2.py | 98 + .../models/task_run_json_output_public_v1.py | 124 + .../models/task_run_json_output_public_v2.py | 124 + .../models/task_run_response_public_v1.py | 143 + .../models/task_run_response_public_v2.py | 143 + .../models/task_run_result_public_v1.py | 98 + .../models/task_run_result_public_v2.py | 109 + .../models/task_run_text_output_public_v1.py | 120 + .../models/task_run_text_output_public_v2.py | 120 + .../template_feature_flags_public_v1.py | 90 + .../template_generation_response_public_v1.py | 159 + .../template_input_property_public_v1.py | 128 + .../models/template_public_v1.py | 127 + .../models/template_sample_public_v1.py | 106 + .../template_version_metadata_public_v1.py | 130 + .../template_version_response_public_v1.py | 120 + .../nimble_client/models/text_claim_trust.py | 102 + .../nimble_client/models/text_run_trust.py | 109 + .../nimble_client/models/time_range.py | 40 + .../trigger_job_run_request_public_v1.py | 97 + .../trigger_job_run_request_public_v2.py | 97 + .../nimble_client/models/trust_citation.py | 132 + .../nimble_client/models/trust_mode.py | 37 + .../nimble_client/models/trust_source.py | 120 + .../models/update_job_request_public_v1.py | 133 + .../models/update_job_request_public_v2.py | 133 + .../usage_catalog_configuration_public_v2.py | 101 + .../models/usage_catalog_product_public_v2.py | 99 + .../models/usage_catalog_public_v2.py | 95 + .../models/usage_catalog_service_public_v2.py | 99 + .../usage_configuration_name_public_v2.py | 95 + .../models/usage_dimensions_public_v2.py | 139 + .../models/usage_meta_public_v2.py | 119 + .../models/usage_metrics_public_v2.py | 132 + .../models/usage_name_public_v2.py | 90 + .../models/usage_response_public_v2.py | 107 + .../models/usage_row_public_v2.py | 106 + .../nimble_client/models/validation_error.py | 108 + .../generated/nimble_client/models/visits.py | 144 + .../nimble_client/models/visits_monthly.py | 144 + .../nimble_client/models/wait_action.py | 105 + .../nimble_client/models/wait_action_wait.py | 137 + .../models/wait_action_wait_one_of.py | 104 + .../models/wait_for_element_action.py | 105 + ...ait_for_element_action_wait_for_element.py | 137 + ..._element_action_wait_for_element_one_of.py | 109 + .../models/wait_for_navigation_action.py | 105 + ...r_navigation_action_wait_for_navigation.py | 140 + ...ation_action_wait_for_navigation_one_of.py | 110 + ...b_search_agent_create_request_public_v1.py | 161 + ...b_search_agent_create_request_public_v2.py | 161 + ...eb_search_agent_goal_response_public_v1.py | 92 + ...eb_search_agent_goal_response_public_v2.py | 92 + .../web_search_agent_response_public_v1.py | 150 + .../web_search_agent_response_public_v2.py | 150 + ...arch_agent_run_create_request_public_v1.py | 142 + ...arch_agent_run_create_request_public_v2.py | 182 + ...earch_agent_run_memory_config_public_v2.py | 88 + ...h_agent_source_create_request_public_v1.py | 92 + ...h_agent_source_create_request_public_v2.py | 92 + ..._search_agent_source_response_public_v1.py | 94 + ..._search_agent_source_response_public_v2.py | 94 + ...t_suggested_question_response_public_v1.py | 92 + ...t_suggested_question_response_public_v2.py | 92 + ...earch_agent_template_response_public_v1.py | 143 + ...earch_agent_template_response_public_v2.py | 143 + .../models/web_search_agent_use_case.py | 38 + .../nimble_client/models/web_traffic_month.py | 104 + .../nimble_client/models/workforce_total.py | 144 + .../nimble_client/models/wsa_metadata.py | 88 + candidate/generated/nimble_client/py.typed | 0 candidate/generated/nimble_client/rest.py | 334 + candidate/generated/pyproject.toml | 93 + candidate/generated/requirements.txt | 4 + candidate/generated/setup.cfg | 2 + candidate/generated/setup.py | 47 + candidate/generated/test-requirements.txt | 6 + candidate/generated/tox.ini | 9 + 407 files changed, 84687 insertions(+) create mode 100644 .github/workflows/sdk-candidate.yml create mode 100644 candidate/README.md create mode 100644 candidate/contract/openapi.yaml create mode 100644 candidate/generated/.github/workflows/python.yml create mode 100644 candidate/generated/.gitignore create mode 100644 candidate/generated/.gitlab-ci.yml create mode 100644 candidate/generated/.openapi-generator-ignore create mode 100644 candidate/generated/.openapi-generator/FILES create mode 100644 candidate/generated/.openapi-generator/VERSION create mode 100644 candidate/generated/.travis.yml create mode 100644 candidate/generated/README.md create mode 100644 candidate/generated/git_push.sh create mode 100644 candidate/generated/nimble_client/__init__.py create mode 100644 candidate/generated/nimble_client/api/__init__.py create mode 100644 candidate/generated/nimble_client/api/batches_api.py create mode 100644 candidate/generated/nimble_client/api/crawl_api.py create mode 100644 candidate/generated/nimble_client/api/domain_knowledge_api.py create mode 100644 candidate/generated/nimble_client/api/extract_api.py create mode 100644 candidate/generated/nimble_client/api/extract_templates_public_api.py create mode 100644 candidate/generated/nimble_client/api/extraction_templates_api.py create mode 100644 candidate/generated/nimble_client/api/jobs_public_v2_api.py create mode 100644 candidate/generated/nimble_client/api/map_api.py create mode 100644 candidate/generated/nimble_client/api/media_api.py create mode 100644 candidate/generated/nimble_client/api/public_api_api.py create mode 100644 candidate/generated/nimble_client/api/search_api.py create mode 100644 candidate/generated/nimble_client/api/serp_api.py create mode 100644 candidate/generated/nimble_client/api/tasks_api.py create mode 100644 candidate/generated/nimble_client/api_client.py create mode 100644 candidate/generated/nimble_client/api_response.py create mode 100644 candidate/generated/nimble_client/configuration.py create mode 100644 candidate/generated/nimble_client/exceptions.py create mode 100644 candidate/generated/nimble_client/models/__init__.py create mode 100644 candidate/generated/nimble_client/models/agent_batch_body.py create mode 100644 candidate/generated/nimble_client/models/agent_batch_body_inputs_inner.py create mode 100644 candidate/generated/nimble_client/models/agent_batch_body_shared_inputs.py create mode 100644 candidate/generated/nimble_client/models/agent_body.py create mode 100644 candidate/generated/nimble_client/models/agent_sources_public_v1.py create mode 100644 candidate/generated/nimble_client/models/agent_sources_public_v2.py create mode 100644 candidate/generated/nimble_client/models/agent_sources_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/agent_sources_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/amount.py create mode 100644 candidate/generated/nimble_client/models/answer_annotation_citation.py create mode 100644 candidate/generated/nimble_client/models/answer_marker_citation.py create mode 100644 candidate/generated/nimble_client/models/answer_request.py create mode 100644 candidate/generated/nimble_client/models/answer_response.py create mode 100644 candidate/generated/nimble_client/models/artifact_download_url_public_v1.py create mode 100644 candidate/generated/nimble_client/models/artifact_download_url_public_v2.py create mode 100644 candidate/generated/nimble_client/models/artifact_list_public_v1.py create mode 100644 candidate/generated/nimble_client/models/artifact_list_public_v2.py create mode 100644 candidate/generated/nimble_client/models/artifact_preview_public_v1.py create mode 100644 candidate/generated/nimble_client/models/artifact_preview_public_v2.py create mode 100644 candidate/generated/nimble_client/models/artifact_public_v1.py create mode 100644 candidate/generated/nimble_client/models/artifact_public_v2.py create mode 100644 candidate/generated/nimble_client/models/auto_scroll_action.py create mode 100644 candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll.py create mode 100644 candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of.py create mode 100644 candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of_required.py create mode 100644 candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of_skip.py create mode 100644 candidate/generated/nimble_client/models/avg_duration_seconds.py create mode 100644 candidate/generated/nimble_client/models/batch_get_response.py create mode 100644 candidate/generated/nimble_client/models/batch_get_response_tasks_inner.py create mode 100644 candidate/generated/nimble_client/models/batch_progress_response.py create mode 100644 candidate/generated/nimble_client/models/browser_action.py create mode 100644 candidate/generated/nimble_client/models/citation.py create mode 100644 candidate/generated/nimble_client/models/citation_config.py create mode 100644 candidate/generated/nimble_client/models/citations.py create mode 100644 candidate/generated/nimble_client/models/click_action.py create mode 100644 candidate/generated/nimble_client/models/click_action_click.py create mode 100644 candidate/generated/nimble_client/models/click_action_click_one_of.py create mode 100644 candidate/generated/nimble_client/models/company_entity.py create mode 100644 candidate/generated/nimble_client/models/company_financials.py create mode 100644 candidate/generated/nimble_client/models/company_headquarters.py create mode 100644 candidate/generated/nimble_client/models/company_web_traffic.py create mode 100644 candidate/generated/nimble_client/models/content.py create mode 100644 candidate/generated/nimble_client/models/country_rank.py create mode 100644 candidate/generated/nimble_client/models/crawl_api_response.py create mode 100644 candidate/generated/nimble_client/models/crawl_api_response_completed_at.py create mode 100644 candidate/generated/nimble_client/models/crawl_api_response_crawl_options.py create mode 100644 candidate/generated/nimble_client/models/crawl_api_response_crawl_options_callback.py create mode 100644 candidate/generated/nimble_client/models/crawl_api_response_crawl_options_callback_any_of.py create mode 100644 candidate/generated/nimble_client/models/crawl_api_response_created_at.py create mode 100644 candidate/generated/nimble_client/models/crawl_api_response_tasks_inner.py create mode 100644 candidate/generated/nimble_client/models/crawl_by_filters_response.py create mode 100644 candidate/generated/nimble_client/models/crawl_by_filters_response_pagination.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_callback.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_callback_any_of.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_callback_any_of_any_of.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_browser.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_browser_any_of.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_expires.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_max_age.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_file_parsing_options.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_headers_value.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner_resource_type.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner_url.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_parser.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_render.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_session.py create mode 100644 candidate/generated/nimble_client/models/crawl_payload_extract_options_skill.py create mode 100644 candidate/generated/nimble_client/models/create_extract_template_generation_request_public_v2.py create mode 100644 candidate/generated/nimble_client/models/create_extract_template_metadata_public_v2.py create mode 100644 candidate/generated/nimble_client/models/create_extract_template_refinement_request_public_v2.py create mode 100644 candidate/generated/nimble_client/models/create_job_request_public_v1.py create mode 100644 candidate/generated/nimble_client/models/create_job_request_public_v2.py create mode 100644 candidate/generated/nimble_client/models/create_template_generation_request_public_v1.py create mode 100644 candidate/generated/nimble_client/models/create_template_metadata_public_v1.py create mode 100644 candidate/generated/nimble_client/models/create_template_refinement_request_public_v1.py create mode 100644 candidate/generated/nimble_client/models/default.py create mode 100644 candidate/generated/nimble_client/models/delete_crawl200_response.py create mode 100644 candidate/generated/nimble_client/models/driver_resolution_response.py create mode 100644 candidate/generated/nimble_client/models/duration.py create mode 100644 candidate/generated/nimble_client/models/effort.py create mode 100644 candidate/generated/nimble_client/models/eval_action.py create mode 100644 candidate/generated/nimble_client/models/eval_action_eval.py create mode 100644 candidate/generated/nimble_client/models/eval_action_eval_one_of.py create mode 100644 candidate/generated/nimble_client/models/extract200_response.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_browser_actions.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_browser_actions_results_inner.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_resource_type.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_status_code.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_url.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner_request.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner_response.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_parsing.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_data_redirects_inner.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_debug.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_metadata.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_pagination.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_pagination_any_of.py create mode 100644 candidate/generated/nimble_client/models/extract200_response_pagination_any_of1_inner.py create mode 100644 candidate/generated/nimble_client/models/extract_async_request.py create mode 100644 candidate/generated/nimble_client/models/extract_async_response.py create mode 100644 candidate/generated/nimble_client/models/extract_async_response_task.py create mode 100644 candidate/generated/nimble_client/models/extract_batch_payload.py create mode 100644 candidate/generated/nimble_client/models/extract_batch_payload_inputs_inner.py create mode 100644 candidate/generated/nimble_client/models/extract_batch_payload_inputs_inner_all_of_render.py create mode 100644 candidate/generated/nimble_client/models/extract_batch_payload_shared_inputs.py create mode 100644 candidate/generated/nimble_client/models/extract_batch_response.py create mode 100644 candidate/generated/nimble_client/models/extract_batch_response_tasks_inner.py create mode 100644 candidate/generated/nimble_client/models/extract_payload.py create mode 100644 candidate/generated/nimble_client/models/extract_template_filter_public_v2.py create mode 100644 candidate/generated/nimble_client/models/extract_template_generation_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/extract_template_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/extract_template_sample_public_v2.py create mode 100644 candidate/generated/nimble_client/models/extract_template_version_metadata_public_v2.py create mode 100644 candidate/generated/nimble_client/models/extract_template_version_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/extraction_template_batch_body.py create mode 100644 candidate/generated/nimble_client/models/extraction_template_batch_body_inputs_inner.py create mode 100644 candidate/generated/nimble_client/models/extraction_template_batch_body_shared_inputs.py create mode 100644 candidate/generated/nimble_client/models/extraction_template_body.py create mode 100644 candidate/generated/nimble_client/models/fetch_action.py create mode 100644 candidate/generated/nimble_client/models/fetch_action_fetch.py create mode 100644 candidate/generated/nimble_client/models/fetch_action_fetch_one_of.py create mode 100644 candidate/generated/nimble_client/models/fill_action.py create mode 100644 candidate/generated/nimble_client/models/fill_options.py create mode 100644 candidate/generated/nimble_client/models/fill_options_one_of.py create mode 100644 candidate/generated/nimble_client/models/fill_options_one_of1.py create mode 100644 candidate/generated/nimble_client/models/focus.py create mode 100644 candidate/generated/nimble_client/models/full_template_public_v1.py create mode 100644 candidate/generated/nimble_client/models/funding_round.py create mode 100644 candidate/generated/nimble_client/models/funding_total.py create mode 100644 candidate/generated/nimble_client/models/gateway_def033cecba0ba3d1d3_text_run_trust.py create mode 100644 candidate/generated/nimble_client/models/gateway_def07f3b31eb3e5e2cb_trust_confidence.py create mode 100644 candidate/generated/nimble_client/models/gateway_def07f55f9a59071b48_json_claim_trust.py create mode 100644 candidate/generated/nimble_client/models/gateway_def0ce4e48f62cadb20_task_run_progress_stats_event.py create mode 100644 candidate/generated/nimble_client/models/gateway_def1d511972aa34af3c_source_category.py create mode 100644 candidate/generated/nimble_client/models/gateway_def21e0e16cb4d7d291_task_run_text_output.py create mode 100644 candidate/generated/nimble_client/models/gateway_def2e37feaa5480a045_task_run_json_output.py create mode 100644 candidate/generated/nimble_client/models/gateway_def30520b8ccd213fdc_text_run_trust.py create mode 100644 candidate/generated/nimble_client/models/gateway_def386b2024130bc052_task_run_source_stats.py create mode 100644 candidate/generated/nimble_client/models/gateway_def3a5c7c6bfa027c89_task_run_output_source.py create mode 100644 candidate/generated/nimble_client/models/gateway_def3b1480fbbf8bec18_text_claim_trust.py create mode 100644 candidate/generated/nimble_client/models/gateway_def4f3b7ab2bb4e1911_task_run_progress_msg_event.py create mode 100644 candidate/generated/nimble_client/models/gateway_def54179423f3a3b0a8_json_claim_trust.py create mode 100644 candidate/generated/nimble_client/models/gateway_def6651fbad4f19182d_task_run_status_value.py create mode 100644 candidate/generated/nimble_client/models/gateway_def6d6a3bc063952be8_task_run_state_event.py create mode 100644 candidate/generated/nimble_client/models/gateway_def74786d0cba87c515_trust_source.py create mode 100644 candidate/generated/nimble_client/models/gateway_def7feddd7d853a299b_trust_source_type.py create mode 100644 candidate/generated/nimble_client/models/gateway_def936b662c6aa9dee9_task_run_state_event_run.py create mode 100644 candidate/generated/nimble_client/models/gateway_def977107e4b1c6ce11_trust_citation.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_a7c1b2a8ffcc3b45_json_run_trust.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_bc5dc0ea1fc57012_task_run_text_output.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_c0fe0f39c374a83b_task_run_progress_stats_event.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_ce9019f9e67ae903_trust_source.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_d1833882d7d67018_task_run_state_event_run.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_dc279d13fafb2038_task_run_json_output.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_eb0114a225123d8d_json_run_trust.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_f23bf5d9e6e07ed3_trust_citation.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_fb397fec4dcf2a13_text_claim_trust.py create mode 100644 candidate/generated/nimble_client/models/gateway_def_fd08b460e1d38459_task_run_state_event.py create mode 100644 candidate/generated/nimble_client/models/get_cookies_action.py create mode 100644 candidate/generated/nimble_client/models/get_cookies_action_get_cookies.py create mode 100644 candidate/generated/nimble_client/models/get_cookies_action_get_cookies_one_of.py create mode 100644 candidate/generated/nimble_client/models/get_domain_knowledge_driver400_response.py create mode 100644 candidate/generated/nimble_client/models/goto_action.py create mode 100644 candidate/generated/nimble_client/models/goto_action_goto.py create mode 100644 candidate/generated/nimble_client/models/goto_action_goto_one_of.py create mode 100644 candidate/generated/nimble_client/models/http_validation_error.py create mode 100644 candidate/generated/nimble_client/models/input_data.py create mode 100644 candidate/generated/nimble_client/models/job_context_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_context_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_destination_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_destination_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_inputs_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_inputs_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_list_filter_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_list_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_run_cancel_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_run_cancel_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_run_detail_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_run_detail_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_run_error_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_run_error_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_run_list_filter_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_run_list_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_run_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_run_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_run_summary_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_run_summary_public_v2.py create mode 100644 candidate/generated/nimble_client/models/job_schedule_public_v1.py create mode 100644 candidate/generated/nimble_client/models/job_schedule_public_v2.py create mode 100644 candidate/generated/nimble_client/models/json_claim_trust.py create mode 100644 candidate/generated/nimble_client/models/json_patch_op.py create mode 100644 candidate/generated/nimble_client/models/json_run_trust.py create mode 100644 candidate/generated/nimble_client/models/list_response_extract_template_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/list_response_extract_template_version_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/list_response_job_public_v2.py create mode 100644 candidate/generated/nimble_client/models/list_response_job_run_public_v2.py create mode 100644 candidate/generated/nimble_client/models/list_response_task_run_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/list_response_task_run_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/list_response_web_search_agent_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/list_response_web_search_agent_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/list_response_web_search_agent_template_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/list_response_web_search_agent_template_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/location_inner.py create mode 100644 candidate/generated/nimble_client/models/managed_by.py create mode 100644 candidate/generated/nimble_client/models/map_payload.py create mode 100644 candidate/generated/nimble_client/models/map_response.py create mode 100644 candidate/generated/nimble_client/models/map_response_links_inner.py create mode 100644 candidate/generated/nimble_client/models/media_async_payload.py create mode 100644 candidate/generated/nimble_client/models/media_async_payload_all_of_media_extractor_options.py create mode 100644 candidate/generated/nimble_client/models/media_async_payload_all_of_storage.py create mode 100644 candidate/generated/nimble_client/models/media_async_response.py create mode 100644 candidate/generated/nimble_client/models/media_payload.py create mode 100644 candidate/generated/nimble_client/models/media_payload_media_extractor_options.py create mode 100644 candidate/generated/nimble_client/models/metadata.py create mode 100644 candidate/generated/nimble_client/models/metadata_filter_public_v2.py create mode 100644 candidate/generated/nimble_client/models/output.py create mode 100644 candidate/generated/nimble_client/models/output1.py create mode 100644 candidate/generated/nimble_client/models/output2.py create mode 100644 candidate/generated/nimble_client/models/output3.py create mode 100644 candidate/generated/nimble_client/models/parsing_error_result.py create mode 100644 candidate/generated/nimble_client/models/parsing_success_result.py create mode 100644 candidate/generated/nimble_client/models/parsing_type.py create mode 100644 candidate/generated/nimble_client/models/press_action.py create mode 100644 candidate/generated/nimble_client/models/press_action_press.py create mode 100644 candidate/generated/nimble_client/models/press_action_press_one_of.py create mode 100644 candidate/generated/nimble_client/models/privacy_filter_public_v1.py create mode 100644 candidate/generated/nimble_client/models/privacy_filter_public_v2.py create mode 100644 candidate/generated/nimble_client/models/privacy_level_public_v2.py create mode 100644 candidate/generated/nimble_client/models/request.py create mode 100644 candidate/generated/nimble_client/models/response_get_run_result_public_v2_api_v2_public_web_search_agents_agent_id_runs_run_id_result_get.py create mode 100644 candidate/generated/nimble_client/models/result_model.py create mode 100644 candidate/generated/nimble_client/models/revenue_annual.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data_browser_actions.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data_browser_actions_results_inner.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter_url.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_request.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_response.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_data_redirects_inner.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_debug.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_metadata.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template200_response_pagination.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template404_response.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template_async200_response.py create mode 100644 candidate/generated/nimble_client/models/run_extract_template_async_request.py create mode 100644 candidate/generated/nimble_client/models/run_stats_public_v2.py create mode 100644 candidate/generated/nimble_client/models/safe_search.py create mode 100644 candidate/generated/nimble_client/models/screenshot_action.py create mode 100644 candidate/generated/nimble_client/models/screenshot_action_screenshot.py create mode 100644 candidate/generated/nimble_client/models/screenshot_action_screenshot_one_of.py create mode 100644 candidate/generated/nimble_client/models/scroll_action.py create mode 100644 candidate/generated/nimble_client/models/scroll_action_scroll.py create mode 100644 candidate/generated/nimble_client/models/scroll_action_scroll_one_of.py create mode 100644 candidate/generated/nimble_client/models/sdk_string_variant7a06ddd6b0fd.py create mode 100644 candidate/generated/nimble_client/models/search_depth.py create mode 100644 candidate/generated/nimble_client/models/search_request.py create mode 100644 candidate/generated/nimble_client/models/search_response.py create mode 100644 candidate/generated/nimble_client/models/selector.py create mode 100644 candidate/generated/nimble_client/models/serp_async_request.py create mode 100644 candidate/generated/nimble_client/models/serp_async_response.py create mode 100644 candidate/generated/nimble_client/models/serp_batch_payload.py create mode 100644 candidate/generated/nimble_client/models/serp_batch_payload_inputs_inner.py create mode 100644 candidate/generated/nimble_client/models/serp_batch_payload_shared_inputs.py create mode 100644 candidate/generated/nimble_client/models/serp_batch_response.py create mode 100644 candidate/generated/nimble_client/models/serp_metadata.py create mode 100644 candidate/generated/nimble_client/models/serp_payload.py create mode 100644 candidate/generated/nimble_client/models/stream_agent_run_events200_response.py create mode 100644 candidate/generated/nimble_client/models/submit_async_extract_request.py create mode 100644 candidate/generated/nimble_client/models/submit_async_serp_request.py create mode 100644 candidate/generated/nimble_client/models/task_error_response.py create mode 100644 candidate/generated/nimble_client/models/task_failed_response.py create mode 100644 candidate/generated/nimble_client/models/task_failed_response_task.py create mode 100644 candidate/generated/nimble_client/models/task_list_response.py create mode 100644 candidate/generated/nimble_client/models/task_list_response_pagination.py create mode 100644 candidate/generated/nimble_client/models/task_not_found_error_response.py create mode 100644 candidate/generated/nimble_client/models/task_pending_response.py create mode 100644 candidate/generated/nimble_client/models/task_progress.py create mode 100644 candidate/generated/nimble_client/models/task_response_schema.py create mode 100644 candidate/generated/nimble_client/models/task_response_schema_task.py create mode 100644 candidate/generated/nimble_client/models/task_run_error_public_v1.py create mode 100644 candidate/generated/nimble_client/models/task_run_error_public_v2.py create mode 100644 candidate/generated/nimble_client/models/task_run_failed_result_public_v1.py create mode 100644 candidate/generated/nimble_client/models/task_run_failed_result_public_v2.py create mode 100644 candidate/generated/nimble_client/models/task_run_json_output_public_v1.py create mode 100644 candidate/generated/nimble_client/models/task_run_json_output_public_v2.py create mode 100644 candidate/generated/nimble_client/models/task_run_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/task_run_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/task_run_result_public_v1.py create mode 100644 candidate/generated/nimble_client/models/task_run_result_public_v2.py create mode 100644 candidate/generated/nimble_client/models/task_run_text_output_public_v1.py create mode 100644 candidate/generated/nimble_client/models/task_run_text_output_public_v2.py create mode 100644 candidate/generated/nimble_client/models/template_feature_flags_public_v1.py create mode 100644 candidate/generated/nimble_client/models/template_generation_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/template_input_property_public_v1.py create mode 100644 candidate/generated/nimble_client/models/template_public_v1.py create mode 100644 candidate/generated/nimble_client/models/template_sample_public_v1.py create mode 100644 candidate/generated/nimble_client/models/template_version_metadata_public_v1.py create mode 100644 candidate/generated/nimble_client/models/template_version_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/text_claim_trust.py create mode 100644 candidate/generated/nimble_client/models/text_run_trust.py create mode 100644 candidate/generated/nimble_client/models/time_range.py create mode 100644 candidate/generated/nimble_client/models/trigger_job_run_request_public_v1.py create mode 100644 candidate/generated/nimble_client/models/trigger_job_run_request_public_v2.py create mode 100644 candidate/generated/nimble_client/models/trust_citation.py create mode 100644 candidate/generated/nimble_client/models/trust_mode.py create mode 100644 candidate/generated/nimble_client/models/trust_source.py create mode 100644 candidate/generated/nimble_client/models/update_job_request_public_v1.py create mode 100644 candidate/generated/nimble_client/models/update_job_request_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_catalog_configuration_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_catalog_product_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_catalog_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_catalog_service_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_configuration_name_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_dimensions_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_meta_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_metrics_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_name_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/usage_row_public_v2.py create mode 100644 candidate/generated/nimble_client/models/validation_error.py create mode 100644 candidate/generated/nimble_client/models/visits.py create mode 100644 candidate/generated/nimble_client/models/visits_monthly.py create mode 100644 candidate/generated/nimble_client/models/wait_action.py create mode 100644 candidate/generated/nimble_client/models/wait_action_wait.py create mode 100644 candidate/generated/nimble_client/models/wait_action_wait_one_of.py create mode 100644 candidate/generated/nimble_client/models/wait_for_element_action.py create mode 100644 candidate/generated/nimble_client/models/wait_for_element_action_wait_for_element.py create mode 100644 candidate/generated/nimble_client/models/wait_for_element_action_wait_for_element_one_of.py create mode 100644 candidate/generated/nimble_client/models/wait_for_navigation_action.py create mode 100644 candidate/generated/nimble_client/models/wait_for_navigation_action_wait_for_navigation.py create mode 100644 candidate/generated/nimble_client/models/wait_for_navigation_action_wait_for_navigation_one_of.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_create_request_public_v1.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_create_request_public_v2.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_goal_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_goal_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_run_create_request_public_v1.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_run_create_request_public_v2.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_run_memory_config_public_v2.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_source_create_request_public_v1.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_source_create_request_public_v2.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_source_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_source_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_suggested_question_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_suggested_question_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_template_response_public_v1.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_template_response_public_v2.py create mode 100644 candidate/generated/nimble_client/models/web_search_agent_use_case.py create mode 100644 candidate/generated/nimble_client/models/web_traffic_month.py create mode 100644 candidate/generated/nimble_client/models/workforce_total.py create mode 100644 candidate/generated/nimble_client/models/wsa_metadata.py create mode 100644 candidate/generated/nimble_client/py.typed create mode 100644 candidate/generated/nimble_client/rest.py create mode 100644 candidate/generated/pyproject.toml create mode 100644 candidate/generated/requirements.txt create mode 100644 candidate/generated/setup.cfg create mode 100644 candidate/generated/setup.py create mode 100644 candidate/generated/test-requirements.txt create mode 100644 candidate/generated/tox.ini diff --git a/.github/workflows/sdk-candidate.yml b/.github/workflows/sdk-candidate.yml new file mode 100644 index 0000000..281bf5a --- /dev/null +++ b/.github/workflows/sdk-candidate.yml @@ -0,0 +1,30 @@ +name: SDK candidate + +on: + pull_request: + paths: + - 'candidate/**' + - '.github/workflows/sdk-candidate.yml' + +permissions: + contents: read + +jobs: + regenerate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Verify frozen SDK input + run: echo '283b1079b67453be6e8f06ccd3bf9955fedd553a9ab881e3f1f3904467d87cca candidate/contract/openapi.yaml' | sha256sum --check + - name: Regenerate selected client + run: | + docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/local" \ + openapitools/openapi-generator-cli:v7.27.0 generate \ + -i /local/candidate/contract/openapi.yaml -g python \ + -o /local/candidate/generated \ + --additional-properties=packageName=nimble_client \ + --global-property=apiTests=false,modelTests=false,apiDocs=false,modelDocs=false \ + > "$RUNNER_TEMP/sdk-generation.log" 2>&1 + test -z "$(git status --porcelain -- candidate/generated)" + - name: Compile candidate + run: python -m compileall -q candidate/generated/nimble_client diff --git a/candidate/README.md b/candidate/README.md new file mode 100644 index 0000000..95bed29 --- /dev/null +++ b/candidate/README.md @@ -0,0 +1,13 @@ +# OpenAPI generator candidate + +This directory is a reviewable generator output, not the published Python SDK. +It does not change the root package, its version, or its release workflow. + +- Platform source commit: `61ad0c8b85a98b48d73a0370d022dd26a14831f5` +- SDK input SHA-256: `283b1079b67453be6e8f06ccd3bf9955fedd553a9ab881e3f1f3904467d87cca` +- Generator image: `openapitools/openapi-generator-cli:v7.27.0` +- Selected operations: 59 + +The input is a frozen copy of Platform's proposed `sdk/openapi.yaml` in +Nimbleway/platform#3592. CI regenerates and compiles this candidate. Generated +package metadata is provisional and must be replaced before publication. diff --git a/candidate/contract/openapi.yaml b/candidate/contract/openapi.yaml new file mode 100644 index 0000000..a246fa9 --- /dev/null +++ b/candidate/contract/openapi.yaml @@ -0,0 +1,18968 @@ +components: + schemas: + AgentBatchBody: + description: Request body for executing a batch of agent requests + properties: + inputs: + items: + additionalProperties: false + properties: + formats: + description: Response formats to include. All disabled by default. + examples: + - - html + - markdown + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + localization: + type: boolean + params: + additionalProperties: {} + properties: {} + type: object + type: object + minItems: 1 + type: array + shared_inputs: + properties: + agent: + type: string + formats: + description: Response formats to include. All disabled by default. + examples: + - - html + - markdown + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + localization: + type: boolean + params: + additionalProperties: {} + properties: {} + type: object + required: + - agent + type: object + required: + - inputs + - shared_inputs + type: object + AgentBody: + description: Request body for executing a WSA + properties: + agent: + type: string + formats: + description: Response formats to include. All disabled by default. + examples: + - - html + - markdown + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + localization: + default: false + type: boolean + params: + additionalProperties: {} + properties: {} + type: object + required: + - params + - agent + type: object + AgentSourcesPublicV1: + additionalProperties: false + properties: + allow: + description: Source groups the agent is allowed to use. + items: + $ref: '#/components/schemas/WebSearchAgentSourceCreateRequestPublicV1' + title: Allow + type: array + avoid: + anyOf: + - type: string + - type: 'null' + description: Free-text guidance describing sources or domains to avoid. + title: Avoid + block: + description: Source groups the agent should not use. + items: + $ref: '#/components/schemas/WebSearchAgentSourceCreateRequestPublicV1' + title: Block + type: array + prioritize: + anyOf: + - type: string + - type: 'null' + description: Free-text guidance describing sources or domains to prioritize. + title: Prioritize + title: AgentSourcesPublicV1 + type: object + AgentSourcesPublicV2: + additionalProperties: false + properties: + allow: + description: Source groups the agent is allowed to use. + items: + $ref: '#/components/schemas/WebSearchAgentSourceCreateRequestPublicV2' + title: Allow + type: array + avoid: + anyOf: + - type: string + - type: 'null' + description: Free-text guidance describing sources or domains to avoid. + title: Avoid + block: + description: Source groups the agent should not use. + items: + $ref: '#/components/schemas/WebSearchAgentSourceCreateRequestPublicV2' + title: Block + type: array + prioritize: + anyOf: + - type: string + - type: 'null' + description: Free-text guidance describing sources or domains to prioritize. + title: Prioritize + title: AgentSourcesPublicV2 + type: object + AgentSourcesResponsePublicV1: + additionalProperties: false + properties: + allow: + description: Source groups the agent is allowed to use. + items: + $ref: '#/components/schemas/WebSearchAgentSourceResponsePublicV1' + title: Allow + type: array + avoid: + anyOf: + - type: string + - type: 'null' + description: Free-text guidance describing sources or domains to avoid. + title: Avoid + block: + description: Source groups the agent should not use. + items: + $ref: '#/components/schemas/WebSearchAgentSourceResponsePublicV1' + title: Block + type: array + prioritize: + anyOf: + - type: string + - type: 'null' + description: Free-text guidance describing sources or domains to prioritize. + title: Prioritize + title: AgentSourcesResponsePublicV1 + type: object + AgentSourcesResponsePublicV2: + additionalProperties: false + properties: + allow: + description: Source groups the agent is allowed to use. + items: + $ref: '#/components/schemas/WebSearchAgentSourceResponsePublicV2' + title: Allow + type: array + avoid: + anyOf: + - type: string + - type: 'null' + description: Free-text guidance describing sources or domains to avoid. + title: Avoid + block: + description: Source groups the agent should not use. + items: + $ref: '#/components/schemas/WebSearchAgentSourceResponsePublicV2' + title: Block + type: array + prioritize: + anyOf: + - type: string + - type: 'null' + description: Free-text guidance describing sources or domains to prioritize. + title: Prioritize + title: AgentSourcesResponsePublicV2 + type: object + AnswerAnnotationCitation: + description: Annotation-style citation with character-range offsets into the answer text. + properties: + description: + anyOf: + - type: string + - type: 'null' + description: Snippet/description from the search result + title: Description + end_index: + description: Exclusive end character offset of the inline link in the answer text + title: End Index + type: integer + start_index: + description: Inclusive start character offset of the inline link in the answer text + title: Start Index + type: integer + title: + title: Title + type: string + type: + const: url_citation + default: url_citation + title: Type + type: string + url: + title: Url + type: string + required: + - start_index + - end_index + - url + - title + title: AnswerAnnotationCitation + type: object + AnswerMarkerCitation: + description: Marker-style citation for the /answer endpoint ([N] references). + properties: + description: + anyOf: + - type: string + - type: 'null' + description: Snippet/description from the search result + title: Description + index: + description: 1-based citation index matching [N] markers in the answer text + title: Index + type: integer + title: + title: Title + type: string + url: + title: Url + type: string + required: + - index + - url + - title + title: AnswerMarkerCitation + type: object + AnswerRequest: + description: Request body model for the /answer endpoint. + properties: + citations: + anyOf: + - $ref: '#/components/schemas/CitationConfig' + - type: 'null' + description: Citation configuration. Omit for default behavior (citations enabled, no description). + query: + description: Question to answer using web search results + maxLength: 1000 + minLength: 1 + title: Query + type: string + required: + - query + title: AnswerRequest + type: object + AnswerResponse: + description: Response model for the /answer endpoint. + properties: + answer: + description: LLM-generated answer to the query + title: Answer + type: string + citations: + anyOf: + - items: + $ref: '#/components/schemas/AnswerMarkerCitation' + type: array + - items: + $ref: '#/components/schemas/AnswerAnnotationCitation' + type: array + description: 'Sources referenced in the answer. Shape depends on citations.format: ''marker'' includes index, ''annotation'' + includes start_index/end_index character ranges.' + title: Citations + request_id: + description: Unique identifier for this request (UUID) + title: Request Id + type: string + required: + - answer + - citations + - request_id + title: AnswerResponse + type: object + ArtifactDownloadUrlPublicV1: + description: A pre-signed URL for downloading an artifact. + properties: + expires_at: + description: When the download URL expires. + format: date-time + title: Expires At + type: string + url: + description: Pre-signed URL to download the artifact. + title: Url + type: string + required: + - url + - expires_at + title: ArtifactDownloadUrlPublicV1 + type: object + ArtifactDownloadUrlPublicV2: + description: A pre-signed URL for downloading an artifact. + properties: + expires_at: + description: When the download URL expires. + format: date-time + title: Expires At + type: string + url: + description: Pre-signed URL to download the artifact. + title: Url + type: string + required: + - url + - expires_at + title: ArtifactDownloadUrlPublicV2 + type: object + ArtifactListPublicV1: + description: Artifacts produced by a run. + properties: + items: + description: Artifacts produced by the run. + items: + $ref: '#/components/schemas/ArtifactPublicV1' + title: Items + type: array + required: + - items + title: ArtifactListPublicV1 + type: object + ArtifactListPublicV2: + description: Artifacts produced by a run. + properties: + items: + description: Artifacts produced by the run. + items: + $ref: '#/components/schemas/ArtifactPublicV2' + title: Items + type: array + required: + - items + title: ArtifactListPublicV2 + type: object + ArtifactPreviewPublicV1: + description: A tabular preview of an artifact's contents. + properties: + columns: + description: Column names in the preview. + items: + type: string + title: Columns + type: array + row_count: + description: Total number of rows in the artifact. + title: Row Count + type: integer + rows: + description: Sample rows from the artifact. + items: + additionalProperties: true + type: object + title: Rows + type: array + required: + - columns + - row_count + - rows + title: ArtifactPreviewPublicV1 + type: object + ArtifactPreviewPublicV2: + description: A tabular preview of an artifact's contents. + properties: + columns: + description: Column names in the preview. + items: + type: string + title: Columns + type: array + row_count: + description: Total number of rows in the artifact. + title: Row Count + type: integer + rows: + description: Sample rows from the artifact. + items: + additionalProperties: true + type: object + title: Rows + type: array + required: + - columns + - row_count + - rows + title: ArtifactPreviewPublicV2 + type: object + ArtifactPublicV1: + description: A file produced by a run. + properties: + created_at: + description: When the artifact was created. + format: date-time + title: Created At + type: string + description: + description: Human-readable artifact description. + title: Description + type: string + id: + description: Artifact identifier. + title: Id + type: string + type: + description: Artifact type. + title: Type + type: string + required: + - id + - type + - description + - created_at + title: ArtifactPublicV1 + type: object + ArtifactPublicV2: + description: A file produced by a run. + properties: + created_at: + description: When the artifact was created. + format: date-time + title: Created At + type: string + description: + description: Human-readable artifact description. + title: Description + type: string + id: + description: Artifact identifier. + title: Id + type: string + type: + description: Artifact type. + title: Type + type: string + required: + - id + - type + - description + - created_at + title: ArtifactPublicV2 + type: object + AutoScrollAction: + additionalProperties: false + description: Continuously scroll to load dynamic content + properties: + auto_scroll: + oneOf: + - type: boolean + - $ref: '#/components/schemas/Duration' + - additionalProperties: false + properties: + click_selector: + $ref: '#/components/schemas/Selector' + container: + $ref: '#/components/schemas/Selector' + delay_after_scroll: + $ref: '#/components/schemas/Duration' + idle_timeout: + $ref: '#/components/schemas/Duration' + loading_selector: + $ref: '#/components/schemas/Selector' + max_duration: + $ref: '#/components/schemas/Duration' + pause_on_selector: + $ref: '#/components/schemas/Selector' + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + step_size: + type: number + type: object + required: + - auto_scroll + type: object + BatchGetResponse: + additionalProperties: false + description: Response containing batch details with all tasks. + properties: + completed: + description: Whether all tasks in the batch have finished. + type: boolean + completed_at: + description: ISO timestamp when the batch completed. + type: string + completed_count: + description: Number of tasks that have completed so far. + type: number + created_at: + description: ISO timestamp when the batch was created. + type: string + id: + description: Unique identifier for the batch. + type: string + progress: + description: Completion ratio between 0 and 1. + type: number + status: + const: success + type: string + tasks: + description: List of tasks in the batch. + items: + anyOf: + - additionalProperties: false + properties: + _query: {} + account_name: + description: Account name that owns the task. + type: string + api_type: + enum: + - web + - serp + - ecommerce + - social + - media + - agent + - extract + - fast-serp + - labs + type: string + batch_id: + anyOf: + - type: string + - type: 'null' + description: Batch ID if this task is part of a batch. + examples: + - 4b0a90bf-c951-42e4-95b3-a95a65ba69fc + created_at: + description: Timestamp when the task was created. + examples: + - '2024-01-15T10:30:00Z' + type: string + download_url: + anyOf: + - format: uri + type: string + - type: 'null' + description: URL for downloading the task results. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000/results + error: + anyOf: + - type: string + - type: 'null' + description: Error message if the task failed. + examples: + - Connection timeout + error_type: + anyOf: + - type: string + - type: 'null' + description: Classification of the error type. + examples: + - timeout_error + id: + description: Unique task identifier. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + minLength: 1 + type: string + input: + description: Original input data for the task. ZDR tasks retain only a policy marker and required internal + routing metadata. + modified_at: + description: Timestamp when the task was last modified. + examples: + - '2024-01-15T10:35:00Z' + type: string + output_url: + anyOf: + - type: string + - type: 'null' + description: Storage location of the output data. + queue: + description: Queue name the task was submitted to. + type: string + state: + description: Current state of the task. + enum: + - pending + - queued + - in_progress + - success + - error + examples: + - pending + type: string + status_code: + description: HTTP status code from the task execution. + examples: + - 200 + type: number + status_url: + description: URL for checking the task status. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000 + format: uri + type: string + required: + - id + - state + - status_url + - created_at + - input + - _query + type: object + - type: 'null' + type: array + required: + - status + - id + - completed + - completed_count + - progress + - created_at + - tasks + type: object + BatchProgressResponse: + additionalProperties: false + description: Lightweight batch progress without task details. + properties: + completed: + description: Whether all tasks in the batch have finished. + type: boolean + completed_at: + description: ISO timestamp when the batch completed. + type: string + completed_count: + description: Number of tasks that have completed so far. + type: number + id: + description: Unique identifier for the batch. + type: string + progress: + description: Completion ratio between 0 and 1. + type: number + status: + const: success + type: string + required: + - status + - id + - completed + - completed_count + - progress + type: object + BrowserAction: + description: A browser automation action. Exactly one action key must be present. + oneOf: + - $ref: '#/components/schemas/AutoScrollAction' + - $ref: '#/components/schemas/ClickAction' + - $ref: '#/components/schemas/EvalAction' + - $ref: '#/components/schemas/FetchAction' + - $ref: '#/components/schemas/FillAction' + - $ref: '#/components/schemas/GetCookiesAction' + - $ref: '#/components/schemas/GotoAction' + - $ref: '#/components/schemas/PressAction' + - $ref: '#/components/schemas/ScreenshotAction' + - $ref: '#/components/schemas/ScrollAction' + - $ref: '#/components/schemas/WaitAction' + - $ref: '#/components/schemas/WaitForElementAction' + - $ref: '#/components/schemas/WaitForNavigationAction' + BrowserActions: + description: Array of browser automation actions to execute sequentially + example: + - goto: https://example.com/login + - wait_for_element: '#login-form' + - fill: + selector: '#username' + value: user@example.com + - fill: + selector: '#password' + value: password123 + - click: '#submit' + - screenshot: + full_page: true + items: + $ref: '#/components/schemas/BrowserAction' + minItems: 1 + type: array + Citation: + description: Citation model that maps citation markers to result indices. + properties: + marker: + description: Citation marker number (e.g., 1 for [1]) + minimum: 1.0 + title: Marker + type: integer + result_index: + description: Zero-based index into the results array + minimum: 0.0 + title: Result Index + type: integer + required: + - marker + - result_index + title: Citation + type: object + CitationConfig: + description: Configuration for citation behavior in the /answer endpoint. + properties: + enabled: + default: true + description: Include citations in the answer. When false, returns plain answer without [N] markers. + title: Enabled + type: boolean + format: + default: marker + description: 'Citation format: ''marker'' embeds [N] in text; ''annotation'' returns text with inline markdown links + and character-range citations.' + enum: + - marker + - annotation + title: Format + type: string + include_description: + default: false + description: Include description/snippet in each citation object. Default returns only index, url, title. + title: Include Description + type: boolean + title: CitationConfig + type: object + ClickAction: + additionalProperties: false + description: Click on an element by selector + properties: + click: + oneOf: + - $ref: '#/components/schemas/Selector' + - additionalProperties: false + properties: + count: + default: 1 + minimum: 1 + type: number + delay: + $ref: '#/components/schemas/Duration' + offset_x: + maximum: 9007199254740991 + minimum: -9007199254740991 + type: integer + offset_y: + maximum: 9007199254740991 + minimum: -9007199254740991 + type: integer + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + scroll: + default: true + type: boolean + selector: + $ref: '#/components/schemas/Selector' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + steps: + minimum: 1 + type: number + strategy: + enum: + - linear + - ghost-cursor + - windmouse + type: string + timeout: + default: 15000 + description: 'Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.' + minimum: 0 + type: number + visible: + default: true + type: boolean + required: + - selector + type: object + required: + - click + type: object + CompanyEntity: + description: Structured data about the company a result is about. + properties: + financials: + anyOf: + - $ref: '#/components/schemas/CompanyFinancials' + - type: 'null' + founded_year: + anyOf: + - type: integer + - type: 'null' + title: Founded Year + headquarters: + anyOf: + - $ref: '#/components/schemas/CompanyHeadquarters' + - type: 'null' + name: + anyOf: + - type: string + - type: 'null' + title: Name + type: + const: company + default: company + title: Type + type: string + web_traffic: + anyOf: + - $ref: '#/components/schemas/CompanyWebTraffic' + - type: 'null' + workforce_total: + anyOf: + - type: integer + - type: number + - type: 'null' + description: Employee count + title: Workforce Total + title: CompanyEntity + type: object + CompanyFinancials: + properties: + funding_latest_round: + anyOf: + - $ref: '#/components/schemas/FundingRound' + - type: 'null' + funding_total: + anyOf: + - type: integer + - type: number + - type: 'null' + description: USD + title: Funding Total + revenue_annual: + anyOf: + - type: integer + - type: number + - type: 'null' + description: USD + title: Revenue Annual + title: CompanyFinancials + type: object + CompanyHeadquarters: + properties: + address: + anyOf: + - type: string + - type: 'null' + title: Address + city: + anyOf: + - type: string + - type: 'null' + title: City + country: + anyOf: + - type: string + - type: 'null' + title: Country + postal_code: + anyOf: + - type: string + - type: 'null' + title: Postal Code + title: CompanyHeadquarters + type: object + CompanyWebTraffic: + properties: + avg_duration_seconds: + anyOf: + - type: integer + - type: number + - type: 'null' + title: Avg Duration Seconds + country_rank: + anyOf: + - type: integer + - type: number + - type: 'null' + title: Country Rank + history: + anyOf: + - items: + $ref: '#/components/schemas/WebTrafficMonth' + type: array + - type: 'null' + title: History + visits_monthly: + anyOf: + - type: integer + - type: number + - type: 'null' + title: Visits Monthly + title: CompanyWebTraffic + type: object + CrawlApiResponse: + additionalProperties: false + description: Crawl API response + properties: + account_name: + type: string + completed: + type: number + completed_at: + anyOf: + - anyOf: + - type: string + - additionalProperties: true + type: object + - type: 'null' + crawl_id: + format: uuid + type: string + crawl_options: + additionalProperties: {} + properties: + allow_external_links: + default: false + type: boolean + allow_subdomains: + default: false + type: boolean + callback: + anyOf: + - additionalProperties: false + properties: + events: + items: + enum: + - started + - page + - completed + - failed + type: string + type: array + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + metadata: + additionalProperties: {} + propertyNames: + type: string + type: object + url: + format: uri + type: string + required: + - url + type: object + - format: uri + type: string + crawl_entire_domain: + default: false + type: boolean + exclude_paths: + items: + type: string + type: array + ignore_query_parameters: + default: false + type: boolean + include_paths: + items: + type: string + type: array + limit: + default: 5000 + maximum: 10000 + minimum: 1 + type: integer + max_discovery_depth: + default: 5 + maximum: 20 + minimum: 1 + type: integer + sitemap: + default: include + enum: + - skip + - include + - only + type: string + required: + - sitemap + - crawl_entire_domain + - limit + - max_discovery_depth + - ignore_query_parameters + - allow_external_links + - allow_subdomains + type: object + created_at: + anyOf: + - type: string + - additionalProperties: true + type: object + extract_options: + anyOf: + - additionalProperties: {} + properties: {} + type: object + - type: 'null' + failed: + type: number + name: + anyOf: + - type: string + - type: 'null' + pending: + type: number + status: + enum: + - queued + - running + - succeeded + - failed + - canceled + type: string + tasks: + items: + additionalProperties: false + properties: + created_at: + type: string + status: + enum: + - pending + - completed + - failed + type: string + task_id: + type: string + updated_at: + type: string + required: + - task_id + - status + type: object + type: array + total: + type: number + updated_at: + anyOf: + - type: string + - additionalProperties: true + type: object + url: + format: uri + type: string + required: + - url + - status + - account_name + - created_at + - updated_at + - crawl_options + - crawl_id + type: object + CrawlByFiltersResponse: + additionalProperties: false + description: Successful get crawl response + properties: + data: + items: + $ref: '#/components/schemas/CrawlApiResponse' + type: array + pagination: + additionalProperties: false + properties: + has_next: + type: boolean + next_cursor: + anyOf: + - type: string + - type: 'null' + total: + type: number + required: + - has_next + type: object + required: + - data + - pagination + type: object + CrawlPayload: + description: Request body model for the /crawl endpoint + properties: + allow_external_links: + default: false + description: Allows the crawler to follow links to external websites. + examples: + - false + type: boolean + allow_subdomains: + default: false + description: Allows the crawler to follow links to subdomains of the main domain. + examples: + - false + type: boolean + callback: + anyOf: + - anyOf: + - properties: + events: + items: + enum: + - started + - page + - completed + - failed + type: string + type: array + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + metadata: + additionalProperties: {} + propertyNames: + type: string + type: object + url: + format: uri + type: string + required: + - url + type: object + - format: uri + type: string + - format: uri + type: string + description: Webhook configuration for receiving crawl results. + crawl_entire_domain: + default: false + description: Allows the crawler to follow internal links to sibling or parent URLs, not just child paths. + examples: + - false + type: boolean + exclude_paths: + description: URL pathname regex patterns that exclude matching URLs from the crawl. + examples: + - - /exclude-this-path + - /and-this-path + items: + type: string + type: array + extract_options: + properties: + auto_driver_configuration: + additionalProperties: + maximum: 10 + minimum: 0 + type: integer + description: 'Custom flow for the optimization engine: maps candidate names to the number of attempts to spend + on each candidate before advancing (0 skips it). Key order defines the flow order. Providing it opts the request + into ''auto'' driver selection.' + examples: + - vx10: 2 + vx10-pro: 0 + vx6-fast: 1 + vx6-stealth: 1 + vx8: 5 + vx8-pro: 5 + propertyNames: + type: string + type: object + body: + description: Request body for POST, PUT, PATCH methods + examples: + - key: value + browser: + anyOf: + - description: Browser type to emulate + enum: + - chrome + - firefox + examples: + - chrome + type: string + - properties: + name: + enum: + - chrome + - firefox + type: string + version: + description: Specific browser version to emulate + examples: + - 120.0.0 + type: string + required: + - name + type: object + browser_actions: + $ref: '#/components/schemas/BrowserActions' + city: + description: City for geolocation + examples: + - Los Angeles + type: string + consent_header: + description: Whether to automatically handle cookie consent headers + type: boolean + cookies: + anyOf: + - description: Browser cookies as array of cookie objects + items: + additionalProperties: {} + properties: + creation: + anyOf: + - type: string + - type: 'null' + domain: + anyOf: + - type: string + - type: 'null' + expires: + anyOf: + - type: string + - const: Infinity + type: string + extensions: + anyOf: + - items: + type: string + type: array + - type: 'null' + hostOnly: + anyOf: + - type: boolean + - type: 'null' + httpOnly: + anyOf: + - type: boolean + - type: 'null' + lastAccessed: + anyOf: + - type: string + - type: 'null' + maxAge: + anyOf: + - anyOf: + - type: number + - const: Infinity + type: string + - const: -Infinity + type: string + - type: 'null' + name: + type: string + path: + anyOf: + - type: string + - type: 'null' + pathIsDefault: + anyOf: + - type: boolean + - type: 'null' + sameSite: + enum: + - strict + - lax + - none + type: string + secure: + type: boolean + value: + type: string + type: object + type: array + - description: Browser cookies as string + examples: + - sessionId=abc123; userId=user456 + type: string + country: + anyOf: + - enum: + - AD + - AE + - AF + - AG + - AI + - AL + - AM + - AO + - AQ + - AR + - AS + - AT + - AU + - AW + - AX + - AZ + - BA + - BB + - BD + - BE + - BF + - BG + - BH + - BI + - BJ + - BL + - BM + - BN + - BO + - BQ + - BR + - BS + - BT + - BV + - BW + - BY + - BZ + - CA + - CC + - CD + - CF + - CG + - CH + - CI + - CK + - CL + - CM + - CN + - CO + - CR + - CU + - CV + - CW + - CX + - CY + - CZ + - DE + - DJ + - DK + - DM + - DO + - DZ + - EC + - EE + - EG + - EH + - ER + - ES + - ET + - FI + - FJ + - FK + - FM + - FO + - FR + - GA + - GB + - GD + - GE + - GF + - GG + - GH + - GI + - GL + - GM + - GN + - GP + - GQ + - GR + - GS + - GT + - GU + - GW + - GY + - HK + - HM + - HN + - HR + - HT + - HU + - ID + - IE + - IL + - IM + - IN + - IO + - IQ + - IR + - IS + - IT + - JE + - JM + - JO + - JP + - KE + - KG + - KH + - KI + - KM + - KN + - KP + - KR + - KW + - KY + - KZ + - LA + - LB + - LC + - LI + - LK + - LR + - LS + - LT + - LU + - LV + - LY + - MA + - MC + - MD + - ME + - MF + - MG + - MH + - MK + - ML + - MM + - MN + - MO + - MP + - MQ + - MR + - MS + - MT + - MU + - MV + - MW + - MX + - MY + - MZ + - NA + - NC + - NE + - NF + - NG + - NI + - NL + - 'NO' + - NP + - NR + - NU + - NZ + - OM + - PA + - PE + - PF + - PG + - PH + - PK + - PL + - PM + - PN + - PR + - PS + - PT + - PW + - PY + - QA + - RE + - RO + - RS + - RU + - RW + - SA + - SB + - SC + - SD + - SE + - SG + - SH + - SI + - SJ + - SK + - SL + - SM + - SN + - SO + - SR + - SS + - ST + - SV + - SX + - SY + - SZ + - TC + - TD + - TF + - TG + - TH + - TJ + - TK + - TL + - TM + - TN + - TO + - TR + - TT + - TV + - TW + - TZ + - UA + - UG + - UM + - US + - UY + - UZ + - VA + - VC + - VE + - VG + - VI + - VN + - VU + - WF + - WS + - XK + - YE + - YT + - ZA + - ZM + - ZW + type: string + - const: ALL + type: string + default: ALL + description: Country code for geolocation and proxy selection + examples: + - US + device: + default: desktop + description: Device type for browser emulation + enum: + - desktop + - mobile + - tablet + examples: + - desktop + type: string + driver: + description: Browser driver to use + enum: + - auto + - max + - vx6 + - vx8 + - vx8-pro + - vx10 + - vx10-pro + - vx12 + - vx12-pro + - media-vx6 + - fast-vx6 + examples: + - vx8 + type: string + expected_status_codes: + description: Expected HTTP status codes for successful requests + examples: + - - 200 + - 201 + items: + maximum: 9007199254740991 + minimum: -9007199254740991 + type: integer + type: array + file_parsing_options: + description: Parses PDF and Office documents into markdown. Enabling this adds a per-page-parsed charge on top + of the base extract price, at a rate that depends on `mode` — see the pricing page. Billing is per page parsed, + not per document. + properties: + max_pages: + description: Maximum number of pages to parse. A PDF with more pages is rejected instead of being parsed, + so it is never billed. Other formats (spreadsheets, presentations) are instead truncated to the first + `max_pages` pages, and only those pages are parsed and billed. + examples: + - 50 + maximum: 9007199254740991 + minimum: 1 + type: integer + mode: + default: light + description: '`light`: fast, text-native extraction only, no OCR support. `pro`: adds LLM-based parsing + with OCR fallback for scanned or complex PDFs. The two modes are billed at different per-page rates.' + enum: + - light + - pro + examples: + - pro + type: string + type: object + formats: + description: List of acceptable response formats in order of preference + examples: + - - html + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + headers: + additionalProperties: + anyOf: + - type: string + - type: 'null' + - items: + type: string + type: array + default: {} + description: Custom HTTP headers to include in the request + examples: + - Accept-Language: en-US + User-Agent: CustomBot/1.0 + propertyNames: + type: string + type: object + http2: + default: false + description: Whether to use HTTP/2 protocol + examples: + - true + type: boolean + is_xhr: + default: false + description: Whether to emulate XMLHttpRequest behavior + examples: + - true + type: boolean + locale: + anyOf: + - enum: + - aa-DJ + - aa-ER + - aa-ET + - af + - af-NA + - af-ZA + - ak + - ak-GH + - am + - am-ET + - an-ES + - ar + - ar-AE + - ar-BH + - ar-DZ + - ar-EG + - ar-IN + - ar-IQ + - ar-JO + - ar-KW + - ar-LB + - ar-LY + - ar-MA + - ar-OM + - ar-QA + - ar-SA + - ar-SD + - ar-SY + - ar-TN + - ar-YE + - as + - as-IN + - asa + - asa-TZ + - ast-ES + - az + - az-AZ + - az-Cyrl + - az-Cyrl-AZ + - az-Latn + - az-Latn-AZ + - be + - be-BY + - bem + - bem-ZM + - ber-DZ + - ber-MA + - bez + - bez-TZ + - bg + - bg-BG + - bho-IN + - bm + - bm-ML + - bn + - bn-BD + - bn-IN + - bo + - bo-CN + - bo-IN + - br-FR + - brx-IN + - bs + - bs-BA + - byn-ER + - ca + - ca-AD + - ca-ES + - ca-FR + - ca-IT + - cgg + - cgg-UG + - chr + - chr-US + - crh-UA + - cs + - cs-CZ + - csb-PL + - cv-RU + - cy + - cy-GB + - da + - da-DK + - dav + - dav-KE + - de + - de-AT + - de-BE + - de-CH + - de-DE + - de-LI + - de-LU + - dv-MV + - dz-BT + - ebu + - ebu-KE + - ee + - ee-GH + - ee-TG + - el + - el-CY + - el-GR + - en + - en-AG + - en-AS + - en-AU + - en-BE + - en-BW + - en-BZ + - en-CA + - en-DK + - en-GB + - en-GU + - en-HK + - en-IE + - en-IN + - en-JM + - en-MH + - en-MP + - en-MT + - en-MU + - en-NA + - en-NG + - en-NZ + - en-PH + - en-PK + - en-SG + - en-TT + - en-UM + - en-US + - en-VI + - en-ZA + - en-ZM + - en-ZW + - eo + - es + - es-419 + - es-AR + - es-BO + - es-CL + - es-CO + - es-CR + - es-CU + - es-DO + - es-EC + - es-ES + - es-GQ + - es-GT + - es-HN + - es-MX + - es-NI + - es-PA + - es-PE + - es-PR + - es-PY + - es-SV + - es-US + - es-UY + - es-VE + - et + - et-EE + - eu + - eu-ES + - fa + - fa-AF + - fa-IR + - ff + - ff-SN + - fi + - fi-FI + - fil + - fil-PH + - fo + - fo-FO + - fr + - fr-BE + - fr-BF + - fr-BI + - fr-BJ + - fr-BL + - fr-CA + - fr-CD + - fr-CF + - fr-CG + - fr-CH + - fr-CI + - fr-CM + - fr-DJ + - fr-FR + - fr-GA + - fr-GN + - fr-GP + - fr-GQ + - fr-KM + - fr-LU + - fr-MC + - fr-MF + - fr-MG + - fr-ML + - fr-MQ + - fr-NE + - fr-RE + - fr-RW + - fr-SN + - fr-TD + - fr-TG + - fur-IT + - fy-DE + - fy-NL + - ga + - ga-IE + - gd-GB + - gez-ER + - gez-ET + - gl + - gl-ES + - gsw + - gsw-CH + - gu + - gu-IN + - guz + - guz-KE + - gv + - gv-GB + - ha + - ha-Latn + - ha-Latn-GH + - ha-Latn-NE + - ha-Latn-NG + - ha-NG + - haw + - haw-US + - he + - he-IL + - hi + - hi-IN + - hne-IN + - hr + - hr-HR + - hsb-DE + - ht-HT + - hu + - hu-HU + - hy + - hy-AM + - id + - id-ID + - ig + - ig-NG + - ii + - ii-CN + - ik-CA + - is + - is-IS + - it + - it-CH + - it-IT + - iu-CA + - iw-IL + - ja + - ja-JP + - jmc + - jmc-TZ + - ka + - ka-GE + - kab + - kab-DZ + - kam + - kam-KE + - kde + - kde-TZ + - kea + - kea-CV + - khq + - khq-ML + - ki + - ki-KE + - kk + - kk-Cyrl + - kk-Cyrl-KZ + - kk-KZ + - kl + - kl-GL + - kln + - kln-KE + - km + - km-KH + - kn + - kn-IN + - ko + - ko-KR + - kok + - kok-IN + - ks-IN + - ku-TR + - kw + - kw-GB + - ky-KG + - lag + - lag-TZ + - lb-LU + - lg + - lg-UG + - li-BE + - li-NL + - lij-IT + - lo-LA + - lt + - lt-LT + - luo + - luo-KE + - luy + - luy-KE + - lv + - lv-LV + - mag-IN + - mai-IN + - mas + - mas-KE + - mas-TZ + - mer + - mer-KE + - mfe + - mfe-MU + - mg + - mg-MG + - mhr-RU + - mi-NZ + - mk + - mk-MK + - ml + - ml-IN + - mn-MN + - mr + - mr-IN + - ms + - ms-BN + - ms-MY + - mt + - mt-MT + - my + - my-MM + - nan-TW + - naq + - naq-NA + - nb + - nb-NO + - nd + - nd-ZW + - nds-DE + - nds-NL + - ne + - ne-IN + - ne-NP + - nl + - nl-AW + - nl-BE + - nl-NL + - nn + - nn-NO + - nr-ZA + - nso-ZA + - nyn + - nyn-UG + - oc-FR + - om + - om-ET + - om-KE + - or + - or-IN + - os-RU + - pa + - pa-Arab + - pa-Arab-PK + - pa-Guru + - pa-Guru-IN + - pa-IN + - pa-PK + - pap-AN + - pl + - pl-PL + - ps + - ps-AF + - pt + - pt-BR + - pt-GW + - pt-MZ + - pt-PT + - rm + - rm-CH + - ro + - ro-MD + - ro-RO + - rof + - rof-TZ + - ru + - ru-MD + - ru-RU + - ru-UA + - rw + - rw-RW + - rwk + - rwk-TZ + - sa-IN + - saq + - saq-KE + - sc-IT + - sd-IN + - se-NO + - seh + - seh-MZ + - ses + - ses-ML + - sg + - sg-CF + - shi + - shi-Latn + - shi-Latn-MA + - shi-Tfng + - shi-Tfng-MA + - shs-CA + - si + - si-LK + - sid-ET + - sk + - sk-SK + - sl + - sl-SI + - sn + - sn-ZW + - so + - so-DJ + - so-ET + - so-KE + - so-SO + - sq + - sq-AL + - sq-MK + - sr + - sr-Cyrl + - sr-Cyrl-BA + - sr-Cyrl-ME + - sr-Cyrl-RS + - sr-Latn + - sr-Latn-BA + - sr-Latn-ME + - sr-Latn-RS + - sr-ME + - sr-RS + - ss-ZA + - st-ZA + - sv + - sv-FI + - sv-SE + - sw + - sw-KE + - sw-TZ + - ta + - ta-IN + - ta-LK + - te + - te-IN + - teo + - teo-KE + - teo-UG + - tg-TJ + - th + - th-TH + - ti + - ti-ER + - ti-ET + - tig-ER + - tk-TM + - tl-PH + - tn-ZA + - to + - to-TO + - tr + - tr-CY + - tr-TR + - ts-ZA + - tt-RU + - tzm + - tzm-Latn + - tzm-Latn-MA + - ug-CN + - uk + - uk-UA + - unm-US + - ur + - ur-IN + - ur-PK + - uz + - uz-Arab + - uz-Arab-AF + - uz-Cyrl + - uz-Cyrl-UZ + - uz-Latn + - uz-Latn-UZ + - uz-UZ + - ve-ZA + - vi + - vi-VN + - vun + - vun-TZ + - wa-BE + - wae-CH + - wal-ET + - wo-SN + - xh-ZA + - xog + - xog-UG + - yi-US + - yo + - yo-NG + - yue-HK + - zh + - zh-CN + - zh-HK + - zh-Hans + - zh-Hans-CN + - zh-Hans-HK + - zh-Hans-MO + - zh-Hans-SG + - zh-Hant + - zh-Hant-HK + - zh-Hant-MO + - zh-Hant-TW + - zh-SG + - zh-TW + - zu + - zu-ZA + type: string + - const: auto + type: string + default: en + description: Locale for browser language and region settings + examples: + - en-US + markdown_backend: + default: full_page + description: Selects which markdown conversion strategy to use. "full_page" converts the entire HTML page. "main_content" + uses Mozilla Readability to extract the main article content before converting. + enum: + - full_page + - main_content + examples: + - full_page + type: string + method: + default: GET + description: HTTP method for the request + enum: + - GET + - POST + - PUT + - PATCH + - DELETE + examples: + - GET + type: string + network_capture: + description: Filters for capturing network traffic + items: + properties: + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + resource_type: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant45b9c162d044' + - items: + $ref: '#/components/schemas/SdkStringVariant45b9c162d044' + minItems: 1 + type: array + status_code: + anyOf: + - maximum: 599 + minimum: 100 + type: number + - items: + maximum: 599 + minimum: 100 + type: number + minItems: 1 + type: array + url: + properties: + type: + default: exact + enum: + - exact + - contains + type: string + value: + type: string + required: + - value + type: object + validation: + default: false + type: boolean + wait_for_requests_count: + default: 0 + minimum: 0 + type: number + wait_for_requests_count_timeout: + exclusiveMinimum: 0 + maximum: 300000 + type: number + type: object + type: array + os: + description: Operating system to emulate + enum: + - windows + - mac os + - linux + - android + - ios + examples: + - windows + type: string + parse: + default: false + description: Whether to parse the response content + examples: + - true + type: boolean + parser: + anyOf: + - additionalProperties: {} + propertyNames: + type: string + type: object + - type: string + description: Custom parser configuration as a key-value map + examples: + - myParser: + option1: value1 + realtime_total_timeout: + description: Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout — + it can shorten the deadline but never extend it. Has no effect on async requests. + examples: + - 15000 + minimum: 1 + type: number + referrer_type: + anyOf: + - enum: + - random + - no-referer + - same-origin + type: string + - enum: + - google + - bing + - facebook + - twitter + - instagram + type: string + description: Referrer policy for the request + examples: + - no-referrer + render: + anyOf: + - type: boolean + - const: auto + type: string + description: Whether to render JavaScript content using a browser + examples: + - true + request_timeout: + description: Request timeout in milliseconds + examples: + - 30000 + minimum: 1 + type: number + session: + properties: + id: + type: string + prefetch_userbrowser: + default: false + type: boolean + renew_on_blocked: + default: false + type: boolean + retry: + default: false + type: boolean + timeout: + exclusiveMinimum: 0 + type: number + type: object + skill: + anyOf: + - $ref: '#/components/schemas/SdkStringVariantb885fffd6042' + - description: Skills or capabilities required for the request + examples: + - - javascript + - dynamic-content + items: + $ref: '#/components/schemas/SdkStringVariant5b1cd5713a37' + private: true + type: array + x-private: true + state: + description: US state for geolocation (only valid when country is US) + enum: + - AL + - AK + - AS + - AZ + - AR + - CA + - CO + - CT + - DE + - DC + - FL + - GA + - GU + - HI + - ID + - IL + - IN + - IA + - KS + - KY + - LA + - ME + - MD + - MA + - MI + - MN + - MS + - MO + - MT + - NE + - NV + - NH + - NJ + - NM + - NY + - NC + - ND + - MP + - OH + - OK + - OR + - PA + - PR + - RI + - SC + - SD + - TN + - TX + - UT + - VT + - VA + - VI + - WA + - WV + - WI + - WY + examples: + - CA + type: string + tag: + description: User-defined tag for request identification + examples: + - campaign-2024-q1 + type: string + url: + description: Target URL to scrape + type: string + type: object + ignore_query_parameters: + default: false + description: Do not re-scrape the same path with different (or none) query parameters. + examples: + - false + type: boolean + include_paths: + description: URL pathname regex patterns that include matching URLs in the crawl. + examples: + - - /include-this-path + - /and-this-path + items: + type: string + type: array + limit: + default: 5000 + description: Maximum number of pages to crawl. + examples: + - 100 + maximum: 10000 + minimum: 1 + type: integer + max_discovery_depth: + default: 5 + description: Maximum depth to crawl based on discovery order. + examples: + - 3 + maximum: 20 + minimum: 1 + type: integer + name: + description: Name of the crawl. + examples: + - The best crawl ever + type: string + sitemap: + default: include + description: Sitemap and other methods will be used together to find URLs. + enum: + - skip + - include + - only + examples: + - include + type: string + url: + description: Url to crawl. + type: string + required: + - url + type: object + CreateExtractTemplateGenerationRequestPublicV2: + additionalProperties: false + properties: + input_schema: + additionalProperties: true + description: Optional JSON schema describing expected input parameters. + title: Input Schema + type: object + metadata: + anyOf: + - $ref: '#/components/schemas/CreateExtractTemplateMetadataPublicV2' + - type: 'null' + description: Metadata to attach to the generated extract template. + name: + anyOf: + - maxLength: 255 + minLength: 1 + pattern: ^[a-z0-9_]+$ + type: string + - type: 'null' + description: Optional stable name for the generated extract template. + title: Name + output_schema: + additionalProperties: true + description: Optional JSON schema describing desired extracted output. + title: Output Schema + type: object + prompt: + description: Instructions for generating the extract template. + title: Prompt + type: string + url: + description: Example URL used to generate the extract template. + title: Url + type: string + required: + - prompt + - url + title: CreateExtractTemplateGenerationRequestPublicV2 + type: object + CreateExtractTemplateMetadataPublicV2: + properties: + description: + anyOf: + - type: string + - type: 'null' + description: Description for the generated template. + title: Description + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly display name for the generated template. + title: Display Name + tags: + description: Tags to associate with the generated template. + items: + type: string + title: Tags + type: array + title: CreateExtractTemplateMetadataPublicV2 + type: object + CreateExtractTemplateRefinementRequestPublicV2: + additionalProperties: false + properties: + from_extract_template: + description: Name of the source extract template to refine. + title: From Extract Template + type: string + prompt: + description: Instructions for refining the extract template. + title: Prompt + type: string + required: + - prompt + - from_extract_template + title: CreateExtractTemplateRefinementRequestPublicV2 + type: object + CreateJobRequestPublicV1: + description: Payload to create a new job. + properties: + agent_name: + description: Name of the agent to run. + title: Agent Name + type: string + description: + anyOf: + - type: string + - type: 'null' + description: Free-text description of the job. + title: Description + destination: + anyOf: + - $ref: '#/components/schemas/JobDestinationPublicV1' + - type: 'null' + description: Where the job writes its results. + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly job name shown in the UI. + title: Display Name + inputs: + anyOf: + - $ref: '#/components/schemas/JobInputsPublicV1' + - type: 'null' + description: Input data configuration for the job. + name: + description: Job name. + title: Name + type: string + schedule: + anyOf: + - $ref: '#/components/schemas/JobSchedulePublicV1' + - type: 'null' + description: Cron schedule controlling automatic runs. + required: + - name + - agent_name + title: CreateJobRequestPublicV1 + type: object + CreateJobRequestPublicV2: + description: Payload to create a new job. + properties: + description: + anyOf: + - type: string + - type: 'null' + description: Free-text description of the job. + title: Description + destination: + anyOf: + - $ref: '#/components/schemas/JobDestinationPublicV2' + - type: 'null' + description: Where the job writes its results. + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly job name shown in the UI. + title: Display Name + extract_template_name: + description: Name of the extract template to run. + title: Extract Template Name + type: string + inputs: + anyOf: + - $ref: '#/components/schemas/JobInputsPublicV2' + - type: 'null' + description: Input data configuration for the job. + name: + description: Job name. + title: Name + type: string + schedule: + anyOf: + - $ref: '#/components/schemas/JobSchedulePublicV2' + - type: 'null' + description: Cron schedule controlling automatic runs. + required: + - name + - extract_template_name + title: CreateJobRequestPublicV2 + type: object + CreateTemplateGenerationRequestPublicV1: + properties: + input_schema: + additionalProperties: true + title: Input Schema + type: object + metadata: + anyOf: + - $ref: '#/components/schemas/CreateTemplateMetadataPublicV1' + - type: 'null' + name: + anyOf: + - maxLength: 255 + minLength: 1 + pattern: ^[a-z0-9_]+$ + type: string + - type: 'null' + title: Name + output_schema: + additionalProperties: true + title: Output Schema + type: object + prompt: + title: Prompt + type: string + url: + title: Url + type: string + required: + - prompt + - url + title: CreateTemplateGenerationRequestPublicV1 + type: object + CreateTemplateMetadataPublicV1: + properties: + description: + anyOf: + - type: string + - type: 'null' + title: Description + display_name: + anyOf: + - type: string + - type: 'null' + title: Display Name + tags: + items: + type: string + title: Tags + type: array + title: CreateTemplateMetadataPublicV1 + type: object + CreateTemplateRefinementRequestPublicV1: + properties: + from_agent: + title: From Agent + type: string + prompt: + title: Prompt + type: string + required: + - prompt + - from_agent + title: CreateTemplateRefinementRequestPublicV1 + type: object + DriverResolutionResponse: + additionalProperties: false + properties: + agent: + description: The input agent name (present when agent query param was used) + type: string + antibots: + description: List of detected antibots for the domain + examples: + - - cloudflare + - datadome + items: + type: string + type: array + description: + description: Description of the driver + type: string + driver: + description: Resolved driver name + examples: + - vx10-pro + type: string + need_to_render: + description: Whether the page needs to be rendered to be properly resolved. + type: boolean + url: + description: The input URL (present when url query param was used) + type: string + required: + - driver + - antibots + - description + type: object + Duration: + description: 'Duration value that accepts various formats. Supports: number (ms), string ("1000"), or string with unit + ("2s", "500ms", "2m", "1h")' + examples: + - 1000 + - 2s + - 500ms + - 1.5m + - 1h + oneOf: + - minimum: 0 + type: number + - type: string + Effort: + description: Canonical effort tier names for the research graph. + enum: + - low + - medium + - high + - x-high + - custom + title: Effort + type: string + EmptyListFilter: + additionalProperties: false + properties: {} + title: EmptyListFilter + type: object + EvalAction: + additionalProperties: false + description: Execute JavaScript code in page context + properties: + eval: + oneOf: + - type: string + - additionalProperties: false + properties: + code: + minLength: 1 + type: string + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + timeout: + default: 15000 + description: 'Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.' + minimum: 0 + type: number + required: + - code + type: object + required: + - eval + type: object + ExtractAsyncResponse: + additionalProperties: false + description: Response when an async extract task is created successfully. + properties: + status: + const: success + description: Status indicating the async task was created successfully. + type: string + task: + additionalProperties: false + description: The created async task details. + properties: + _query: {} + account_name: + description: Account name that owns the task. + type: string + api_type: + enum: + - web + - serp + - ecommerce + - social + - media + - agent + - extract + - fast-serp + - labs + type: string + batch_id: + anyOf: + - type: string + - type: 'null' + description: Batch ID if this task is part of a batch. + examples: + - 4b0a90bf-c951-42e4-95b3-a95a65ba69fc + created_at: + description: Timestamp when the task was created. + examples: + - '2024-01-15T10:30:00Z' + type: string + download_url: + anyOf: + - format: uri + type: string + - type: 'null' + description: URL for downloading the task results. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000/results + error: + anyOf: + - type: string + - type: 'null' + description: Error message if the task failed. + examples: + - Connection timeout + error_type: + anyOf: + - type: string + - type: 'null' + description: Classification of the error type. + examples: + - timeout_error + id: + description: Unique task identifier. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + minLength: 1 + type: string + input: + description: Original input data for the task. + modified_at: + description: Timestamp when the task was last modified. + examples: + - '2024-01-15T10:35:00Z' + type: string + output_url: + anyOf: + - type: string + - type: 'null' + description: Storage location of the output data. + queue: + description: Queue name the task was submitted to. + type: string + state: + description: Current state of the task. + enum: + - pending + - queued + - in_progress + - success + - error + examples: + - pending + type: string + status_code: + description: HTTP status code from the task execution. + examples: + - 200 + type: number + status_url: + description: URL for checking the task status. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000 + format: uri + type: string + required: + - id + - state + - status_url + - created_at + - input + - _query + type: object + required: + - status + - task + type: object + ExtractBatchPayload: + properties: + inputs: + description: Array of extraction requests. Each object can include extraction parameters and async/storage settings. + items: + allOf: + - properties: + auto_driver_configuration: + additionalProperties: + maximum: 10 + minimum: 0 + type: integer + description: 'Sequential attempt budgets for the auto-render engine: maps candidate names to the number + of attempts for each candidate before advancing (0 skips it). The first successful result is returned. + Providing it opts the request into ''auto'' driver selection.' + examples: + - vx10: 2 + vx10-pro: 0 + vx6-fast: 1 + vx6-stealth: 1 + vx8: 5 + vx8-pro: 5 + propertyNames: + type: string + type: object + body: + description: Request body for POST, PUT, PATCH methods + examples: + - key: value + browser: + anyOf: + - description: Browser type to emulate + enum: + - chrome + - firefox + examples: + - chrome + type: string + - properties: + name: + enum: + - chrome + - firefox + type: string + version: + description: Specific browser version to emulate + examples: + - 120.0.0 + type: string + required: + - name + type: object + browser_actions: + $ref: '#/components/schemas/BrowserActions' + city: + description: City for geolocation + examples: + - Los Angeles + type: string + consent_header: + description: Whether to automatically handle cookie consent headers + type: boolean + cookies: + anyOf: + - description: Browser cookies as array of cookie objects + items: + additionalProperties: {} + properties: + creation: + anyOf: + - type: string + - type: 'null' + domain: + anyOf: + - type: string + - type: 'null' + expires: + anyOf: + - type: string + - const: Infinity + type: string + extensions: + anyOf: + - items: + type: string + type: array + - type: 'null' + hostOnly: + anyOf: + - type: boolean + - type: 'null' + httpOnly: + anyOf: + - type: boolean + - type: 'null' + lastAccessed: + anyOf: + - type: string + - type: 'null' + maxAge: + anyOf: + - anyOf: + - type: number + - const: Infinity + type: string + - const: -Infinity + type: string + - type: 'null' + name: + type: string + path: + anyOf: + - type: string + - type: 'null' + pathIsDefault: + anyOf: + - type: boolean + - type: 'null' + sameSite: + enum: + - strict + - lax + - none + type: string + secure: + type: boolean + value: + type: string + type: object + type: array + - description: Browser cookies as string + examples: + - sessionId=abc123; userId=user456 + type: string + country: + anyOf: + - enum: + - AD + - AE + - AF + - AG + - AI + - AL + - AM + - AO + - AQ + - AR + - AS + - AT + - AU + - AW + - AX + - AZ + - BA + - BB + - BD + - BE + - BF + - BG + - BH + - BI + - BJ + - BL + - BM + - BN + - BO + - BQ + - BR + - BS + - BT + - BV + - BW + - BY + - BZ + - CA + - CC + - CD + - CF + - CG + - CH + - CI + - CK + - CL + - CM + - CN + - CO + - CR + - CU + - CV + - CW + - CX + - CY + - CZ + - DE + - DJ + - DK + - DM + - DO + - DZ + - EC + - EE + - EG + - EH + - ER + - ES + - ET + - FI + - FJ + - FK + - FM + - FO + - FR + - GA + - GB + - GD + - GE + - GF + - GG + - GH + - GI + - GL + - GM + - GN + - GP + - GQ + - GR + - GS + - GT + - GU + - GW + - GY + - HK + - HM + - HN + - HR + - HT + - HU + - ID + - IE + - IL + - IM + - IN + - IO + - IQ + - IR + - IS + - IT + - JE + - JM + - JO + - JP + - KE + - KG + - KH + - KI + - KM + - KN + - KP + - KR + - KW + - KY + - KZ + - LA + - LB + - LC + - LI + - LK + - LR + - LS + - LT + - LU + - LV + - LY + - MA + - MC + - MD + - ME + - MF + - MG + - MH + - MK + - ML + - MM + - MN + - MO + - MP + - MQ + - MR + - MS + - MT + - MU + - MV + - MW + - MX + - MY + - MZ + - NA + - NC + - NE + - NF + - NG + - NI + - NL + - 'NO' + - NP + - NR + - NU + - NZ + - OM + - PA + - PE + - PF + - PG + - PH + - PK + - PL + - PM + - PN + - PR + - PS + - PT + - PW + - PY + - QA + - RE + - RO + - RS + - RU + - RW + - SA + - SB + - SC + - SD + - SE + - SG + - SH + - SI + - SJ + - SK + - SL + - SM + - SN + - SO + - SR + - SS + - ST + - SV + - SX + - SY + - SZ + - TC + - TD + - TF + - TG + - TH + - TJ + - TK + - TL + - TM + - TN + - TO + - TR + - TT + - TV + - TW + - TZ + - UA + - UG + - UM + - US + - UY + - UZ + - VA + - VC + - VE + - VG + - VI + - VN + - VU + - WF + - WS + - XK + - YE + - YT + - ZA + - ZM + - ZW + type: string + - const: ALL + type: string + default: ALL + description: Country code for geolocation and proxy selection + examples: + - US + device: + default: desktop + description: Device type for browser emulation + enum: + - desktop + - mobile + - tablet + examples: + - desktop + type: string + driver: + description: Browser driver to use. Use 'auto' for auto-render or 'max' for the Max configuration race. + enum: + - auto + - max + - vx6 + - vx8 + - vx8-pro + - vx10 + - vx10-pro + - vx12 + - vx12-pro + - media-vx6 + - fast-vx6 + examples: + - vx8 + - max + type: string + expected_status_codes: + description: Expected HTTP status codes for successful requests + examples: + - - 200 + - 201 + items: + maximum: 9007199254740991 + minimum: -9007199254740991 + type: integer + type: array + file_parsing_options: + description: Parses PDF and Office documents into markdown. Enabling this adds a per-page-parsed charge + on top of the base extract price, at a rate that depends on `mode` — see the pricing page. Billing is + per page parsed, not per document. + properties: + max_pages: + description: Maximum number of pages to parse. A PDF with more pages is rejected instead of being parsed, + so it is never billed. Other formats (spreadsheets, presentations) are instead truncated to the first + `max_pages` pages, and only those pages are parsed and billed. + examples: + - 50 + maximum: 9007199254740991 + minimum: 1 + type: integer + mode: + default: light + description: '`light`: fast, text-native extraction only, no OCR support. `pro`: adds LLM-based parsing + with OCR fallback for scanned or complex PDFs. The two modes are billed at different per-page rates.' + enum: + - light + - pro + examples: + - pro + type: string + type: object + formats: + description: List of acceptable response formats in order of preference + examples: + - - html + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + headers: + additionalProperties: + anyOf: + - type: string + - type: 'null' + - items: + type: string + type: array + default: {} + description: Custom HTTP headers to include in the request + examples: + - Accept-Language: en-US + User-Agent: CustomBot/1.0 + propertyNames: + type: string + type: object + http2: + default: false + description: Whether to use HTTP/2 protocol + examples: + - true + type: boolean + is_xhr: + default: false + description: Whether to emulate XMLHttpRequest behavior + examples: + - true + type: boolean + locale: + anyOf: + - enum: + - aa-DJ + - aa-ER + - aa-ET + - af + - af-NA + - af-ZA + - ak + - ak-GH + - am + - am-ET + - an-ES + - ar + - ar-AE + - ar-BH + - ar-DZ + - ar-EG + - ar-IN + - ar-IQ + - ar-JO + - ar-KW + - ar-LB + - ar-LY + - ar-MA + - ar-OM + - ar-QA + - ar-SA + - ar-SD + - ar-SY + - ar-TN + - ar-YE + - as + - as-IN + - asa + - asa-TZ + - ast-ES + - az + - az-AZ + - az-Cyrl + - az-Cyrl-AZ + - az-Latn + - az-Latn-AZ + - be + - be-BY + - bem + - bem-ZM + - ber-DZ + - ber-MA + - bez + - bez-TZ + - bg + - bg-BG + - bho-IN + - bm + - bm-ML + - bn + - bn-BD + - bn-IN + - bo + - bo-CN + - bo-IN + - br-FR + - brx-IN + - bs + - bs-BA + - byn-ER + - ca + - ca-AD + - ca-ES + - ca-FR + - ca-IT + - cgg + - cgg-UG + - chr + - chr-US + - crh-UA + - cs + - cs-CZ + - csb-PL + - cv-RU + - cy + - cy-GB + - da + - da-DK + - dav + - dav-KE + - de + - de-AT + - de-BE + - de-CH + - de-DE + - de-LI + - de-LU + - dv-MV + - dz-BT + - ebu + - ebu-KE + - ee + - ee-GH + - ee-TG + - el + - el-CY + - el-GR + - en + - en-AG + - en-AS + - en-AU + - en-BE + - en-BW + - en-BZ + - en-CA + - en-DK + - en-GB + - en-GU + - en-HK + - en-IE + - en-IN + - en-JM + - en-MH + - en-MP + - en-MT + - en-MU + - en-NA + - en-NG + - en-NZ + - en-PH + - en-PK + - en-SG + - en-TT + - en-UM + - en-US + - en-VI + - en-ZA + - en-ZM + - en-ZW + - eo + - es + - es-419 + - es-AR + - es-BO + - es-CL + - es-CO + - es-CR + - es-CU + - es-DO + - es-EC + - es-ES + - es-GQ + - es-GT + - es-HN + - es-MX + - es-NI + - es-PA + - es-PE + - es-PR + - es-PY + - es-SV + - es-US + - es-UY + - es-VE + - et + - et-EE + - eu + - eu-ES + - fa + - fa-AF + - fa-IR + - ff + - ff-SN + - fi + - fi-FI + - fil + - fil-PH + - fo + - fo-FO + - fr + - fr-BE + - fr-BF + - fr-BI + - fr-BJ + - fr-BL + - fr-CA + - fr-CD + - fr-CF + - fr-CG + - fr-CH + - fr-CI + - fr-CM + - fr-DJ + - fr-FR + - fr-GA + - fr-GN + - fr-GP + - fr-GQ + - fr-KM + - fr-LU + - fr-MC + - fr-MF + - fr-MG + - fr-ML + - fr-MQ + - fr-NE + - fr-RE + - fr-RW + - fr-SN + - fr-TD + - fr-TG + - fur-IT + - fy-DE + - fy-NL + - ga + - ga-IE + - gd-GB + - gez-ER + - gez-ET + - gl + - gl-ES + - gsw + - gsw-CH + - gu + - gu-IN + - guz + - guz-KE + - gv + - gv-GB + - ha + - ha-Latn + - ha-Latn-GH + - ha-Latn-NE + - ha-Latn-NG + - ha-NG + - haw + - haw-US + - he + - he-IL + - hi + - hi-IN + - hne-IN + - hr + - hr-HR + - hsb-DE + - ht-HT + - hu + - hu-HU + - hy + - hy-AM + - id + - id-ID + - ig + - ig-NG + - ii + - ii-CN + - ik-CA + - is + - is-IS + - it + - it-CH + - it-IT + - iu-CA + - iw-IL + - ja + - ja-JP + - jmc + - jmc-TZ + - ka + - ka-GE + - kab + - kab-DZ + - kam + - kam-KE + - kde + - kde-TZ + - kea + - kea-CV + - khq + - khq-ML + - ki + - ki-KE + - kk + - kk-Cyrl + - kk-Cyrl-KZ + - kk-KZ + - kl + - kl-GL + - kln + - kln-KE + - km + - km-KH + - kn + - kn-IN + - ko + - ko-KR + - kok + - kok-IN + - ks-IN + - ku-TR + - kw + - kw-GB + - ky-KG + - lag + - lag-TZ + - lb-LU + - lg + - lg-UG + - li-BE + - li-NL + - lij-IT + - lo-LA + - lt + - lt-LT + - luo + - luo-KE + - luy + - luy-KE + - lv + - lv-LV + - mag-IN + - mai-IN + - mas + - mas-KE + - mas-TZ + - mer + - mer-KE + - mfe + - mfe-MU + - mg + - mg-MG + - mhr-RU + - mi-NZ + - mk + - mk-MK + - ml + - ml-IN + - mn-MN + - mr + - mr-IN + - ms + - ms-BN + - ms-MY + - mt + - mt-MT + - my + - my-MM + - nan-TW + - naq + - naq-NA + - nb + - nb-NO + - nd + - nd-ZW + - nds-DE + - nds-NL + - ne + - ne-IN + - ne-NP + - nl + - nl-AW + - nl-BE + - nl-NL + - nn + - nn-NO + - nr-ZA + - nso-ZA + - nyn + - nyn-UG + - oc-FR + - om + - om-ET + - om-KE + - or + - or-IN + - os-RU + - pa + - pa-Arab + - pa-Arab-PK + - pa-Guru + - pa-Guru-IN + - pa-IN + - pa-PK + - pap-AN + - pl + - pl-PL + - ps + - ps-AF + - pt + - pt-BR + - pt-GW + - pt-MZ + - pt-PT + - rm + - rm-CH + - ro + - ro-MD + - ro-RO + - rof + - rof-TZ + - ru + - ru-MD + - ru-RU + - ru-UA + - rw + - rw-RW + - rwk + - rwk-TZ + - sa-IN + - saq + - saq-KE + - sc-IT + - sd-IN + - se-NO + - seh + - seh-MZ + - ses + - ses-ML + - sg + - sg-CF + - shi + - shi-Latn + - shi-Latn-MA + - shi-Tfng + - shi-Tfng-MA + - shs-CA + - si + - si-LK + - sid-ET + - sk + - sk-SK + - sl + - sl-SI + - sn + - sn-ZW + - so + - so-DJ + - so-ET + - so-KE + - so-SO + - sq + - sq-AL + - sq-MK + - sr + - sr-Cyrl + - sr-Cyrl-BA + - sr-Cyrl-ME + - sr-Cyrl-RS + - sr-Latn + - sr-Latn-BA + - sr-Latn-ME + - sr-Latn-RS + - sr-ME + - sr-RS + - ss-ZA + - st-ZA + - sv + - sv-FI + - sv-SE + - sw + - sw-KE + - sw-TZ + - ta + - ta-IN + - ta-LK + - te + - te-IN + - teo + - teo-KE + - teo-UG + - tg-TJ + - th + - th-TH + - ti + - ti-ER + - ti-ET + - tig-ER + - tk-TM + - tl-PH + - tn-ZA + - to + - to-TO + - tr + - tr-CY + - tr-TR + - ts-ZA + - tt-RU + - tzm + - tzm-Latn + - tzm-Latn-MA + - ug-CN + - uk + - uk-UA + - unm-US + - ur + - ur-IN + - ur-PK + - uz + - uz-Arab + - uz-Arab-AF + - uz-Cyrl + - uz-Cyrl-UZ + - uz-Latn + - uz-Latn-UZ + - uz-UZ + - ve-ZA + - vi + - vi-VN + - vun + - vun-TZ + - wa-BE + - wae-CH + - wal-ET + - wo-SN + - xh-ZA + - xog + - xog-UG + - yi-US + - yo + - yo-NG + - yue-HK + - zh + - zh-CN + - zh-HK + - zh-Hans + - zh-Hans-CN + - zh-Hans-HK + - zh-Hans-MO + - zh-Hans-SG + - zh-Hant + - zh-Hant-HK + - zh-Hant-MO + - zh-Hant-TW + - zh-SG + - zh-TW + - zu + - zu-ZA + type: string + - const: auto + type: string + default: en + description: Locale for browser language and region settings + examples: + - en-US + markdown_backend: + default: full_page + description: Selects which markdown conversion strategy to use. "full_page" converts the entire HTML page. + "main_content" uses Mozilla Readability to extract the main article content before converting. + enum: + - full_page + - main_content + examples: + - full_page + type: string + method: + default: GET + description: HTTP method for the request + enum: + - GET + - POST + - PUT + - PATCH + - DELETE + examples: + - GET + type: string + network_capture: + description: Filters for capturing network traffic + items: + properties: + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + resource_type: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant45b9c162d044' + - items: + $ref: '#/components/schemas/SdkStringVariant45b9c162d044' + minItems: 1 + type: array + status_code: + anyOf: + - maximum: 599 + minimum: 100 + type: number + - items: + maximum: 599 + minimum: 100 + type: number + minItems: 1 + type: array + url: + properties: + type: + default: exact + enum: + - exact + - contains + type: string + value: + type: string + required: + - value + type: object + validation: + default: false + type: boolean + wait_for_requests_count: + default: 0 + minimum: 0 + type: number + wait_for_requests_count_timeout: + exclusiveMinimum: 0 + maximum: 300000 + type: number + type: object + type: array + os: + description: Operating system to emulate + enum: + - windows + - mac os + - linux + - android + - ios + examples: + - windows + type: string + parse: + default: false + description: Whether to parse the response content + examples: + - true + type: boolean + parser: + anyOf: + - additionalProperties: {} + propertyNames: + type: string + type: object + - type: string + description: Custom parser configuration as a key-value map + examples: + - myParser: + option1: value1 + realtime_total_timeout: + description: Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout + — it can shorten the deadline but never extend it. Has no effect on async requests. + examples: + - 15000 + minimum: 1 + type: number + referrer_type: + anyOf: + - enum: + - random + - no-referer + - same-origin + type: string + - enum: + - google + - bing + - facebook + - twitter + - instagram + type: string + description: Referrer policy for the request + examples: + - no-referrer + render: + anyOf: + - type: boolean + - const: auto + type: string + description: Whether to render JavaScript content using a browser. Use 'auto' to try eligible configurations + sequentially until one succeeds. + examples: + - false + - true + - auto + request_timeout: + description: Request timeout in milliseconds + examples: + - 30000 + minimum: 1 + type: number + session: + properties: + id: + type: string + prefetch_userbrowser: + default: false + type: boolean + renew_on_blocked: + default: false + type: boolean + retry: + default: false + type: boolean + timeout: + exclusiveMinimum: 0 + type: number + type: object + skill: + anyOf: + - $ref: '#/components/schemas/SdkStringVariantb885fffd6042' + - description: Skills or capabilities required for the request + examples: + - - javascript + - dynamic-content + items: + $ref: '#/components/schemas/SdkStringVariant5b1cd5713a37' + private: true + type: array + x-private: true + state: + description: US state for geolocation (only valid when country is US) + enum: + - AL + - AK + - AS + - AZ + - AR + - CA + - CO + - CT + - DE + - DC + - FL + - GA + - GU + - HI + - ID + - IL + - IN + - IA + - KS + - KY + - LA + - ME + - MD + - MA + - MI + - MN + - MS + - MO + - MT + - NE + - NV + - NH + - NJ + - NM + - NY + - NC + - ND + - MP + - OH + - OK + - OR + - PA + - PR + - RI + - SC + - SD + - TN + - TX + - UT + - VT + - VA + - VI + - WA + - WV + - WI + - WY + examples: + - CA + type: string + tag: + description: User-defined tag for request identification + examples: + - campaign-2024-q1 + type: string + url: + description: Target URL to scrape + type: string + type: object + - properties: + callback_url: + description: URL to call back when async operation completes + examples: + - https://example.com/webhook/callback + type: string + storage_compress: + description: Whether to compress stored data + examples: + - true + type: boolean + storage_object_name: + description: Custom name for the stored object + examples: + - result-2024-01-15.json + type: string + storage_type: + description: Type of storage to use for results + examples: + - s3 + type: string + storage_url: + description: URL for storage location + examples: + - s3://bucket-name/path/to/object + type: string + type: object + minItems: 1 + type: array + shared_inputs: + allOf: + - properties: + auto_driver_configuration: + additionalProperties: + maximum: 10 + minimum: 0 + type: integer + description: 'Sequential attempt budgets for the auto-render engine: maps candidate names to the number of + attempts for each candidate before advancing (0 skips it). The first successful result is returned. Providing + it opts the request into ''auto'' driver selection.' + examples: + - vx10: 2 + vx10-pro: 0 + vx6-fast: 1 + vx6-stealth: 1 + vx8: 5 + vx8-pro: 5 + propertyNames: + type: string + type: object + body: + description: Request body for POST, PUT, PATCH methods + examples: + - key: value + browser: + anyOf: + - description: Browser type to emulate + enum: + - chrome + - firefox + examples: + - chrome + type: string + - properties: + name: + enum: + - chrome + - firefox + type: string + version: + description: Specific browser version to emulate + examples: + - 120.0.0 + type: string + required: + - name + type: object + browser_actions: + $ref: '#/components/schemas/BrowserActions' + city: + description: City for geolocation + examples: + - Los Angeles + type: string + consent_header: + description: Whether to automatically handle cookie consent headers + type: boolean + cookies: + anyOf: + - description: Browser cookies as array of cookie objects + items: + additionalProperties: {} + properties: + creation: + anyOf: + - type: string + - type: 'null' + domain: + anyOf: + - type: string + - type: 'null' + expires: + anyOf: + - type: string + - const: Infinity + type: string + extensions: + anyOf: + - items: + type: string + type: array + - type: 'null' + hostOnly: + anyOf: + - type: boolean + - type: 'null' + httpOnly: + anyOf: + - type: boolean + - type: 'null' + lastAccessed: + anyOf: + - type: string + - type: 'null' + maxAge: + anyOf: + - anyOf: + - type: number + - const: Infinity + type: string + - const: -Infinity + type: string + - type: 'null' + name: + type: string + path: + anyOf: + - type: string + - type: 'null' + pathIsDefault: + anyOf: + - type: boolean + - type: 'null' + sameSite: + enum: + - strict + - lax + - none + type: string + secure: + type: boolean + value: + type: string + type: object + type: array + - description: Browser cookies as string + examples: + - sessionId=abc123; userId=user456 + type: string + country: + anyOf: + - enum: + - AD + - AE + - AF + - AG + - AI + - AL + - AM + - AO + - AQ + - AR + - AS + - AT + - AU + - AW + - AX + - AZ + - BA + - BB + - BD + - BE + - BF + - BG + - BH + - BI + - BJ + - BL + - BM + - BN + - BO + - BQ + - BR + - BS + - BT + - BV + - BW + - BY + - BZ + - CA + - CC + - CD + - CF + - CG + - CH + - CI + - CK + - CL + - CM + - CN + - CO + - CR + - CU + - CV + - CW + - CX + - CY + - CZ + - DE + - DJ + - DK + - DM + - DO + - DZ + - EC + - EE + - EG + - EH + - ER + - ES + - ET + - FI + - FJ + - FK + - FM + - FO + - FR + - GA + - GB + - GD + - GE + - GF + - GG + - GH + - GI + - GL + - GM + - GN + - GP + - GQ + - GR + - GS + - GT + - GU + - GW + - GY + - HK + - HM + - HN + - HR + - HT + - HU + - ID + - IE + - IL + - IM + - IN + - IO + - IQ + - IR + - IS + - IT + - JE + - JM + - JO + - JP + - KE + - KG + - KH + - KI + - KM + - KN + - KP + - KR + - KW + - KY + - KZ + - LA + - LB + - LC + - LI + - LK + - LR + - LS + - LT + - LU + - LV + - LY + - MA + - MC + - MD + - ME + - MF + - MG + - MH + - MK + - ML + - MM + - MN + - MO + - MP + - MQ + - MR + - MS + - MT + - MU + - MV + - MW + - MX + - MY + - MZ + - NA + - NC + - NE + - NF + - NG + - NI + - NL + - 'NO' + - NP + - NR + - NU + - NZ + - OM + - PA + - PE + - PF + - PG + - PH + - PK + - PL + - PM + - PN + - PR + - PS + - PT + - PW + - PY + - QA + - RE + - RO + - RS + - RU + - RW + - SA + - SB + - SC + - SD + - SE + - SG + - SH + - SI + - SJ + - SK + - SL + - SM + - SN + - SO + - SR + - SS + - ST + - SV + - SX + - SY + - SZ + - TC + - TD + - TF + - TG + - TH + - TJ + - TK + - TL + - TM + - TN + - TO + - TR + - TT + - TV + - TW + - TZ + - UA + - UG + - UM + - US + - UY + - UZ + - VA + - VC + - VE + - VG + - VI + - VN + - VU + - WF + - WS + - XK + - YE + - YT + - ZA + - ZM + - ZW + type: string + - const: ALL + type: string + default: ALL + description: Country code for geolocation and proxy selection + examples: + - US + device: + default: desktop + description: Device type for browser emulation + enum: + - desktop + - mobile + - tablet + examples: + - desktop + type: string + driver: + description: Browser driver to use. Use 'auto' for auto-render or 'max' for the Max configuration race. + enum: + - auto + - max + - vx6 + - vx8 + - vx8-pro + - vx10 + - vx10-pro + - vx12 + - vx12-pro + - media-vx6 + - fast-vx6 + examples: + - vx8 + - max + type: string + expected_status_codes: + description: Expected HTTP status codes for successful requests + examples: + - - 200 + - 201 + items: + maximum: 9007199254740991 + minimum: -9007199254740991 + type: integer + type: array + file_parsing_options: + description: Parses PDF and Office documents into markdown. Enabling this adds a per-page-parsed charge on + top of the base extract price, at a rate that depends on `mode` — see the pricing page. Billing is per page + parsed, not per document. + properties: + max_pages: + description: Maximum number of pages to parse. A PDF with more pages is rejected instead of being parsed, + so it is never billed. Other formats (spreadsheets, presentations) are instead truncated to the first + `max_pages` pages, and only those pages are parsed and billed. + examples: + - 50 + maximum: 9007199254740991 + minimum: 1 + type: integer + mode: + default: light + description: '`light`: fast, text-native extraction only, no OCR support. `pro`: adds LLM-based parsing + with OCR fallback for scanned or complex PDFs. The two modes are billed at different per-page rates.' + enum: + - light + - pro + examples: + - pro + type: string + type: object + formats: + description: List of acceptable response formats in order of preference + examples: + - - html + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + headers: + additionalProperties: + anyOf: + - type: string + - type: 'null' + - items: + type: string + type: array + default: {} + description: Custom HTTP headers to include in the request + examples: + - Accept-Language: en-US + User-Agent: CustomBot/1.0 + propertyNames: + type: string + type: object + http2: + default: false + description: Whether to use HTTP/2 protocol + examples: + - true + type: boolean + is_xhr: + default: false + description: Whether to emulate XMLHttpRequest behavior + examples: + - true + type: boolean + locale: + anyOf: + - enum: + - aa-DJ + - aa-ER + - aa-ET + - af + - af-NA + - af-ZA + - ak + - ak-GH + - am + - am-ET + - an-ES + - ar + - ar-AE + - ar-BH + - ar-DZ + - ar-EG + - ar-IN + - ar-IQ + - ar-JO + - ar-KW + - ar-LB + - ar-LY + - ar-MA + - ar-OM + - ar-QA + - ar-SA + - ar-SD + - ar-SY + - ar-TN + - ar-YE + - as + - as-IN + - asa + - asa-TZ + - ast-ES + - az + - az-AZ + - az-Cyrl + - az-Cyrl-AZ + - az-Latn + - az-Latn-AZ + - be + - be-BY + - bem + - bem-ZM + - ber-DZ + - ber-MA + - bez + - bez-TZ + - bg + - bg-BG + - bho-IN + - bm + - bm-ML + - bn + - bn-BD + - bn-IN + - bo + - bo-CN + - bo-IN + - br-FR + - brx-IN + - bs + - bs-BA + - byn-ER + - ca + - ca-AD + - ca-ES + - ca-FR + - ca-IT + - cgg + - cgg-UG + - chr + - chr-US + - crh-UA + - cs + - cs-CZ + - csb-PL + - cv-RU + - cy + - cy-GB + - da + - da-DK + - dav + - dav-KE + - de + - de-AT + - de-BE + - de-CH + - de-DE + - de-LI + - de-LU + - dv-MV + - dz-BT + - ebu + - ebu-KE + - ee + - ee-GH + - ee-TG + - el + - el-CY + - el-GR + - en + - en-AG + - en-AS + - en-AU + - en-BE + - en-BW + - en-BZ + - en-CA + - en-DK + - en-GB + - en-GU + - en-HK + - en-IE + - en-IN + - en-JM + - en-MH + - en-MP + - en-MT + - en-MU + - en-NA + - en-NG + - en-NZ + - en-PH + - en-PK + - en-SG + - en-TT + - en-UM + - en-US + - en-VI + - en-ZA + - en-ZM + - en-ZW + - eo + - es + - es-419 + - es-AR + - es-BO + - es-CL + - es-CO + - es-CR + - es-CU + - es-DO + - es-EC + - es-ES + - es-GQ + - es-GT + - es-HN + - es-MX + - es-NI + - es-PA + - es-PE + - es-PR + - es-PY + - es-SV + - es-US + - es-UY + - es-VE + - et + - et-EE + - eu + - eu-ES + - fa + - fa-AF + - fa-IR + - ff + - ff-SN + - fi + - fi-FI + - fil + - fil-PH + - fo + - fo-FO + - fr + - fr-BE + - fr-BF + - fr-BI + - fr-BJ + - fr-BL + - fr-CA + - fr-CD + - fr-CF + - fr-CG + - fr-CH + - fr-CI + - fr-CM + - fr-DJ + - fr-FR + - fr-GA + - fr-GN + - fr-GP + - fr-GQ + - fr-KM + - fr-LU + - fr-MC + - fr-MF + - fr-MG + - fr-ML + - fr-MQ + - fr-NE + - fr-RE + - fr-RW + - fr-SN + - fr-TD + - fr-TG + - fur-IT + - fy-DE + - fy-NL + - ga + - ga-IE + - gd-GB + - gez-ER + - gez-ET + - gl + - gl-ES + - gsw + - gsw-CH + - gu + - gu-IN + - guz + - guz-KE + - gv + - gv-GB + - ha + - ha-Latn + - ha-Latn-GH + - ha-Latn-NE + - ha-Latn-NG + - ha-NG + - haw + - haw-US + - he + - he-IL + - hi + - hi-IN + - hne-IN + - hr + - hr-HR + - hsb-DE + - ht-HT + - hu + - hu-HU + - hy + - hy-AM + - id + - id-ID + - ig + - ig-NG + - ii + - ii-CN + - ik-CA + - is + - is-IS + - it + - it-CH + - it-IT + - iu-CA + - iw-IL + - ja + - ja-JP + - jmc + - jmc-TZ + - ka + - ka-GE + - kab + - kab-DZ + - kam + - kam-KE + - kde + - kde-TZ + - kea + - kea-CV + - khq + - khq-ML + - ki + - ki-KE + - kk + - kk-Cyrl + - kk-Cyrl-KZ + - kk-KZ + - kl + - kl-GL + - kln + - kln-KE + - km + - km-KH + - kn + - kn-IN + - ko + - ko-KR + - kok + - kok-IN + - ks-IN + - ku-TR + - kw + - kw-GB + - ky-KG + - lag + - lag-TZ + - lb-LU + - lg + - lg-UG + - li-BE + - li-NL + - lij-IT + - lo-LA + - lt + - lt-LT + - luo + - luo-KE + - luy + - luy-KE + - lv + - lv-LV + - mag-IN + - mai-IN + - mas + - mas-KE + - mas-TZ + - mer + - mer-KE + - mfe + - mfe-MU + - mg + - mg-MG + - mhr-RU + - mi-NZ + - mk + - mk-MK + - ml + - ml-IN + - mn-MN + - mr + - mr-IN + - ms + - ms-BN + - ms-MY + - mt + - mt-MT + - my + - my-MM + - nan-TW + - naq + - naq-NA + - nb + - nb-NO + - nd + - nd-ZW + - nds-DE + - nds-NL + - ne + - ne-IN + - ne-NP + - nl + - nl-AW + - nl-BE + - nl-NL + - nn + - nn-NO + - nr-ZA + - nso-ZA + - nyn + - nyn-UG + - oc-FR + - om + - om-ET + - om-KE + - or + - or-IN + - os-RU + - pa + - pa-Arab + - pa-Arab-PK + - pa-Guru + - pa-Guru-IN + - pa-IN + - pa-PK + - pap-AN + - pl + - pl-PL + - ps + - ps-AF + - pt + - pt-BR + - pt-GW + - pt-MZ + - pt-PT + - rm + - rm-CH + - ro + - ro-MD + - ro-RO + - rof + - rof-TZ + - ru + - ru-MD + - ru-RU + - ru-UA + - rw + - rw-RW + - rwk + - rwk-TZ + - sa-IN + - saq + - saq-KE + - sc-IT + - sd-IN + - se-NO + - seh + - seh-MZ + - ses + - ses-ML + - sg + - sg-CF + - shi + - shi-Latn + - shi-Latn-MA + - shi-Tfng + - shi-Tfng-MA + - shs-CA + - si + - si-LK + - sid-ET + - sk + - sk-SK + - sl + - sl-SI + - sn + - sn-ZW + - so + - so-DJ + - so-ET + - so-KE + - so-SO + - sq + - sq-AL + - sq-MK + - sr + - sr-Cyrl + - sr-Cyrl-BA + - sr-Cyrl-ME + - sr-Cyrl-RS + - sr-Latn + - sr-Latn-BA + - sr-Latn-ME + - sr-Latn-RS + - sr-ME + - sr-RS + - ss-ZA + - st-ZA + - sv + - sv-FI + - sv-SE + - sw + - sw-KE + - sw-TZ + - ta + - ta-IN + - ta-LK + - te + - te-IN + - teo + - teo-KE + - teo-UG + - tg-TJ + - th + - th-TH + - ti + - ti-ER + - ti-ET + - tig-ER + - tk-TM + - tl-PH + - tn-ZA + - to + - to-TO + - tr + - tr-CY + - tr-TR + - ts-ZA + - tt-RU + - tzm + - tzm-Latn + - tzm-Latn-MA + - ug-CN + - uk + - uk-UA + - unm-US + - ur + - ur-IN + - ur-PK + - uz + - uz-Arab + - uz-Arab-AF + - uz-Cyrl + - uz-Cyrl-UZ + - uz-Latn + - uz-Latn-UZ + - uz-UZ + - ve-ZA + - vi + - vi-VN + - vun + - vun-TZ + - wa-BE + - wae-CH + - wal-ET + - wo-SN + - xh-ZA + - xog + - xog-UG + - yi-US + - yo + - yo-NG + - yue-HK + - zh + - zh-CN + - zh-HK + - zh-Hans + - zh-Hans-CN + - zh-Hans-HK + - zh-Hans-MO + - zh-Hans-SG + - zh-Hant + - zh-Hant-HK + - zh-Hant-MO + - zh-Hant-TW + - zh-SG + - zh-TW + - zu + - zu-ZA + type: string + - const: auto + type: string + default: en + description: Locale for browser language and region settings + examples: + - en-US + markdown_backend: + default: full_page + description: Selects which markdown conversion strategy to use. "full_page" converts the entire HTML page. + "main_content" uses Mozilla Readability to extract the main article content before converting. + enum: + - full_page + - main_content + examples: + - full_page + type: string + method: + default: GET + description: HTTP method for the request + enum: + - GET + - POST + - PUT + - PATCH + - DELETE + examples: + - GET + type: string + network_capture: + description: Filters for capturing network traffic + items: + properties: + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + resource_type: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant45b9c162d044' + - items: + $ref: '#/components/schemas/SdkStringVariant45b9c162d044' + minItems: 1 + type: array + status_code: + anyOf: + - maximum: 599 + minimum: 100 + type: number + - items: + maximum: 599 + minimum: 100 + type: number + minItems: 1 + type: array + url: + properties: + type: + default: exact + enum: + - exact + - contains + type: string + value: + type: string + required: + - value + type: object + validation: + default: false + type: boolean + wait_for_requests_count: + default: 0 + minimum: 0 + type: number + wait_for_requests_count_timeout: + exclusiveMinimum: 0 + maximum: 300000 + type: number + type: object + type: array + os: + description: Operating system to emulate + enum: + - windows + - mac os + - linux + - android + - ios + examples: + - windows + type: string + parse: + default: false + description: Whether to parse the response content + examples: + - true + type: boolean + parser: + anyOf: + - additionalProperties: {} + propertyNames: + type: string + type: object + - type: string + description: Custom parser configuration as a key-value map + examples: + - myParser: + option1: value1 + realtime_total_timeout: + description: Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout + — it can shorten the deadline but never extend it. Has no effect on async requests. + examples: + - 15000 + minimum: 1 + type: number + referrer_type: + anyOf: + - enum: + - random + - no-referer + - same-origin + type: string + - enum: + - google + - bing + - facebook + - twitter + - instagram + type: string + description: Referrer policy for the request + examples: + - no-referrer + render: + anyOf: + - type: boolean + - const: auto + type: string + description: Whether to render JavaScript content using a browser. Use 'auto' to try eligible configurations + sequentially until one succeeds. + examples: + - false + - true + - auto + request_timeout: + description: Request timeout in milliseconds + examples: + - 30000 + minimum: 1 + type: number + session: + properties: + id: + type: string + prefetch_userbrowser: + default: false + type: boolean + renew_on_blocked: + default: false + type: boolean + retry: + default: false + type: boolean + timeout: + exclusiveMinimum: 0 + type: number + type: object + skill: + anyOf: + - $ref: '#/components/schemas/SdkStringVariantb885fffd6042' + - description: Skills or capabilities required for the request + examples: + - - javascript + - dynamic-content + items: + $ref: '#/components/schemas/SdkStringVariant5b1cd5713a37' + private: true + type: array + x-private: true + state: + description: US state for geolocation (only valid when country is US) + enum: + - AL + - AK + - AS + - AZ + - AR + - CA + - CO + - CT + - DE + - DC + - FL + - GA + - GU + - HI + - ID + - IL + - IN + - IA + - KS + - KY + - LA + - ME + - MD + - MA + - MI + - MN + - MS + - MO + - MT + - NE + - NV + - NH + - NJ + - NM + - NY + - NC + - ND + - MP + - OH + - OK + - OR + - PA + - PR + - RI + - SC + - SD + - TN + - TX + - UT + - VT + - VA + - VI + - WA + - WV + - WI + - WY + examples: + - CA + type: string + tag: + description: User-defined tag for request identification + examples: + - campaign-2024-q1 + type: string + url: + description: Target URL to scrape + type: string + type: object + - properties: + callback_url: + description: URL to call back when async operation completes + examples: + - https://example.com/webhook/callback + type: string + storage_compress: + description: Whether to compress stored data + examples: + - true + type: boolean + storage_object_name: + description: Custom name for the stored object + examples: + - result-2024-01-15.json + type: string + storage_type: + description: Type of storage to use for results + examples: + - s3 + type: string + storage_url: + description: URL for storage location + examples: + - s3://bucket-name/path/to/object + type: string + type: object + description: Shared parameters applied to the entire batch. Can include extraction parameters and async/storage + settings. + required: + - inputs + type: object + ExtractBatchResponse: + additionalProperties: false + description: Response when a batch of extract tasks is created successfully. + properties: + batch_id: + description: Unique identifier for the batch. + type: string + batch_size: + description: Number of tasks in the batch. + type: number + tasks: + description: List of created tasks. + items: + additionalProperties: false + properties: + _query: {} + account_name: + description: Account name that owns the task. + type: string + api_type: + enum: + - web + - serp + - ecommerce + - social + - media + - agent + - extract + - fast-serp + - labs + type: string + batch_id: + anyOf: + - type: string + - type: 'null' + description: Batch ID if this task is part of a batch. + examples: + - 4b0a90bf-c951-42e4-95b3-a95a65ba69fc + created_at: + description: Timestamp when the task was created. + examples: + - '2024-01-15T10:30:00Z' + type: string + download_url: + anyOf: + - format: uri + type: string + - type: 'null' + description: URL for downloading the task results. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000/results + error: + anyOf: + - type: string + - type: 'null' + description: Error message if the task failed. + examples: + - Connection timeout + error_type: + anyOf: + - type: string + - type: 'null' + description: Classification of the error type. + examples: + - timeout_error + id: + description: Unique task identifier. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + minLength: 1 + type: string + input: + description: Original input data for the task. + modified_at: + description: Timestamp when the task was last modified. + examples: + - '2024-01-15T10:35:00Z' + type: string + output_url: + anyOf: + - type: string + - type: 'null' + description: Storage location of the output data. + queue: + description: Queue name the task was submitted to. + type: string + state: + description: Current state of the task. + enum: + - pending + - queued + - in_progress + - success + - error + examples: + - pending + type: string + status_code: + description: HTTP status code from the task execution. + examples: + - 200 + type: number + status_url: + description: URL for checking the task status. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000 + format: uri + type: string + required: + - id + - state + - status_url + - created_at + - input + - _query + type: object + type: array + required: + - batch_id + - batch_size + - tasks + type: object + ExtractPayload: + properties: + auto_driver_configuration: + additionalProperties: + maximum: 10 + minimum: 0 + type: integer + description: 'Custom flow for the optimization engine: maps candidate names to the number of attempts to spend on + each candidate before advancing (0 skips it). Key order defines the flow order. Providing it opts the request + into ''auto'' driver selection.' + examples: + - vx10: 2 + vx10-pro: 0 + vx6-fast: 1 + vx6-stealth: 1 + vx8: 5 + vx8-pro: 5 + propertyNames: + type: string + type: object + body: + description: Request body for POST, PUT, PATCH methods + examples: + - key: value + browser: + anyOf: + - description: Browser type to emulate + enum: + - chrome + - firefox + examples: + - chrome + type: string + - properties: + name: + enum: + - chrome + - firefox + type: string + version: + description: Specific browser version to emulate + examples: + - 120.0.0 + type: string + required: + - name + type: object + browser_actions: + $ref: '#/components/schemas/BrowserActions' + city: + description: City for geolocation + examples: + - Los Angeles + type: string + consent_header: + description: Whether to automatically handle cookie consent headers + type: boolean + cookies: + anyOf: + - description: Browser cookies as array of cookie objects + items: + additionalProperties: {} + properties: + creation: + anyOf: + - type: string + - type: 'null' + domain: + anyOf: + - type: string + - type: 'null' + expires: + anyOf: + - type: string + - const: Infinity + type: string + extensions: + anyOf: + - items: + type: string + type: array + - type: 'null' + hostOnly: + anyOf: + - type: boolean + - type: 'null' + httpOnly: + anyOf: + - type: boolean + - type: 'null' + lastAccessed: + anyOf: + - type: string + - type: 'null' + maxAge: + anyOf: + - anyOf: + - type: number + - const: Infinity + type: string + - const: -Infinity + type: string + - type: 'null' + name: + type: string + path: + anyOf: + - type: string + - type: 'null' + pathIsDefault: + anyOf: + - type: boolean + - type: 'null' + sameSite: + enum: + - strict + - lax + - none + type: string + secure: + type: boolean + value: + type: string + type: object + type: array + - description: Browser cookies as string + examples: + - sessionId=abc123; userId=user456 + type: string + country: + anyOf: + - enum: + - AD + - AE + - AF + - AG + - AI + - AL + - AM + - AO + - AQ + - AR + - AS + - AT + - AU + - AW + - AX + - AZ + - BA + - BB + - BD + - BE + - BF + - BG + - BH + - BI + - BJ + - BL + - BM + - BN + - BO + - BQ + - BR + - BS + - BT + - BV + - BW + - BY + - BZ + - CA + - CC + - CD + - CF + - CG + - CH + - CI + - CK + - CL + - CM + - CN + - CO + - CR + - CU + - CV + - CW + - CX + - CY + - CZ + - DE + - DJ + - DK + - DM + - DO + - DZ + - EC + - EE + - EG + - EH + - ER + - ES + - ET + - FI + - FJ + - FK + - FM + - FO + - FR + - GA + - GB + - GD + - GE + - GF + - GG + - GH + - GI + - GL + - GM + - GN + - GP + - GQ + - GR + - GS + - GT + - GU + - GW + - GY + - HK + - HM + - HN + - HR + - HT + - HU + - ID + - IE + - IL + - IM + - IN + - IO + - IQ + - IR + - IS + - IT + - JE + - JM + - JO + - JP + - KE + - KG + - KH + - KI + - KM + - KN + - KP + - KR + - KW + - KY + - KZ + - LA + - LB + - LC + - LI + - LK + - LR + - LS + - LT + - LU + - LV + - LY + - MA + - MC + - MD + - ME + - MF + - MG + - MH + - MK + - ML + - MM + - MN + - MO + - MP + - MQ + - MR + - MS + - MT + - MU + - MV + - MW + - MX + - MY + - MZ + - NA + - NC + - NE + - NF + - NG + - NI + - NL + - 'NO' + - NP + - NR + - NU + - NZ + - OM + - PA + - PE + - PF + - PG + - PH + - PK + - PL + - PM + - PN + - PR + - PS + - PT + - PW + - PY + - QA + - RE + - RO + - RS + - RU + - RW + - SA + - SB + - SC + - SD + - SE + - SG + - SH + - SI + - SJ + - SK + - SL + - SM + - SN + - SO + - SR + - SS + - ST + - SV + - SX + - SY + - SZ + - TC + - TD + - TF + - TG + - TH + - TJ + - TK + - TL + - TM + - TN + - TO + - TR + - TT + - TV + - TW + - TZ + - UA + - UG + - UM + - US + - UY + - UZ + - VA + - VC + - VE + - VG + - VI + - VN + - VU + - WF + - WS + - XK + - YE + - YT + - ZA + - ZM + - ZW + type: string + - const: ALL + type: string + default: ALL + description: Country code for geolocation and proxy selection + examples: + - US + device: + default: desktop + description: Device type for browser emulation + enum: + - desktop + - mobile + - tablet + examples: + - desktop + type: string + driver: + description: Browser driver to use + enum: + - auto + - max + - vx6 + - vx8 + - vx8-pro + - vx10 + - vx10-pro + - vx12 + - vx12-pro + - media-vx6 + - fast-vx6 + examples: + - vx8 + type: string + expected_status_codes: + description: Expected HTTP status codes for successful requests + examples: + - - 200 + - 201 + items: + maximum: 9007199254740991 + minimum: -9007199254740991 + type: integer + type: array + file_parsing_options: + description: Parses PDF and Office documents into markdown. Enabling this adds a per-page-parsed charge on top of + the base extract price, at a rate that depends on `mode` — see the pricing page. Billing is per page parsed, not + per document. + properties: + max_pages: + description: Maximum number of pages to parse. A PDF with more pages is rejected instead of being parsed, so + it is never billed. Other formats (spreadsheets, presentations) are instead truncated to the first `max_pages` + pages, and only those pages are parsed and billed. + examples: + - 50 + maximum: 9007199254740991 + minimum: 1 + type: integer + mode: + default: light + description: '`light`: fast, text-native extraction only, no OCR support. `pro`: adds LLM-based parsing with + OCR fallback for scanned or complex PDFs. The two modes are billed at different per-page rates.' + enum: + - light + - pro + examples: + - pro + type: string + type: object + formats: + description: List of acceptable response formats in order of preference + examples: + - - html + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + headers: + additionalProperties: + anyOf: + - type: string + - type: 'null' + - items: + type: string + type: array + default: {} + description: Custom HTTP headers to include in the request + examples: + - Accept-Language: en-US + User-Agent: CustomBot/1.0 + propertyNames: + type: string + type: object + http2: + default: false + description: Whether to use HTTP/2 protocol + examples: + - true + type: boolean + is_xhr: + default: false + description: Whether to emulate XMLHttpRequest behavior + examples: + - true + type: boolean + locale: + anyOf: + - enum: + - aa-DJ + - aa-ER + - aa-ET + - af + - af-NA + - af-ZA + - ak + - ak-GH + - am + - am-ET + - an-ES + - ar + - ar-AE + - ar-BH + - ar-DZ + - ar-EG + - ar-IN + - ar-IQ + - ar-JO + - ar-KW + - ar-LB + - ar-LY + - ar-MA + - ar-OM + - ar-QA + - ar-SA + - ar-SD + - ar-SY + - ar-TN + - ar-YE + - as + - as-IN + - asa + - asa-TZ + - ast-ES + - az + - az-AZ + - az-Cyrl + - az-Cyrl-AZ + - az-Latn + - az-Latn-AZ + - be + - be-BY + - bem + - bem-ZM + - ber-DZ + - ber-MA + - bez + - bez-TZ + - bg + - bg-BG + - bho-IN + - bm + - bm-ML + - bn + - bn-BD + - bn-IN + - bo + - bo-CN + - bo-IN + - br-FR + - brx-IN + - bs + - bs-BA + - byn-ER + - ca + - ca-AD + - ca-ES + - ca-FR + - ca-IT + - cgg + - cgg-UG + - chr + - chr-US + - crh-UA + - cs + - cs-CZ + - csb-PL + - cv-RU + - cy + - cy-GB + - da + - da-DK + - dav + - dav-KE + - de + - de-AT + - de-BE + - de-CH + - de-DE + - de-LI + - de-LU + - dv-MV + - dz-BT + - ebu + - ebu-KE + - ee + - ee-GH + - ee-TG + - el + - el-CY + - el-GR + - en + - en-AG + - en-AS + - en-AU + - en-BE + - en-BW + - en-BZ + - en-CA + - en-DK + - en-GB + - en-GU + - en-HK + - en-IE + - en-IN + - en-JM + - en-MH + - en-MP + - en-MT + - en-MU + - en-NA + - en-NG + - en-NZ + - en-PH + - en-PK + - en-SG + - en-TT + - en-UM + - en-US + - en-VI + - en-ZA + - en-ZM + - en-ZW + - eo + - es + - es-419 + - es-AR + - es-BO + - es-CL + - es-CO + - es-CR + - es-CU + - es-DO + - es-EC + - es-ES + - es-GQ + - es-GT + - es-HN + - es-MX + - es-NI + - es-PA + - es-PE + - es-PR + - es-PY + - es-SV + - es-US + - es-UY + - es-VE + - et + - et-EE + - eu + - eu-ES + - fa + - fa-AF + - fa-IR + - ff + - ff-SN + - fi + - fi-FI + - fil + - fil-PH + - fo + - fo-FO + - fr + - fr-BE + - fr-BF + - fr-BI + - fr-BJ + - fr-BL + - fr-CA + - fr-CD + - fr-CF + - fr-CG + - fr-CH + - fr-CI + - fr-CM + - fr-DJ + - fr-FR + - fr-GA + - fr-GN + - fr-GP + - fr-GQ + - fr-KM + - fr-LU + - fr-MC + - fr-MF + - fr-MG + - fr-ML + - fr-MQ + - fr-NE + - fr-RE + - fr-RW + - fr-SN + - fr-TD + - fr-TG + - fur-IT + - fy-DE + - fy-NL + - ga + - ga-IE + - gd-GB + - gez-ER + - gez-ET + - gl + - gl-ES + - gsw + - gsw-CH + - gu + - gu-IN + - guz + - guz-KE + - gv + - gv-GB + - ha + - ha-Latn + - ha-Latn-GH + - ha-Latn-NE + - ha-Latn-NG + - ha-NG + - haw + - haw-US + - he + - he-IL + - hi + - hi-IN + - hne-IN + - hr + - hr-HR + - hsb-DE + - ht-HT + - hu + - hu-HU + - hy + - hy-AM + - id + - id-ID + - ig + - ig-NG + - ii + - ii-CN + - ik-CA + - is + - is-IS + - it + - it-CH + - it-IT + - iu-CA + - iw-IL + - ja + - ja-JP + - jmc + - jmc-TZ + - ka + - ka-GE + - kab + - kab-DZ + - kam + - kam-KE + - kde + - kde-TZ + - kea + - kea-CV + - khq + - khq-ML + - ki + - ki-KE + - kk + - kk-Cyrl + - kk-Cyrl-KZ + - kk-KZ + - kl + - kl-GL + - kln + - kln-KE + - km + - km-KH + - kn + - kn-IN + - ko + - ko-KR + - kok + - kok-IN + - ks-IN + - ku-TR + - kw + - kw-GB + - ky-KG + - lag + - lag-TZ + - lb-LU + - lg + - lg-UG + - li-BE + - li-NL + - lij-IT + - lo-LA + - lt + - lt-LT + - luo + - luo-KE + - luy + - luy-KE + - lv + - lv-LV + - mag-IN + - mai-IN + - mas + - mas-KE + - mas-TZ + - mer + - mer-KE + - mfe + - mfe-MU + - mg + - mg-MG + - mhr-RU + - mi-NZ + - mk + - mk-MK + - ml + - ml-IN + - mn-MN + - mr + - mr-IN + - ms + - ms-BN + - ms-MY + - mt + - mt-MT + - my + - my-MM + - nan-TW + - naq + - naq-NA + - nb + - nb-NO + - nd + - nd-ZW + - nds-DE + - nds-NL + - ne + - ne-IN + - ne-NP + - nl + - nl-AW + - nl-BE + - nl-NL + - nn + - nn-NO + - nr-ZA + - nso-ZA + - nyn + - nyn-UG + - oc-FR + - om + - om-ET + - om-KE + - or + - or-IN + - os-RU + - pa + - pa-Arab + - pa-Arab-PK + - pa-Guru + - pa-Guru-IN + - pa-IN + - pa-PK + - pap-AN + - pl + - pl-PL + - ps + - ps-AF + - pt + - pt-BR + - pt-GW + - pt-MZ + - pt-PT + - rm + - rm-CH + - ro + - ro-MD + - ro-RO + - rof + - rof-TZ + - ru + - ru-MD + - ru-RU + - ru-UA + - rw + - rw-RW + - rwk + - rwk-TZ + - sa-IN + - saq + - saq-KE + - sc-IT + - sd-IN + - se-NO + - seh + - seh-MZ + - ses + - ses-ML + - sg + - sg-CF + - shi + - shi-Latn + - shi-Latn-MA + - shi-Tfng + - shi-Tfng-MA + - shs-CA + - si + - si-LK + - sid-ET + - sk + - sk-SK + - sl + - sl-SI + - sn + - sn-ZW + - so + - so-DJ + - so-ET + - so-KE + - so-SO + - sq + - sq-AL + - sq-MK + - sr + - sr-Cyrl + - sr-Cyrl-BA + - sr-Cyrl-ME + - sr-Cyrl-RS + - sr-Latn + - sr-Latn-BA + - sr-Latn-ME + - sr-Latn-RS + - sr-ME + - sr-RS + - ss-ZA + - st-ZA + - sv + - sv-FI + - sv-SE + - sw + - sw-KE + - sw-TZ + - ta + - ta-IN + - ta-LK + - te + - te-IN + - teo + - teo-KE + - teo-UG + - tg-TJ + - th + - th-TH + - ti + - ti-ER + - ti-ET + - tig-ER + - tk-TM + - tl-PH + - tn-ZA + - to + - to-TO + - tr + - tr-CY + - tr-TR + - ts-ZA + - tt-RU + - tzm + - tzm-Latn + - tzm-Latn-MA + - ug-CN + - uk + - uk-UA + - unm-US + - ur + - ur-IN + - ur-PK + - uz + - uz-Arab + - uz-Arab-AF + - uz-Cyrl + - uz-Cyrl-UZ + - uz-Latn + - uz-Latn-UZ + - uz-UZ + - ve-ZA + - vi + - vi-VN + - vun + - vun-TZ + - wa-BE + - wae-CH + - wal-ET + - wo-SN + - xh-ZA + - xog + - xog-UG + - yi-US + - yo + - yo-NG + - yue-HK + - zh + - zh-CN + - zh-HK + - zh-Hans + - zh-Hans-CN + - zh-Hans-HK + - zh-Hans-MO + - zh-Hans-SG + - zh-Hant + - zh-Hant-HK + - zh-Hant-MO + - zh-Hant-TW + - zh-SG + - zh-TW + - zu + - zu-ZA + type: string + - const: auto + type: string + default: en + description: Locale for browser language and region settings + examples: + - en-US + markdown_backend: + default: full_page + description: Selects which markdown conversion strategy to use. "full_page" converts the entire HTML page. "main_content" + uses Mozilla Readability to extract the main article content before converting. + enum: + - full_page + - main_content + examples: + - full_page + type: string + method: + default: GET + description: HTTP method for the request + enum: + - GET + - POST + - PUT + - PATCH + - DELETE + examples: + - GET + type: string + network_capture: + description: Filters for capturing network traffic + items: + properties: + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + resource_type: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant45b9c162d044' + - items: + $ref: '#/components/schemas/SdkStringVariant45b9c162d044' + minItems: 1 + type: array + status_code: + anyOf: + - maximum: 599 + minimum: 100 + type: number + - items: + maximum: 599 + minimum: 100 + type: number + minItems: 1 + type: array + url: + properties: + type: + default: exact + enum: + - exact + - contains + type: string + value: + type: string + required: + - value + type: object + validation: + default: false + type: boolean + wait_for_requests_count: + default: 0 + minimum: 0 + type: number + wait_for_requests_count_timeout: + exclusiveMinimum: 0 + maximum: 300000 + type: number + type: object + type: array + os: + description: Operating system to emulate + enum: + - windows + - mac os + - linux + - android + - ios + examples: + - windows + type: string + parse: + default: false + description: Whether to parse the response content + examples: + - true + type: boolean + parser: + anyOf: + - additionalProperties: {} + propertyNames: + type: string + type: object + - type: string + description: Custom parser configuration as a key-value map + examples: + - myParser: + option1: value1 + realtime_total_timeout: + description: Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout — it + can shorten the deadline but never extend it. Has no effect on async requests. + examples: + - 15000 + minimum: 1 + type: number + referrer_type: + anyOf: + - enum: + - random + - no-referer + - same-origin + type: string + - enum: + - google + - bing + - facebook + - twitter + - instagram + type: string + description: Referrer policy for the request + examples: + - no-referrer + render: + anyOf: + - type: boolean + - const: auto + type: string + description: Whether to render JavaScript content using a browser + examples: + - true + request_timeout: + description: Request timeout in milliseconds + examples: + - 30000 + minimum: 1 + type: number + session: + properties: + id: + type: string + prefetch_userbrowser: + default: false + type: boolean + renew_on_blocked: + default: false + type: boolean + retry: + default: false + type: boolean + timeout: + exclusiveMinimum: 0 + type: number + type: object + skill: + anyOf: + - $ref: '#/components/schemas/SdkStringVariantb885fffd6042' + - description: Skills or capabilities required for the request + examples: + - - javascript + - dynamic-content + items: + $ref: '#/components/schemas/SdkStringVariant5b1cd5713a37' + private: true + type: array + x-private: true + state: + description: US state for geolocation (only valid when country is US) + enum: + - AL + - AK + - AS + - AZ + - AR + - CA + - CO + - CT + - DE + - DC + - FL + - GA + - GU + - HI + - ID + - IL + - IN + - IA + - KS + - KY + - LA + - ME + - MD + - MA + - MI + - MN + - MS + - MO + - MT + - NE + - NV + - NH + - NJ + - NM + - NY + - NC + - ND + - MP + - OH + - OK + - OR + - PA + - PR + - RI + - SC + - SD + - TN + - TX + - UT + - VT + - VA + - VI + - WA + - WV + - WI + - WY + examples: + - CA + type: string + tag: + description: User-defined tag for request identification + examples: + - campaign-2024-q1 + type: string + url: + description: Target URL to scrape + type: string + required: + - url + type: object + ExtractTemplateFilterPublicV2: + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/MetadataFilterPublicV2' + - type: 'null' + description: Metadata filters to apply. + title: ExtractTemplateFilterPublicV2 + type: object + ExtractTemplateGenerationResponsePublicV2: + properties: + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the generation completed. + title: Completed At + created_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the generation was created. + title: Created At + error: + anyOf: + - type: string + - type: 'null' + description: Error message when generation failed. + title: Error + generated_version: + anyOf: + - $ref: '#/components/schemas/ExtractTemplateVersionResponsePublicV2' + - type: 'null' + description: Generated version details, when available. + generated_version_id: + anyOf: + - format: uuid + type: string + - type: 'null' + description: Identifier of the generated version. + title: Generated Version Id + id: + description: Unique extract template generation identifier. + format: uuid + title: Id + type: string + name: + anyOf: + - type: string + - type: 'null' + description: Extract template name associated with the generation. + title: Name + source_version_id: + anyOf: + - format: uuid + type: string + - type: 'null' + description: Identifier of the version being refined. + title: Source Version Id + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the generation started executing. + title: Started At + status: + description: Current generation status. + title: Status + type: string + summary: + anyOf: + - type: string + - type: 'null' + description: Summary of the generation result. + title: Summary + required: + - id + - status + title: ExtractTemplateGenerationResponsePublicV2 + type: object + ExtractTemplateResponsePublicV2: + properties: + created_at: + description: When the extract template was created. + format: date-time + title: Created At + type: string + id: + description: Unique extract template identifier. + format: uuid + title: Id + type: string + managed_by: + anyOf: + - type: string + - type: 'null' + description: Who maintains the template (e.g. NIMBLE, COMMUNITY, SELF_MANAGED), when known. + title: Managed By + metadata: + anyOf: + - $ref: '#/components/schemas/ExtractTemplateVersionMetadataPublicV2' + - type: 'null' + description: Catalog metadata for public templates that carry no version payload in list responses. + name: + description: Stable extract template name. + title: Name + type: string + privacy: + anyOf: + - $ref: '#/components/schemas/PrivacyLevelPublicV2' + - type: 'null' + description: Whether the template is private to the account or from the shared public catalog. + published_version: + anyOf: + - $ref: '#/components/schemas/ExtractTemplateVersionResponsePublicV2' + - type: 'null' + description: Published version details, when available. + published_version_id: + anyOf: + - format: uuid + type: string + - type: 'null' + description: Identifier of the published version. + title: Published Version Id + updated_at: + description: When the extract template was last updated. + format: date-time + title: Updated At + type: string + required: + - id + - name + - created_at + - updated_at + title: ExtractTemplateResponsePublicV2 + type: object + ExtractTemplateSamplePublicV2: + properties: + input: + anyOf: + - $ref: '#/components/schemas/JsonValue' + - type: 'null' + description: Sample input parameters for the version. + output: + anyOf: + - $ref: '#/components/schemas/JsonValue' + - type: 'null' + description: Sample output produced by the version. + title: ExtractTemplateSamplePublicV2 + type: object + ExtractTemplateVersionMetadataPublicV2: + properties: + data_source: + anyOf: + - type: string + - type: 'null' + description: Data source associated with the version. + title: Data Source + description: + anyOf: + - type: string + - type: 'null' + description: Version description shown to users. + title: Description + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly version display name. + title: Display Name + domain: + anyOf: + - type: string + - type: 'null' + description: Domain associated with the version. + title: Domain + entity_type: + anyOf: + - type: string + - type: 'null' + description: Entity type produced by the version. + title: Entity Type + tags: + description: Tags associated with the version. + items: + type: string + title: Tags + type: array + vertical: + anyOf: + - type: string + - type: 'null' + description: Business vertical associated with the version. + title: Vertical + title: ExtractTemplateVersionMetadataPublicV2 + type: object + ExtractTemplateVersionResponsePublicV2: + properties: + created_at: + description: When the version was created. + format: date-time + title: Created At + type: string + id: + description: Unique extract template version identifier. + format: uuid + title: Id + type: string + input_schema: + additionalProperties: true + description: JSON schema describing accepted input parameters. + title: Input Schema + type: object + metadata: + $ref: '#/components/schemas/ExtractTemplateVersionMetadataPublicV2' + description: Metadata associated with this version. + name: + description: Extract template name this version belongs to. + title: Name + type: string + output_schema: + additionalProperties: true + description: JSON schema describing extracted output. + title: Output Schema + type: object + samples: + anyOf: + - items: + $ref: '#/components/schemas/ExtractTemplateSamplePublicV2' + type: array + - type: 'null' + description: Sample input and output pairs for the version. + title: Samples + version_number: + description: Monotonic version number for the extract template. + title: Version Number + type: integer + required: + - id + - name + - version_number + - metadata + - input_schema + - output_schema + - created_at + title: ExtractTemplateVersionResponsePublicV2 + type: object + ExtractionTemplateBatchBody: + description: Request body for executing a batch of Extraction Template requests + properties: + inputs: + items: + additionalProperties: false + properties: + formats: + description: Response formats to include. All disabled by default. + examples: + - - html + - markdown + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + localization: + type: boolean + params: + additionalProperties: {} + properties: {} + type: object + type: object + minItems: 1 + type: array + shared_inputs: + properties: + formats: + description: Response formats to include. All disabled by default. + examples: + - - html + - markdown + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + localization: + type: boolean + params: + additionalProperties: {} + properties: {} + type: object + template: + type: string + required: + - template + type: object + required: + - inputs + - shared_inputs + type: object + ExtractionTemplateBody: + description: Request body for executing an Extraction Template + properties: + formats: + description: Response formats to include. All disabled by default. + examples: + - - html + - markdown + items: + enum: + - html + - markdown + - screenshot + - headers + - links + type: string + minItems: 1 + type: array + localization: + default: false + type: boolean + params: + additionalProperties: {} + properties: {} + type: object + template: + type: string + required: + - params + - template + type: object + FetchAction: + additionalProperties: false + description: Make an HTTP request in browser context + properties: + fetch: + oneOf: + - format: uri + type: string + - additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + timeout: + default: 15000 + description: 'Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.' + minimum: 0 + type: number + url: + format: uri + type: string + required: + - url + type: object + required: + - fetch + type: object + FillAction: + additionalProperties: false + description: Fill text into an input field + properties: + fill: + $ref: '#/components/schemas/FillOptions' + required: + - fill + type: object + FillOptions: + description: Fill options with mode-specific fields. Use "type" mode for behavioral typing simulation, or "paste" mode + for instant paste. + oneOf: + - additionalProperties: false + properties: + click_on_element: + default: true + type: boolean + delay: + $ref: '#/components/schemas/Duration' + mode: + const: type + default: type + type: string + mouse_movement_strategy: + enum: + - linear + - ghost-cursor + - windmouse + type: string + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string "true"/"false". + Default: true.' + scroll: + default: true + type: boolean + selector: + $ref: '#/components/schemas/Selector' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + timeout: + default: 15000 + description: 'Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.' + minimum: 0 + type: number + typing_interval: + $ref: '#/components/schemas/Duration' + typing_strategy: + enum: + - simple + - distribution + type: string + value: + minLength: 1 + type: string + visible: + default: true + type: boolean + required: + - selector + - value + type: object + - additionalProperties: false + properties: + click_on_element: + default: true + type: boolean + delay: + $ref: '#/components/schemas/Duration' + mode: + const: paste + type: string + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string "true"/"false". + Default: true.' + scroll: + default: true + type: boolean + selector: + $ref: '#/components/schemas/Selector' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + timeout: + default: 15000 + description: 'Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.' + minimum: 0 + type: number + value: + minLength: 1 + type: string + visible: + default: true + type: boolean + required: + - selector + - value + - mode + type: object + FullTemplatePublicV1: + properties: + description: + anyOf: + - type: string + - type: 'null' + title: Description + display_name: + title: Display Name + type: string + domain: + anyOf: + - type: string + - type: 'null' + title: Domain + entity_type: + anyOf: + - type: string + - type: 'null' + title: Entity Type + feature_flags: + $ref: '#/components/schemas/TemplateFeatureFlagsPublicV1' + input_properties: + anyOf: + - items: + $ref: '#/components/schemas/TemplateInputPropertyPublicV1' + type: array + - type: 'null' + title: Input Properties + is_public: + title: Is Public + type: boolean + managed_by: + anyOf: + - type: string + - type: 'null' + title: Managed By + name: + title: Name + type: string + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + vertical: + anyOf: + - type: string + - type: 'null' + title: Vertical + required: + - name + - is_public + - display_name + title: FullTemplatePublicV1 + type: object + FundingRound: + properties: + amount: + anyOf: + - type: integer + - type: number + - type: 'null' + description: USD + title: Amount + date: + anyOf: + - type: string + - type: 'null' + description: ISO date, YYYY-MM-DD + title: Date + name: + anyOf: + - type: string + - type: 'null' + title: Name + title: FundingRound + type: object + GatewayDef_033cecba0ba3d1d3_TextRunTrust: + description: 'Trust metadata for a prose answer: run-level confidence plus per-claim citations.' + properties: + claims: + description: Per-claim trust, keyed by callout markers in the answer text. + items: + $ref: '#/components/schemas/GatewayDef_fb397fec4dcf2a13_TextClaimTrust' + title: Claims + type: array + confidence: + $ref: '#/components/schemas/GatewayDef_07f3b31eb3e5e2cb_TrustConfidence' + description: Overall confidence in the answer. + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + sources: + description: Sources consulted while producing the answer. + items: + $ref: '#/components/schemas/GatewayDef_74786d0cba87c515_TrustSource' + title: Sources + type: array + required: + - sources + - confidence + - reasoning + - claims + title: TextRunTrust + type: object + GatewayDef_07f3b31eb3e5e2cb_TrustConfidence: + enum: + - high + - medium + - low + - pre_existing + title: TrustConfidence + type: string + GatewayDef_07f55f9a59071b48_JsonClaimTrust: + description: Trust metadata for one value in a structured (JSON) answer, keyed by JSON path. + properties: + citations: + description: Citations backing this value. + items: + $ref: '#/components/schemas/GatewayDef_f23bf5d9e6e07ed3_TrustCitation' + title: Citations + type: array + confidence: + $ref: '#/components/schemas/GatewayDef_07f3b31eb3e5e2cb_TrustConfidence' + description: Confidence in this value. + path: + description: JSON path of the value in the structured output this claim refers to. + title: Path + type: string + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + required: + - citations + - confidence + - reasoning + - path + title: JsonClaimTrust + type: object + GatewayDef_0ce4e48f62cadb20_TaskRunProgressStatsEvent: + description: Point-in-time snapshot of source counts across all parallel search agents. + properties: + source_stats: + $ref: '#/components/schemas/GatewayDef_386b2024130bc052_TaskRunSourceStats' + type: + const: task_run.progress_stats + default: task_run.progress_stats + title: Type + type: string + required: + - source_stats + title: TaskRunProgressStatsEvent + type: object + GatewayDef_1d511972aa34af3c_SourceCategory: + description: 'What *kind* of source this is (classified by the compress LLM), independent + + of TrustSourceType (how authoritative it is for a specific claim). Deliberately + + uses "official" rather than "primary" so the two axes can never collide. + + + Also doubles as the sub-question''s ``source_intent`` (what kind of source a + + question *needs*) — the two concepts overlap enough that a single enum lets + + ``classify_source_importance`` compare "what we got" against "what we asked + + for" directly. + + + ``description`` is the operational definition of the category, written against + + *what the page is*, not what the question wanted — the classifier''s judging criteria.' + enum: + - official + - news + - social + - academic + - aggregator + - marketplace + - other + title: SourceCategory + type: string + GatewayDef_21e0e16cb4d7d291_TaskRunTextOutput: + description: Text output from a completed task. + properties: + content: + description: The final prose answer. + title: Content + type: string + sources: + description: 'Sources the output cites, deduplicated by URL in citation order. Always present, including when trust + is off (`trust: null`); `trust.sources` adds primary/secondary classification on full_trust runs.' + items: + $ref: '#/components/schemas/GatewayDef_61bc223c4f99795d_TaskRunOutputSource' + title: Sources + type: array + trust: + anyOf: + - $ref: '#/components/schemas/GatewayDef_30520b8ccd213fdc_TextRunTrust' + - type: 'null' + type: + const: text + default: text + title: Type + type: string + required: + - content + - trust + title: TaskRunTextOutput + type: object + GatewayDef_2e37feaa5480a045_TaskRunJsonOutput: + description: Structured JSON output from a completed task, produced when task_spec.output_schema.type is 'json'. + properties: + content: + anyOf: + - additionalProperties: true + type: object + - items: {} + type: array + description: Data conforming to the caller-supplied JSON schema. A dict for object schemas; a list for array schemas. + title: Content + sources: + description: 'Sources the output cites, deduplicated by URL in citation order. Always present, including when trust + is off (`trust: null`); `trust.sources` adds primary/secondary classification on full_trust runs.' + items: + $ref: '#/components/schemas/GatewayDef_3a5c7c6bfa027c89_TaskRunOutputSource' + title: Sources + type: array + trust: + anyOf: + - $ref: '#/components/schemas/GatewayDef_a7c1b2a8ffcc3b45_JsonRunTrust' + - type: 'null' + type: + const: json + default: json + title: Type + type: string + required: + - content + - trust + title: TaskRunJsonOutput + type: object + GatewayDef_30520b8ccd213fdc_TextRunTrust: + description: 'Trust metadata for a prose answer: run-level confidence plus per-claim citations.' + properties: + claims: + description: Per-claim trust, keyed by callout markers in the answer text. + items: + $ref: '#/components/schemas/GatewayDef_3b1480fbbf8bec18_TextClaimTrust' + title: Claims + type: array + confidence: + $ref: '#/components/schemas/GatewayDef_b9710345fc624c1b_TrustConfidence' + description: Overall confidence in the answer. + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + sources: + description: Sources consulted while producing the answer. + items: + $ref: '#/components/schemas/GatewayDef_ce9019f9e67ae903_TrustSource' + title: Sources + type: array + required: + - sources + - confidence + - reasoning + - claims + title: TextRunTrust + type: object + GatewayDef_386b2024130bc052_TaskRunSourceStats: + properties: + num_sources_considered: + default: 0 + title: Num Sources Considered + type: integer + num_sources_read: + default: 0 + title: Num Sources Read + type: integer + sources_read_sample: + items: + type: string + title: Sources Read Sample + type: array + title: TaskRunSourceStats + type: object + GatewayDef_3a5c7c6bfa027c89_TaskRunOutputSource: + description: A source the output cites. Present in every trust mode, unlike ``trust.sources``. + properties: + title: + anyOf: + - type: string + - type: 'null' + title: Title + url: + title: Url + type: string + required: + - url + title: TaskRunOutputSource + type: object + GatewayDef_3b1480fbbf8bec18_TextClaimTrust: + description: Trust metadata for one claim in a prose answer, keyed by callout marker. + properties: + callout: + description: Callout marker number referencing this claim in the answer text. + title: Callout + type: integer + citations: + description: Citations backing this claim. + items: + $ref: '#/components/schemas/GatewayDef_977107e4b1c6ce11_TrustCitation' + title: Citations + type: array + confidence: + $ref: '#/components/schemas/GatewayDef_b9710345fc624c1b_TrustConfidence' + description: Confidence in this claim. + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + required: + - citations + - confidence + - reasoning + - callout + title: TextClaimTrust + type: object + GatewayDef_499ef3c9600e0efb_Effort: + description: Canonical effort tier names for the research graph. + enum: + - low + - medium + - high + - x-high + - custom + title: Effort + type: string + GatewayDef_4f3b7ab2bb4e1911_TaskRunProgressMsgEvent: + description: Reasoning message emitted during execution (exec_status / plan / tool). + properties: + message: + title: Message + type: string + timestamp: + title: Timestamp + type: string + type: + description: Which reasoning phase this message reports on. + enum: + - task_run.progress_msg.exec_status + - task_run.progress_msg.plan + - task_run.progress_msg.tool + title: Type + type: string + required: + - type + - message + - timestamp + title: TaskRunProgressMsgEvent + type: object + GatewayDef_54179423f3a3b0a8_JsonClaimTrust: + description: Trust metadata for one value in a structured (JSON) answer, keyed by JSON path. + properties: + citations: + description: Citations backing this value. + items: + $ref: '#/components/schemas/GatewayDef_977107e4b1c6ce11_TrustCitation' + title: Citations + type: array + confidence: + $ref: '#/components/schemas/GatewayDef_b9710345fc624c1b_TrustConfidence' + description: Confidence in this value. + path: + description: JSON path of the value in the structured output this claim refers to. + title: Path + type: string + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + required: + - citations + - confidence + - reasoning + - path + title: JsonClaimTrust + type: object + GatewayDef_61bc223c4f99795d_TaskRunOutputSource: + description: A source the output cites. Present in every trust mode, unlike ``trust.sources``. + properties: + title: + anyOf: + - type: string + - type: 'null' + title: Title + url: + title: Url + type: string + required: + - url + title: TaskRunOutputSource + type: object + GatewayDef_6651fbad4f19182d_TaskRunStatusValue: + description: Lowercase status values used in API responses (distinct from the DB-level TaskRunStatus enum). + enum: + - queued + - running + - completed + - failed + - cancelled + title: TaskRunStatusValue + type: string + GatewayDef_6d6a3bc063952be8_TaskRunStateEvent: + description: Run status transition, published on start/completion/failure/cancellation. + properties: + output: + anyOf: + - $ref: '#/components/schemas/GatewayDef_21e0e16cb4d7d291_TaskRunTextOutput' + - $ref: '#/components/schemas/GatewayDef_dc279d13fafb2038_TaskRunJsonOutput' + - type: 'null' + title: Output + run: + $ref: '#/components/schemas/GatewayDef_d1833882d7d67018_TaskRunStateEventRun' + type: + const: task_run.state + default: task_run.state + title: Type + type: string + required: + - run + title: TaskRunStateEvent + type: object + GatewayDef_74786d0cba87c515_TrustSource: + description: A source consulted while producing the answer. + properties: + extract_template_name: + anyOf: + - type: string + - type: 'null' + description: Extract template used to read the source, when one was used. + title: Extract Template Name + source_category: + anyOf: + - $ref: '#/components/schemas/GatewayDef_1d511972aa34af3c_SourceCategory' + - type: 'null' + description: 'Kind of source: official, news, social, academic, aggregator, marketplace, or other.' + source_intent: + anyOf: + - $ref: '#/components/schemas/GatewayDef_1d511972aa34af3c_SourceCategory' + - type: 'null' + description: Kind of source the underlying question asked for. + title: + anyOf: + - type: string + - type: 'null' + description: Title of the source page. + title: Title + type: + $ref: '#/components/schemas/GatewayDef_7feddd7d853a299b_TrustSourceType' + description: 'How authoritative the source is: ''primary'' or ''secondary''.' + url: + description: URL of the source page. + title: Url + type: string + required: + - url + - type + title: TrustSource + type: object + GatewayDef_76d778545e91d03a_TaskRunSourceStats: + properties: + num_sources_considered: + default: 0 + title: Num Sources Considered + type: integer + num_sources_read: + default: 0 + title: Num Sources Read + type: integer + sources_read_sample: + items: + type: string + title: Sources Read Sample + type: array + title: TaskRunSourceStats + type: object + GatewayDef_782bba82e3adc3fe_TaskRunProgressMsgEvent: + description: Reasoning message emitted during execution (exec_status / plan / tool). + properties: + message: + title: Message + type: string + timestamp: + title: Timestamp + type: string + type: + description: Which reasoning phase this message reports on. + enum: + - task_run.progress_msg.exec_status + - task_run.progress_msg.plan + - task_run.progress_msg.tool + title: Type + type: string + required: + - type + - message + - timestamp + title: TaskRunProgressMsgEvent + type: object + GatewayDef_7feddd7d853a299b_TrustSourceType: + enum: + - primary + - secondary + title: TrustSourceType + type: string + GatewayDef_936b662c6aa9dee9_TaskRunStateEventRun: + description: 'The ''run'' snapshot embedded in a task_run.state event. + + + Deliberately smaller than TaskRunResponse: this is published from inside the + + execution graph, which doesn''t have interaction_id, prompt, or + + web_search_agent_id in scope — only these fields.' + properties: + created_at: + title: Created At + type: string + effort: + $ref: '#/components/schemas/GatewayDef_ef852ee6654382c4_Effort' + id: + title: Id + type: string + is_active: + title: Is Active + type: boolean + metadata: + additionalProperties: true + title: Metadata + type: object + status: + $ref: '#/components/schemas/GatewayDef_6651fbad4f19182d_TaskRunStatusValue' + taskgroup_id: + anyOf: + - type: string + - type: 'null' + title: Taskgroup Id + warnings: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Warnings + required: + - id + - status + - is_active + - effort + - created_at + title: TaskRunStateEventRun + type: object + GatewayDef_977107e4b1c6ce11_TrustCitation: + description: A citation backing a specific claim in the answer. + properties: + excerpts: + anyOf: + - items: + type: string + type: array + - type: 'null' + description: Verbatim excerpts supporting the claim. + title: Excerpts + extract_template_name: + anyOf: + - type: string + - type: 'null' + description: Extract template used to read the source, when one was used. + title: Extract Template Name + source_category: + anyOf: + - $ref: '#/components/schemas/GatewayDef_c1f0fbbfb5ee68ca_SourceCategory' + - type: 'null' + description: 'Kind of source: official, news, social, academic, aggregator, marketplace, or other.' + source_intent: + anyOf: + - $ref: '#/components/schemas/GatewayDef_c1f0fbbfb5ee68ca_SourceCategory' + - type: 'null' + description: Kind of source the underlying question asked for. + source_type: + anyOf: + - $ref: '#/components/schemas/GatewayDef_e3120894cda4c54a_TrustSourceType' + - type: 'null' + description: 'How authoritative the source is: ''primary'' or ''secondary''.' + title: + anyOf: + - type: string + - type: 'null' + description: Title of the cited page. + title: Title + url: + description: URL of the cited page. + title: Url + type: string + required: + - url + title: TrustCitation + type: object + GatewayDef_a7c1b2a8ffcc3b45_JsonRunTrust: + description: 'Trust metadata for a structured answer: run-level confidence plus per-value citations.' + properties: + claims: + description: Per-value trust, keyed by JSON path in the structured output. + items: + $ref: '#/components/schemas/GatewayDef_07f55f9a59071b48_JsonClaimTrust' + title: Claims + type: array + confidence: + $ref: '#/components/schemas/GatewayDef_07f3b31eb3e5e2cb_TrustConfidence' + description: Overall confidence in the answer. + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + sources: + description: Sources consulted while producing the answer. + items: + $ref: '#/components/schemas/GatewayDef_74786d0cba87c515_TrustSource' + title: Sources + type: array + required: + - sources + - confidence + - reasoning + - claims + title: JsonRunTrust + type: object + GatewayDef_b9710345fc624c1b_TrustConfidence: + enum: + - high + - medium + - low + - pre_existing + title: TrustConfidence + type: string + GatewayDef_bc5dc0ea1fc57012_TaskRunTextOutput: + description: Text output from a completed task. + properties: + content: + description: The final prose answer. + title: Content + type: string + sources: + description: 'Sources the output cites, deduplicated by URL in citation order. Always present, including when trust + is off (`trust: null`); `trust.sources` adds primary/secondary classification on full_trust runs.' + items: + $ref: '#/components/schemas/GatewayDef_3a5c7c6bfa027c89_TaskRunOutputSource' + title: Sources + type: array + trust: + anyOf: + - $ref: '#/components/schemas/GatewayDef_033cecba0ba3d1d3_TextRunTrust' + - type: 'null' + type: + const: text + default: text + title: Type + type: string + required: + - content + - trust + title: TaskRunTextOutput + type: object + GatewayDef_c0fe0f39c374a83b_TaskRunProgressStatsEvent: + description: Point-in-time snapshot of source counts across all parallel search agents. + properties: + source_stats: + $ref: '#/components/schemas/GatewayDef_76d778545e91d03a_TaskRunSourceStats' + type: + const: task_run.progress_stats + default: task_run.progress_stats + title: Type + type: string + required: + - source_stats + title: TaskRunProgressStatsEvent + type: object + GatewayDef_c1f0fbbfb5ee68ca_SourceCategory: + description: 'What *kind* of source this is (classified by the compress LLM), independent + + of TrustSourceType (how authoritative it is for a specific claim). Deliberately + + uses "official" rather than "primary" so the two axes can never collide. + + + Also doubles as the sub-question''s ``source_intent`` (what kind of source a + + question *needs*) — the two concepts overlap enough that a single enum lets + + ``classify_source_importance`` compare "what we got" against "what we asked + + for" directly. + + + ``description`` is the operational definition of the category, written against + + *what the page is*, not what the question wanted — the classifier''s judging criteria.' + enum: + - official + - news + - social + - academic + - aggregator + - marketplace + - other + title: SourceCategory + type: string + GatewayDef_ce9019f9e67ae903_TrustSource: + description: A source consulted while producing the answer. + properties: + extract_template_name: + anyOf: + - type: string + - type: 'null' + description: Extract template used to read the source, when one was used. + title: Extract Template Name + source_category: + anyOf: + - $ref: '#/components/schemas/GatewayDef_c1f0fbbfb5ee68ca_SourceCategory' + - type: 'null' + description: 'Kind of source: official, news, social, academic, aggregator, marketplace, or other.' + source_intent: + anyOf: + - $ref: '#/components/schemas/GatewayDef_c1f0fbbfb5ee68ca_SourceCategory' + - type: 'null' + description: Kind of source the underlying question asked for. + title: + anyOf: + - type: string + - type: 'null' + description: Title of the source page. + title: Title + type: + $ref: '#/components/schemas/GatewayDef_e3120894cda4c54a_TrustSourceType' + description: 'How authoritative the source is: ''primary'' or ''secondary''.' + url: + description: URL of the source page. + title: Url + type: string + required: + - url + - type + title: TrustSource + type: object + GatewayDef_d1833882d7d67018_TaskRunStateEventRun: + description: 'The ''run'' snapshot embedded in a task_run.state event. + + + Deliberately smaller than TaskRunResponse: this is published from inside the + + execution graph, which doesn''t have interaction_id, prompt, or + + web_search_agent_id in scope — only these fields.' + properties: + created_at: + title: Created At + type: string + effort: + $ref: '#/components/schemas/GatewayDef_499ef3c9600e0efb_Effort' + id: + title: Id + type: string + is_active: + title: Is Active + type: boolean + metadata: + additionalProperties: true + title: Metadata + type: object + status: + $ref: '#/components/schemas/GatewayDef_e86dd5a3bb636cb3_TaskRunStatusValue' + taskgroup_id: + anyOf: + - type: string + - type: 'null' + title: Taskgroup Id + warnings: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Warnings + required: + - id + - status + - is_active + - effort + - created_at + title: TaskRunStateEventRun + type: object + GatewayDef_dc279d13fafb2038_TaskRunJsonOutput: + description: Structured JSON output from a completed task, produced when task_spec.output_schema.type is 'json'. + properties: + content: + anyOf: + - additionalProperties: true + type: object + - items: {} + type: array + description: Data conforming to the caller-supplied JSON schema. A dict for object schemas; a list for array schemas. + title: Content + sources: + description: 'Sources the output cites, deduplicated by URL in citation order. Always present, including when trust + is off (`trust: null`); `trust.sources` adds primary/secondary classification on full_trust runs.' + items: + $ref: '#/components/schemas/GatewayDef_61bc223c4f99795d_TaskRunOutputSource' + title: Sources + type: array + trust: + anyOf: + - $ref: '#/components/schemas/GatewayDef_eb0114a225123d8d_JsonRunTrust' + - type: 'null' + type: + const: json + default: json + title: Type + type: string + required: + - content + - trust + title: TaskRunJsonOutput + type: object + GatewayDef_e3120894cda4c54a_TrustSourceType: + enum: + - primary + - secondary + title: TrustSourceType + type: string + GatewayDef_e86dd5a3bb636cb3_TaskRunStatusValue: + description: Lowercase status values used in API responses (distinct from the DB-level TaskRunStatus enum). + enum: + - queued + - running + - completed + - failed + - cancelled + title: TaskRunStatusValue + type: string + GatewayDef_eb0114a225123d8d_JsonRunTrust: + description: 'Trust metadata for a structured answer: run-level confidence plus per-value citations.' + properties: + claims: + description: Per-value trust, keyed by JSON path in the structured output. + items: + $ref: '#/components/schemas/GatewayDef_54179423f3a3b0a8_JsonClaimTrust' + title: Claims + type: array + confidence: + $ref: '#/components/schemas/GatewayDef_b9710345fc624c1b_TrustConfidence' + description: Overall confidence in the answer. + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + sources: + description: Sources consulted while producing the answer. + items: + $ref: '#/components/schemas/GatewayDef_ce9019f9e67ae903_TrustSource' + title: Sources + type: array + required: + - sources + - confidence + - reasoning + - claims + title: JsonRunTrust + type: object + GatewayDef_ef852ee6654382c4_Effort: + description: Canonical effort tier names for the research graph. + enum: + - low + - medium + - high + - x-high + - custom + title: Effort + type: string + GatewayDef_f23bf5d9e6e07ed3_TrustCitation: + description: A citation backing a specific claim in the answer. + properties: + excerpts: + anyOf: + - items: + type: string + type: array + - type: 'null' + description: Verbatim excerpts supporting the claim. + title: Excerpts + extract_template_name: + anyOf: + - type: string + - type: 'null' + description: Extract template used to read the source, when one was used. + title: Extract Template Name + source_category: + anyOf: + - $ref: '#/components/schemas/GatewayDef_1d511972aa34af3c_SourceCategory' + - type: 'null' + description: 'Kind of source: official, news, social, academic, aggregator, marketplace, or other.' + source_intent: + anyOf: + - $ref: '#/components/schemas/GatewayDef_1d511972aa34af3c_SourceCategory' + - type: 'null' + description: Kind of source the underlying question asked for. + source_type: + anyOf: + - $ref: '#/components/schemas/GatewayDef_7feddd7d853a299b_TrustSourceType' + - type: 'null' + description: 'How authoritative the source is: ''primary'' or ''secondary''.' + title: + anyOf: + - type: string + - type: 'null' + description: Title of the cited page. + title: Title + url: + description: URL of the cited page. + title: Url + type: string + required: + - url + title: TrustCitation + type: object + GatewayDef_fb397fec4dcf2a13_TextClaimTrust: + description: Trust metadata for one claim in a prose answer, keyed by callout marker. + properties: + callout: + description: Callout marker number referencing this claim in the answer text. + title: Callout + type: integer + citations: + description: Citations backing this claim. + items: + $ref: '#/components/schemas/GatewayDef_f23bf5d9e6e07ed3_TrustCitation' + title: Citations + type: array + confidence: + $ref: '#/components/schemas/GatewayDef_07f3b31eb3e5e2cb_TrustConfidence' + description: Confidence in this claim. + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + required: + - citations + - confidence + - reasoning + - callout + title: TextClaimTrust + type: object + GatewayDef_fd08b460e1d38459_TaskRunStateEvent: + description: Run status transition, published on start/completion/failure/cancellation. + properties: + output: + anyOf: + - $ref: '#/components/schemas/GatewayDef_bc5dc0ea1fc57012_TaskRunTextOutput' + - $ref: '#/components/schemas/GatewayDef_2e37feaa5480a045_TaskRunJsonOutput' + - type: 'null' + title: Output + run: + $ref: '#/components/schemas/GatewayDef_936b662c6aa9dee9_TaskRunStateEventRun' + type: + const: task_run.state + default: task_run.state + title: Type + type: string + required: + - run + title: TaskRunStateEvent + type: object + GetCookiesAction: + additionalProperties: false + description: Retrieve browser cookies + properties: + get_cookies: + oneOf: + - type: boolean + - additionalProperties: {} + properties: + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + type: object + required: + - get_cookies + type: object + GotoAction: + additionalProperties: false + description: Navigate to a URL + properties: + goto: + oneOf: + - format: uri + type: string + - additionalProperties: false + properties: + referer: + type: string + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + timeout: + default: 15000 + description: 'Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.' + minimum: 0 + type: number + url: + format: uri + type: string + wait_until: + default: load + enum: + - load + - domcontentloaded + - networkidle0 + - networkidle2 + type: string + required: + - url + type: object + required: + - goto + type: object + HTTPValidationError: + properties: + detail: + items: + $ref: '#/components/schemas/ValidationError' + title: Detail + type: array + title: HTTPValidationError + type: object + JobContextPublicV1: + description: Minimal job context embedded in a run detail. + properties: + agent_name: + anyOf: + - type: string + - type: 'null' + description: Name of the agent this job runs. + title: Agent Name + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly job name shown in the UI. + title: Display Name + id: + description: Unique job identifier (job_). + pattern: ^job_[1-9][0-9]*$ + title: Id + type: string + name: + description: Internal job name. + title: Name + type: string + schedule: + anyOf: + - $ref: '#/components/schemas/JobSchedulePublicV1' + - type: 'null' + description: Cron schedule controlling automatic runs. + required: + - id + - name + title: JobContextPublicV1 + type: object + JobContextPublicV2: + description: Minimal job context embedded in a run detail. + properties: + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly job name shown in the UI. + title: Display Name + extract_template_name: + anyOf: + - type: string + - type: 'null' + description: Name of the extract template this job runs. + title: Extract Template Name + id: + description: Unique job identifier (job_). + pattern: ^job_[1-9][0-9]*$ + title: Id + type: string + name: + description: Internal job name. + title: Name + type: string + schedule: + anyOf: + - $ref: '#/components/schemas/JobSchedulePublicV2' + - type: 'null' + description: Cron schedule controlling automatic runs. + required: + - id + - name + title: JobContextPublicV2 + type: object + JobDestinationPublicV1: + description: Where a job writes its results. + properties: + format: + default: parquet + description: Output file format. + enum: + - jsonl + - csv + - parquet + title: Format + type: string + path: + description: Destination path the output is written to. + title: Path + type: string + type: + description: 'Destination kind: a local ''file'' or an ''s3'' bucket.' + enum: + - file + - s3 + title: Type + type: string + required: + - type + - path + title: JobDestinationPublicV1 + type: object + JobDestinationPublicV2: + description: Where a job writes its results. + properties: + format: + default: parquet + description: Output file format. + enum: + - jsonl + - csv + - parquet + title: Format + type: string + path: + description: Destination path the output is written to. + title: Path + type: string + type: + description: 'Destination kind: a local ''file'' or an ''s3'' bucket.' + enum: + - file + - s3 + title: Type + type: string + required: + - type + - path + title: JobDestinationPublicV2 + type: object + JobInputsPublicV1: + description: Configuration for the input data a job processes. + properties: + data: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + description: Inline list of input records. Used when type is 'inline'. + title: Data + file_path: + anyOf: + - type: string + - type: 'null' + description: Path to the input file; must start with 's3' or 'file_'. Used for 's3'/'file' types. + title: File Path + node_data: + anyOf: + - additionalProperties: + items: + additionalProperties: true + type: object + type: array + type: object + - type: 'null' + description: 'Inline input records keyed by source node id, e.g. {''source_a'': [{...}]}. Used when type is ''inline'' + on a dynamic-workflow job, which has one source node per input file. Mutually exclusive with ''data''.' + title: Node Data + type: + description: 'How inputs are supplied: an ''s3'' bucket, ''inline'' records, or an uploaded ''file''.' + enum: + - s3 + - inline + - file + title: Type + type: string + required: + - type + title: JobInputsPublicV1 + type: object + JobInputsPublicV2: + description: Configuration for the input data a job processes. + properties: + data: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + description: Inline list of input records. Used when type is 'inline'. + title: Data + file_path: + anyOf: + - type: string + - type: 'null' + description: Path to the input file; must start with 's3' or 'file_'. Used for 's3'/'file' types. + title: File Path + node_data: + anyOf: + - additionalProperties: + items: + additionalProperties: true + type: object + type: array + type: object + - type: 'null' + description: 'Inline input records keyed by source node id, e.g. {''source_a'': [{...}]}. Used when type is ''inline'' + on a dynamic-workflow job, which has one source node per input file. Mutually exclusive with ''data''.' + title: Node Data + type: + description: 'How inputs are supplied: an ''s3'' bucket, ''inline'' records, or an uploaded ''file''.' + enum: + - s3 + - inline + - file + title: Type + type: string + required: + - type + title: JobInputsPublicV2 + type: object + JobListFilterPublicV2: + additionalProperties: false + properties: + extract_template_name: + anyOf: + - type: string + - type: 'null' + description: Filter by extract template name. + title: Extract Template Name + q: + anyOf: + - type: string + - type: 'null' + description: Search by name or display name. + title: Q + title: JobListFilterPublicV2 + type: object + JobListPublicV1: + description: A page of jobs. + properties: + items: + description: Jobs on this page. + items: + $ref: '#/components/schemas/JobPublicV1' + title: Items + type: array + page: + default: 1 + description: Current page number. + title: Page + type: integer + per_page: + default: 20 + description: Number of items per page. + title: Per Page + type: integer + total: + description: Total number of jobs matching the query. + title: Total + type: integer + required: + - items + - total + title: JobListPublicV1 + type: object + JobPublicV1: + description: 'A configured job: an agent plus its schedule, inputs, and destination.' + properties: + agent_name: + anyOf: + - type: string + - type: 'null' + description: Name of the agent this job runs. + title: Agent Name + created_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the job was created. + title: Created At + description: + anyOf: + - type: string + - type: 'null' + description: Free-text description of the job. + title: Description + destination: + anyOf: + - $ref: '#/components/schemas/JobDestinationPublicV1' + - type: 'null' + description: Where the job writes its results. + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly job name shown in the UI. + title: Display Name + id: + description: Unique job identifier (job_). + pattern: ^job_[1-9][0-9]*$ + title: Id + type: string + inputs: + anyOf: + - $ref: '#/components/schemas/JobInputsPublicV1' + - type: 'null' + description: Input data configuration for the job. + last_run_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: Timestamp of the most recent run. + title: Last Run At + last_run_status: + anyOf: + - enum: + - PENDING + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - TIMEOUT + - WARNING + type: string + - type: 'null' + description: Status of the most recent run. + title: Last Run Status + name: + description: Job name. + title: Name + type: string + schedule: + anyOf: + - $ref: '#/components/schemas/JobSchedulePublicV1' + - type: 'null' + description: Cron schedule controlling automatic runs. + updated_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the job was last updated. + title: Updated At + required: + - id + - name + title: JobPublicV1 + type: object + JobPublicV2: + description: 'A configured job: an agent plus its schedule, inputs, and destination.' + properties: + created_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the job was created. + title: Created At + description: + anyOf: + - type: string + - type: 'null' + description: Free-text description of the job. + title: Description + destination: + anyOf: + - $ref: '#/components/schemas/JobDestinationPublicV2' + - type: 'null' + description: Where the job writes its results. + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly job name shown in the UI. + title: Display Name + extract_template_name: + anyOf: + - type: string + - type: 'null' + description: Name of the extract template this job runs. + title: Extract Template Name + id: + description: Unique job identifier (job_). + pattern: ^job_[1-9][0-9]*$ + title: Id + type: string + inputs: + anyOf: + - $ref: '#/components/schemas/JobInputsPublicV2' + - type: 'null' + description: Input data configuration for the job. + last_run_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: Timestamp of the most recent run. + title: Last Run At + last_run_status: + anyOf: + - enum: + - PENDING + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - TIMEOUT + - WARNING + type: string + - type: 'null' + description: Status of the most recent run. + title: Last Run Status + name: + description: Job name. + title: Name + type: string + schedule: + anyOf: + - $ref: '#/components/schemas/JobSchedulePublicV2' + - type: 'null' + description: Cron schedule controlling automatic runs. + updated_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the job was last updated. + title: Updated At + required: + - id + - name + title: JobPublicV2 + type: object + JobRunCancelResponsePublicV1: + description: Result of cancelling a run. + properties: + id: + description: Identifier of the cancelled run. + pattern: ^run_[1-9][0-9]*$ + title: Id + type: string + status: + description: Run status after cancellation. + enum: + - PENDING + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - TIMEOUT + - WARNING + title: Status + type: string + required: + - id + - status + title: JobRunCancelResponsePublicV1 + type: object + JobRunCancelResponsePublicV2: + description: Result of cancelling a run. + properties: + id: + description: Identifier of the cancelled run. + pattern: ^run_[1-9][0-9]*$ + title: Id + type: string + status: + description: Run status after cancellation. + enum: + - PENDING + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - TIMEOUT + - WARNING + title: Status + type: string + required: + - id + - status + title: JobRunCancelResponsePublicV2 + type: object + JobRunDetailPublicV1: + description: Full detail for a single run. + properties: + created_at: + description: When the run was created. + format: date-time + title: Created At + type: string + error: + anyOf: + - $ref: '#/components/schemas/JobRunErrorPublicV1' + - type: 'null' + description: Error details when the run failed. + finished_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run finished. + title: Finished At + id: + description: Unique run identifier (run_). + pattern: ^run_[1-9][0-9]*$ + title: Id + type: string + inputs_sample: + anyOf: + - items: {} + type: array + - type: 'null' + description: Sample of the run's input records. + title: Inputs Sample + job: + $ref: '#/components/schemas/JobContextPublicV1' + description: Context of the job this run belongs to. + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run started executing. + title: Started At + status: + description: Current run status. + enum: + - PENDING + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - TIMEOUT + - WARNING + title: Status + type: string + summary: + anyOf: + - $ref: '#/components/schemas/JobRunSummaryPublicV1' + - type: 'null' + description: Aggregate metrics for the run. + triggered_by: + description: 'What triggered the run: ''schedule'' or ''manual''.' + enum: + - schedule + - manual + title: Triggered By + type: string + required: + - id + - status + - triggered_by + - job + - created_at + title: JobRunDetailPublicV1 + type: object + JobRunDetailPublicV2: + description: Full detail for a single run. + properties: + created_at: + description: When the run was created. + format: date-time + title: Created At + type: string + error: + anyOf: + - $ref: '#/components/schemas/JobRunErrorPublicV2' + - type: 'null' + description: Error details when the run failed. + finished_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run finished. + title: Finished At + id: + description: Unique run identifier (run_). + pattern: ^run_[1-9][0-9]*$ + title: Id + type: string + inputs_sample: + anyOf: + - items: {} + type: array + - type: 'null' + description: Sample of the run's input records. + title: Inputs Sample + job: + $ref: '#/components/schemas/JobContextPublicV2' + description: Context of the job this run belongs to. + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run started executing. + title: Started At + status: + description: Current run status. + enum: + - PENDING + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - TIMEOUT + - WARNING + title: Status + type: string + summary: + anyOf: + - $ref: '#/components/schemas/JobRunSummaryPublicV2' + - type: 'null' + description: Aggregate metrics for the run. + triggered_by: + description: 'What triggered the run: ''schedule'' or ''manual''.' + enum: + - schedule + - manual + title: Triggered By + type: string + required: + - id + - status + - triggered_by + - job + - created_at + title: JobRunDetailPublicV2 + type: object + JobRunErrorPublicV1: + description: Error details for a failed run. + properties: + errors_sample: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + description: Sample of individual error records from the run. + title: Errors Sample + message: + anyOf: + - type: string + - type: 'null' + description: Human-readable error message. + title: Message + step: + anyOf: + - type: string + - type: 'null' + description: Pipeline step where the error occurred. + title: Step + title: JobRunErrorPublicV1 + type: object + JobRunErrorPublicV2: + description: Error details for a failed run. + properties: + errors_sample: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + description: Sample of individual error records from the run. + title: Errors Sample + message: + anyOf: + - type: string + - type: 'null' + description: Human-readable error message. + title: Message + step: + anyOf: + - type: string + - type: 'null' + description: Pipeline step where the error occurred. + title: Step + title: JobRunErrorPublicV2 + type: object + JobRunListFilterPublicV2: + additionalProperties: false + properties: + status: + anyOf: + - type: string + - type: 'null' + description: Filter by status. + title: Status + title: JobRunListFilterPublicV2 + type: object + JobRunListPublicV1: + description: A page of job runs. + properties: + items: + description: Runs on this page. + items: + $ref: '#/components/schemas/JobRunPublicV1' + title: Items + type: array + page: + default: 1 + description: Current page number. + title: Page + type: integer + per_page: + default: 20 + description: Number of items per page. + title: Per Page + type: integer + total: + description: Total number of runs matching the query. + title: Total + type: integer + required: + - items + - total + title: JobRunListPublicV1 + type: object + JobRunPublicV1: + description: A single execution of a job. + properties: + created_at: + description: When the run was created. + format: date-time + title: Created At + type: string + finished_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run finished. + title: Finished At + id: + description: Unique run identifier (run_). + pattern: ^run_[1-9][0-9]*$ + title: Id + type: string + input_count: + anyOf: + - type: integer + - type: 'null' + description: Number of input records processed. + title: Input Count + job_id: + description: Identifier of the job this run belongs to. + pattern: ^job_[1-9][0-9]*$ + title: Job Id + type: string + result_count: + anyOf: + - type: integer + - type: 'null' + description: Number of result records produced. + title: Result Count + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run started executing. + title: Started At + status: + description: Current run status. + enum: + - PENDING + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - TIMEOUT + - WARNING + title: Status + type: string + triggered_by: + description: 'What triggered the run: ''schedule'' or ''manual''.' + enum: + - schedule + - manual + title: Triggered By + type: string + required: + - id + - job_id + - status + - triggered_by + - created_at + title: JobRunPublicV1 + type: object + JobRunPublicV2: + description: A single execution of a job. + properties: + created_at: + description: When the run was created. + format: date-time + title: Created At + type: string + finished_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run finished. + title: Finished At + id: + description: Unique run identifier (run_). + pattern: ^run_[1-9][0-9]*$ + title: Id + type: string + input_count: + anyOf: + - type: integer + - type: 'null' + description: Number of input records processed. + title: Input Count + job_id: + description: Identifier of the job this run belongs to. + pattern: ^job_[1-9][0-9]*$ + title: Job Id + type: string + result_count: + anyOf: + - type: integer + - type: 'null' + description: Number of result records produced. + title: Result Count + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run started executing. + title: Started At + status: + description: Current run status. + enum: + - PENDING + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - TIMEOUT + - WARNING + title: Status + type: string + triggered_by: + description: 'What triggered the run: ''schedule'' or ''manual''.' + enum: + - schedule + - manual + title: Triggered By + type: string + required: + - id + - job_id + - status + - triggered_by + - created_at + title: JobRunPublicV2 + type: object + JobRunSummaryPublicV1: + description: Aggregate metrics for a run. + properties: + input_count: + anyOf: + - type: integer + - type: 'null' + description: Number of input records processed. + title: Input Count + match_rate: + anyOf: + - type: number + - type: 'null' + description: Fraction of inputs that produced a result (result_count / input_count), from 0.0 to 1.0. + title: Match Rate + result_count: + anyOf: + - type: integer + - type: 'null' + description: Number of result records produced. + title: Result Count + title: JobRunSummaryPublicV1 + type: object + JobRunSummaryPublicV2: + description: Aggregate metrics for a run. + properties: + input_count: + anyOf: + - type: integer + - type: 'null' + description: Number of input records processed. + title: Input Count + match_rate: + anyOf: + - type: number + - type: 'null' + description: Fraction of inputs that produced a result (result_count / input_count), from 0.0 to 1.0. + title: Match Rate + result_count: + anyOf: + - type: integer + - type: 'null' + description: Number of result records produced. + title: Result Count + title: JobRunSummaryPublicV2 + type: object + JobSchedulePublicV1: + description: Cron-based schedule controlling when a job runs automatically. + properties: + cron: + description: Cron expression defining when the job runs. + title: Cron + type: string + enabled: + description: Whether the schedule is currently active. + title: Enabled + type: boolean + required: + - cron + - enabled + title: JobSchedulePublicV1 + type: object + JobSchedulePublicV2: + description: Cron-based schedule controlling when a job runs automatically. + properties: + cron: + description: Cron expression defining when the job runs. + title: Cron + type: string + enabled: + description: Whether the schedule is currently active. + title: Enabled + type: boolean + required: + - cron + - enabled + title: JobSchedulePublicV2 + type: object + JsonClaimTrust: + description: Trust metadata for one value in a structured (JSON) answer, keyed by JSON path. + properties: + citations: + description: Citations backing this value. + items: + $ref: '#/components/schemas/TrustCitation' + title: Citations + type: array + confidence: + $ref: '#/components/schemas/TrustConfidence' + description: Confidence in this value. + path: + description: JSON path of the value in the structured output this claim refers to. + title: Path + type: string + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + required: + - citations + - confidence + - reasoning + - path + title: JsonClaimTrust + type: object + JsonPatchDocument: + description: A JSON Patch document per RFC 6902 — a JSON array of patch operations. + items: + $ref: '#/components/schemas/JsonPatchOp' + title: JsonPatchDocument + type: array + JsonPatchOp: + additionalProperties: false + description: A single JSON Patch operation per RFC 6902. + properties: + from: + anyOf: + - type: string + - type: 'null' + title: From + op: + enum: + - add + - remove + - replace + - move + - copy + - test + title: Op + type: string + path: + title: Path + type: string + value: + anyOf: + - $ref: '#/components/schemas/JsonValue' + - type: 'null' + required: + - op + - path + title: JsonPatchOp + type: object + JsonRunTrust: + description: 'Trust metadata for a structured answer: run-level confidence plus per-value citations.' + properties: + claims: + description: Per-value trust, keyed by JSON path in the structured output. + items: + $ref: '#/components/schemas/JsonClaimTrust' + title: Claims + type: array + confidence: + $ref: '#/components/schemas/TrustConfidence' + description: Overall confidence in the answer. + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + sources: + description: Sources consulted while producing the answer. + items: + $ref: '#/components/schemas/TrustSource' + title: Sources + type: array + required: + - sources + - confidence + - reasoning + - claims + title: JsonRunTrust + type: object + JsonValue: {} + ListResponse_ExtractTemplateResponsePublicV2_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/ExtractTemplateResponsePublicV2' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[ExtractTemplateResponsePublicV2] + type: object + ListResponse_ExtractTemplateVersionResponsePublicV2_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/ExtractTemplateVersionResponsePublicV2' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[ExtractTemplateVersionResponsePublicV2] + type: object + ListResponse_JobPublicV2_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/JobPublicV2' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[JobPublicV2] + type: object + ListResponse_JobRunPublicV2_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/JobRunPublicV2' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[JobRunPublicV2] + type: object + ListResponse_TaskRunResponsePublicV1_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/TaskRunResponsePublicV1' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[TaskRunResponsePublicV1] + type: object + ListResponse_TaskRunResponsePublicV2_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/TaskRunResponsePublicV2' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[TaskRunResponsePublicV2] + type: object + ListResponse_WebSearchAgentResponsePublicV1_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/WebSearchAgentResponsePublicV1' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[WebSearchAgentResponsePublicV1] + type: object + ListResponse_WebSearchAgentResponsePublicV2_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/WebSearchAgentResponsePublicV2' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[WebSearchAgentResponsePublicV2] + type: object + ListResponse_WebSearchAgentTemplateResponsePublicV1_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/WebSearchAgentTemplateResponsePublicV1' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[WebSearchAgentTemplateResponsePublicV1] + type: object + ListResponse_WebSearchAgentTemplateResponsePublicV2_: + properties: + items: + description: Items returned in this page. + items: + $ref: '#/components/schemas/WebSearchAgentTemplateResponsePublicV2' + title: Items + type: array + limit: + description: Maximum number of items returned. + title: Limit + type: integer + offset: + description: Number of items skipped before this page. + title: Offset + type: integer + total: + description: Total number of items matching the query. + title: Total + type: integer + required: + - items + - total + - limit + - offset + title: ListResponse[WebSearchAgentTemplateResponsePublicV2] + type: object + ManagedBy: + description: ManagedBy + enum: + - nimble + - community + - self_managed + title: ManagedBy + type: string + MapPayload: + description: Request body model for the /map endpoint + properties: + country: + description: Country code for geolocation and proxy selection + enum: + - AD + - AE + - AF + - AG + - AI + - AL + - AM + - AO + - AQ + - AR + - AS + - AT + - AU + - AW + - AX + - AZ + - BA + - BB + - BD + - BE + - BF + - BG + - BH + - BI + - BJ + - BL + - BM + - BN + - BO + - BQ + - BR + - BS + - BT + - BV + - BW + - BY + - BZ + - CA + - CC + - CD + - CF + - CG + - CH + - CI + - CK + - CL + - CM + - CN + - CO + - CR + - CU + - CV + - CW + - CX + - CY + - CZ + - DE + - DJ + - DK + - DM + - DO + - DZ + - EC + - EE + - EG + - EH + - ER + - ES + - ET + - FI + - FJ + - FK + - FM + - FO + - FR + - GA + - GB + - GD + - GE + - GF + - GG + - GH + - GI + - GL + - GM + - GN + - GP + - GQ + - GR + - GS + - GT + - GU + - GW + - GY + - HK + - HM + - HN + - HR + - HT + - HU + - ID + - IE + - IL + - IM + - IN + - IO + - IQ + - IR + - IS + - IT + - JE + - JM + - JO + - JP + - KE + - KG + - KH + - KI + - KM + - KN + - KP + - KR + - KW + - KY + - KZ + - LA + - LB + - LC + - LI + - LK + - LR + - LS + - LT + - LU + - LV + - LY + - MA + - MC + - MD + - ME + - MF + - MG + - MH + - MK + - ML + - MM + - MN + - MO + - MP + - MQ + - MR + - MS + - MT + - MU + - MV + - MW + - MX + - MY + - MZ + - NA + - NC + - NE + - NF + - NG + - NI + - NL + - 'NO' + - NP + - NR + - NU + - NZ + - OM + - PA + - PE + - PF + - PG + - PH + - PK + - PL + - PM + - PN + - PR + - PS + - PT + - PW + - PY + - QA + - RE + - RO + - RS + - RU + - RW + - SA + - SB + - SC + - SD + - SE + - SG + - SH + - SI + - SJ + - SK + - SL + - SM + - SN + - SO + - SR + - SS + - ST + - SV + - SX + - SY + - SZ + - TC + - TD + - TF + - TG + - TH + - TJ + - TK + - TL + - TM + - TN + - TO + - TR + - TT + - TV + - TW + - TZ + - UA + - UG + - UM + - US + - UY + - UZ + - VA + - VC + - VE + - VG + - VI + - VN + - VU + - WF + - WS + - XK + - YE + - YT + - ZA + - ZM + - ZW + examples: + - US + type: string + domain_filter: + default: all + description: Includes subdomains of the main domain in the mapping process. + enum: + - domain + - subdomain + - all + examples: + - all + type: string + limit: + default: 5000 + description: Maximum number of links to return. + examples: + - 1000 + maximum: 100000 + minimum: 1 + type: integer + locale: + anyOf: + - enum: + - aa-DJ + - aa-ER + - aa-ET + - af + - af-NA + - af-ZA + - ak + - ak-GH + - am + - am-ET + - an-ES + - ar + - ar-AE + - ar-BH + - ar-DZ + - ar-EG + - ar-IN + - ar-IQ + - ar-JO + - ar-KW + - ar-LB + - ar-LY + - ar-MA + - ar-OM + - ar-QA + - ar-SA + - ar-SD + - ar-SY + - ar-TN + - ar-YE + - as + - as-IN + - asa + - asa-TZ + - ast-ES + - az + - az-AZ + - az-Cyrl + - az-Cyrl-AZ + - az-Latn + - az-Latn-AZ + - be + - be-BY + - bem + - bem-ZM + - ber-DZ + - ber-MA + - bez + - bez-TZ + - bg + - bg-BG + - bho-IN + - bm + - bm-ML + - bn + - bn-BD + - bn-IN + - bo + - bo-CN + - bo-IN + - br-FR + - brx-IN + - bs + - bs-BA + - byn-ER + - ca + - ca-AD + - ca-ES + - ca-FR + - ca-IT + - cgg + - cgg-UG + - chr + - chr-US + - crh-UA + - cs + - cs-CZ + - csb-PL + - cv-RU + - cy + - cy-GB + - da + - da-DK + - dav + - dav-KE + - de + - de-AT + - de-BE + - de-CH + - de-DE + - de-LI + - de-LU + - dv-MV + - dz-BT + - ebu + - ebu-KE + - ee + - ee-GH + - ee-TG + - el + - el-CY + - el-GR + - en + - en-AG + - en-AS + - en-AU + - en-BE + - en-BW + - en-BZ + - en-CA + - en-DK + - en-GB + - en-GU + - en-HK + - en-IE + - en-IN + - en-JM + - en-MH + - en-MP + - en-MT + - en-MU + - en-NA + - en-NG + - en-NZ + - en-PH + - en-PK + - en-SG + - en-TT + - en-UM + - en-US + - en-VI + - en-ZA + - en-ZM + - en-ZW + - eo + - es + - es-419 + - es-AR + - es-BO + - es-CL + - es-CO + - es-CR + - es-CU + - es-DO + - es-EC + - es-ES + - es-GQ + - es-GT + - es-HN + - es-MX + - es-NI + - es-PA + - es-PE + - es-PR + - es-PY + - es-SV + - es-US + - es-UY + - es-VE + - et + - et-EE + - eu + - eu-ES + - fa + - fa-AF + - fa-IR + - ff + - ff-SN + - fi + - fi-FI + - fil + - fil-PH + - fo + - fo-FO + - fr + - fr-BE + - fr-BF + - fr-BI + - fr-BJ + - fr-BL + - fr-CA + - fr-CD + - fr-CF + - fr-CG + - fr-CH + - fr-CI + - fr-CM + - fr-DJ + - fr-FR + - fr-GA + - fr-GN + - fr-GP + - fr-GQ + - fr-KM + - fr-LU + - fr-MC + - fr-MF + - fr-MG + - fr-ML + - fr-MQ + - fr-NE + - fr-RE + - fr-RW + - fr-SN + - fr-TD + - fr-TG + - fur-IT + - fy-DE + - fy-NL + - ga + - ga-IE + - gd-GB + - gez-ER + - gez-ET + - gl + - gl-ES + - gsw + - gsw-CH + - gu + - gu-IN + - guz + - guz-KE + - gv + - gv-GB + - ha + - ha-Latn + - ha-Latn-GH + - ha-Latn-NE + - ha-Latn-NG + - ha-NG + - haw + - haw-US + - he + - he-IL + - hi + - hi-IN + - hne-IN + - hr + - hr-HR + - hsb-DE + - ht-HT + - hu + - hu-HU + - hy + - hy-AM + - id + - id-ID + - ig + - ig-NG + - ii + - ii-CN + - ik-CA + - is + - is-IS + - it + - it-CH + - it-IT + - iu-CA + - iw-IL + - ja + - ja-JP + - jmc + - jmc-TZ + - ka + - ka-GE + - kab + - kab-DZ + - kam + - kam-KE + - kde + - kde-TZ + - kea + - kea-CV + - khq + - khq-ML + - ki + - ki-KE + - kk + - kk-Cyrl + - kk-Cyrl-KZ + - kk-KZ + - kl + - kl-GL + - kln + - kln-KE + - km + - km-KH + - kn + - kn-IN + - ko + - ko-KR + - kok + - kok-IN + - ks-IN + - ku-TR + - kw + - kw-GB + - ky-KG + - lag + - lag-TZ + - lb-LU + - lg + - lg-UG + - li-BE + - li-NL + - lij-IT + - lo-LA + - lt + - lt-LT + - luo + - luo-KE + - luy + - luy-KE + - lv + - lv-LV + - mag-IN + - mai-IN + - mas + - mas-KE + - mas-TZ + - mer + - mer-KE + - mfe + - mfe-MU + - mg + - mg-MG + - mhr-RU + - mi-NZ + - mk + - mk-MK + - ml + - ml-IN + - mn-MN + - mr + - mr-IN + - ms + - ms-BN + - ms-MY + - mt + - mt-MT + - my + - my-MM + - nan-TW + - naq + - naq-NA + - nb + - nb-NO + - nd + - nd-ZW + - nds-DE + - nds-NL + - ne + - ne-IN + - ne-NP + - nl + - nl-AW + - nl-BE + - nl-NL + - nn + - nn-NO + - nr-ZA + - nso-ZA + - nyn + - nyn-UG + - oc-FR + - om + - om-ET + - om-KE + - or + - or-IN + - os-RU + - pa + - pa-Arab + - pa-Arab-PK + - pa-Guru + - pa-Guru-IN + - pa-IN + - pa-PK + - pap-AN + - pl + - pl-PL + - ps + - ps-AF + - pt + - pt-BR + - pt-GW + - pt-MZ + - pt-PT + - rm + - rm-CH + - ro + - ro-MD + - ro-RO + - rof + - rof-TZ + - ru + - ru-MD + - ru-RU + - ru-UA + - rw + - rw-RW + - rwk + - rwk-TZ + - sa-IN + - saq + - saq-KE + - sc-IT + - sd-IN + - se-NO + - seh + - seh-MZ + - ses + - ses-ML + - sg + - sg-CF + - shi + - shi-Latn + - shi-Latn-MA + - shi-Tfng + - shi-Tfng-MA + - shs-CA + - si + - si-LK + - sid-ET + - sk + - sk-SK + - sl + - sl-SI + - sn + - sn-ZW + - so + - so-DJ + - so-ET + - so-KE + - so-SO + - sq + - sq-AL + - sq-MK + - sr + - sr-Cyrl + - sr-Cyrl-BA + - sr-Cyrl-ME + - sr-Cyrl-RS + - sr-Latn + - sr-Latn-BA + - sr-Latn-ME + - sr-Latn-RS + - sr-ME + - sr-RS + - ss-ZA + - st-ZA + - sv + - sv-FI + - sv-SE + - sw + - sw-KE + - sw-TZ + - ta + - ta-IN + - ta-LK + - te + - te-IN + - teo + - teo-KE + - teo-UG + - tg-TJ + - th + - th-TH + - ti + - ti-ER + - ti-ET + - tig-ER + - tk-TM + - tl-PH + - tn-ZA + - to + - to-TO + - tr + - tr-CY + - tr-TR + - ts-ZA + - tt-RU + - tzm + - tzm-Latn + - tzm-Latn-MA + - ug-CN + - uk + - uk-UA + - unm-US + - ur + - ur-IN + - ur-PK + - uz + - uz-Arab + - uz-Arab-AF + - uz-Cyrl + - uz-Cyrl-UZ + - uz-Latn + - uz-Latn-UZ + - uz-UZ + - ve-ZA + - vi + - vi-VN + - vun + - vun-TZ + - wa-BE + - wae-CH + - wal-ET + - wo-SN + - xh-ZA + - xog + - xog-UG + - yi-US + - yo + - yo-NG + - yue-HK + - zh + - zh-CN + - zh-HK + - zh-Hans + - zh-Hans-CN + - zh-Hans-HK + - zh-Hans-MO + - zh-Hans-SG + - zh-Hant + - zh-Hant-HK + - zh-Hant-MO + - zh-Hant-TW + - zh-SG + - zh-TW + - zu + - zu-ZA + type: string + - const: auto + type: string + description: Locale for browser language and region settings + examples: + - en-US + sitemap: + default: include + description: Sitemap and other methods will be used together to find URLs. + enum: + - skip + - include + - only + examples: + - include + type: string + url: + description: Url to map. + type: string + required: + - url + type: object + MapResponse: + additionalProperties: false + description: Response schema for map requests. + properties: + links: + description: Array of mapped links with optional titles and descriptions. + examples: + - - description: This is an example description for page 1. + title: Example Page 1 + url: https://example.com/page1 + - url: https://example.com/page2 + items: + additionalProperties: false + properties: + description: + type: string + title: + type: string + url: + format: uri + type: string + required: + - url + type: object + type: array + success: + description: Indicates if the map request was successful. + examples: + - true + type: boolean + task_id: + description: Unique identifier for the map task. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + type: string + required: + - task_id + - success + - links + type: object + MediaAsyncPayload: + allOf: + - properties: + country: + type: string + expected_mime_types: + items: + type: string + type: array + locale: + type: string + media_extractor: + enum: + - yt-dlp + type: string + media_extractor_options: + additionalProperties: false + properties: + format: + minLength: 1 + type: string + type: object + storage: + properties: + object_name: + type: string + type: + default: s3 + enum: + - s3 + - gcs + - do + - oci + type: string + url: + type: string + required: + - url + type: object + url: + format: uri + type: string + required: + - url + type: object + - properties: + callback_url: + description: URL to call back when async operation completes + examples: + - https://example.com/webhook/callback + type: string + storage_compress: + description: Whether to compress stored data + examples: + - true + type: boolean + storage_object_name: + description: Custom name for the stored object + examples: + - result-2024-01-15.json + type: string + storage_type: + description: Type of storage to use for results + examples: + - s3 + type: string + storage_url: + description: URL for storage location + examples: + - s3://bucket-name/path/to/object + type: string + type: object + MediaAsyncResponse: + $ref: '#/components/schemas/ExtractAsyncResponse' + description: Response when an async media download task is created successfully. + MediaPayload: + properties: + country: + type: string + expected_mime_types: + items: + type: string + type: array + locale: + type: string + media_extractor: + enum: + - yt-dlp + type: string + media_extractor_options: + additionalProperties: false + properties: + format: + minLength: 1 + type: string + type: object + storage: + properties: + object_name: + type: string + type: + default: s3 + enum: + - s3 + - gcs + - do + - oci + type: string + url: + type: string + required: + - url + type: object + url: + format: uri + type: string + required: + - url + type: object + MetadataFilterPublicV2: + additionalProperties: false + properties: + category: + anyOf: + - type: string + - type: 'null' + description: Category metadata value to match. + title: Category + data_source: + anyOf: + - type: string + - type: 'null' + description: Data source metadata value to match. + title: Data Source + description: + anyOf: + - type: string + - type: 'null' + description: Description metadata value to match. + title: Description + display_name: + anyOf: + - type: string + - type: 'null' + description: Display name metadata value to match. + title: Display Name + domain: + anyOf: + - type: string + - type: 'null' + description: Domain metadata value to match. + title: Domain + entity_type: + anyOf: + - type: string + - type: 'null' + description: Entity type metadata value to match. + title: Entity Type + vertical: + anyOf: + - type: string + - type: 'null' + description: Vertical metadata value to match. + title: Vertical + title: MetadataFilterPublicV2 + type: object + ParsingErrorResult: + additionalProperties: false + properties: + error: + type: string + status: + const: error + type: string + required: + - status + - error + type: object + ParsingSuccessResult: + additionalProperties: false + properties: + entities: + additionalProperties: {} + propertyNames: + type: string + type: object + status: + const: success + type: string + required: + - status + - entities + type: object + ParsingType: + description: Enum representing the parsing types supported by Nimble + enum: + - plain_text + - markdown + - simplified_html + title: ParsingType + type: string + PressAction: + additionalProperties: false + description: Press a keyboard key + properties: + press: + oneOf: + - type: string + - additionalProperties: false + properties: + delay: + $ref: '#/components/schemas/Duration' + key: + type: string + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + required: + - key + type: object + required: + - press + type: object + PrivacyFilterPublicV1: + enum: + - public + - private + - all + title: PrivacyFilterPublicV1 + type: string + PrivacyFilterPublicV2: + enum: + - public + - private + - all + title: PrivacyFilterPublicV2 + type: string + PrivacyLevelPublicV2: + enum: + - public + - private + title: PrivacyLevelPublicV2 + type: string + ResultModel: + description: 'Unified result model for all search types (SERP and WSA). + + + This model provides a consistent structure for search results, + + with platform-specific data in additional_data and typed metadata.' + properties: + additional_data: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: Platform-specific fields (e.g., price, rating, publish_date). Omitted from response when no extra data. + title: Additional Data + chunks: + anyOf: + - items: + type: string + type: array + - type: 'null' + description: Page content chunks most relevant to the query, most relevant first. Present only when cached-chunk + enrichment is enabled for the account, and never for search_depth=deep; omitted otherwise. Only the leading results + are enriched, and a result whose page could not be fetched in time keeps its snippet with no chunks, so this may + be absent on some results of an otherwise enriched response. + title: Chunks + content: + title: Content + type: string + description: + title: Description + type: string + entities: + anyOf: + - items: + $ref: '#/components/schemas/CompanyEntity' + type: array + - type: 'null' + description: Structured data about what the result is about, such as the company with focus='company'. Omitted when + there is none. + title: Entities + metadata: + anyOf: + - $ref: '#/components/schemas/SERPMetadata' + - $ref: '#/components/schemas/WSAMetadata' + title: Metadata + title: + title: Title + type: string + url: + title: Url + type: string + required: + - title + - description + - url + - content + - metadata + title: ResultModel + type: object + RunStatsPublicV2: + properties: + extract_templates: + description: Times the agent ran a Nimble extract template to parse a page into structured fields. + title: Extract Templates + type: integer + extracts: + description: Pages the agent fetched and extracted, including attempts that failed. Pages it already had in the + run don't count. + title: Extracts + type: integer + page_reads: + description: Times the agent read or searched through pages it had already extracted. + title: Page Reads + type: integer + scripts_run: + description: Scripts the agent wrote and ran to process what it collected. + title: Scripts Run + type: integer + searches: + description: 'Web searches the agent ran: one per researched sub-question, plus any direct search calls.' + title: Searches + type: integer + required: + - searches + - extracts + - extract_templates + - page_reads + - scripts_run + title: RunStatsPublicV2 + type: object + SERPMetadata: + description: Metadata for SERP-based search results (general, news, location). + properties: + country: + title: Country + type: string + driver: + anyOf: + - type: string + - type: 'null' + title: Driver + entity_type: + title: Entity Type + type: string + locale: + title: Locale + type: string + position: + title: Position + type: integer + required: + - position + - entity_type + - country + - locale + title: SERPMetadata + type: object + SafeSearch: + description: 'Adult-content filtering a `/search` request asks for (SRCH-227). + + + Declared from least to most filtering (see app/services/safe_search.py). + + Omitted on a request means each provider''s own default, not `off`.' + enum: + - 'off' + - moderate + - strict + title: SafeSearch + type: string + ScreenshotAction: + additionalProperties: false + description: Capture a page screenshot + properties: + screenshot: + oneOf: + - type: boolean + - additionalProperties: false + properties: + format: + enum: + - png + - jpeg + - webp + type: string + full_page: + type: boolean + quality: + maximum: 100 + minimum: 0 + type: number + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + type: object + required: + - screenshot + type: object + ScrollAction: + additionalProperties: false + description: Scroll the page or an element + properties: + scroll: + oneOf: + - type: number + - type: string + - additionalProperties: false + properties: + container: + $ref: '#/components/schemas/Selector' + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + to: + $ref: '#/components/schemas/Selector' + visible: + type: boolean + x: + type: number + y: + type: number + type: object + required: + - scroll + type: object + SearchDepth: + description: 'Controls content richness and latency of search results. + + + - lite: Token-efficient metadata for high-volume pipelines (title, URL, description only) + + - standard: Rich content (~2K chars) optimized for AI agents' + enum: + - lite + - standard + title: SearchDepth + type: string + SearchRequest: + description: Request body model for the /search endpoint. + properties: + content_type: + anyOf: + - items: + type: string + type: array + - type: 'null' + description: Filter by content type (only supported with focus=general). Supports semantic groups ('documents', + 'spreadsheets', 'presentations') and specific formats ('pdf', 'docx', 'xlsx', etc.) + title: Content Type + country: + default: US + description: Country code for geo-targeted results (e.g., 'US', 'GB', 'IL') + title: Country + type: string + deep_search: + anyOf: + - type: boolean + - type: 'null' + description: Deprecated. Use search_depth with full_content instead. true maps to 'lite' with full_content=true, + false maps to 'lite'. + title: Deep Search + end_date: + anyOf: + - type: string + - type: 'null' + description: 'Filter results before this date (format: YYYY-MM-DD or YYYY)' + title: End Date + exclude_domains: + anyOf: + - items: + type: string + maxItems: 50 + type: array + - type: 'null' + description: List of domains to exclude from search results. Maximum 50 domains. + title: Exclude Domains + focus: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant5b1cd5713a37' + - items: + $ref: '#/components/schemas/SdkStringVariant5b1cd5713a37' + type: array + default: general + description: Search focus mode (e.g., 'general', 'news', 'shopping') or a list of explicit subagent names (e.g., + ['amazon_serp', 'target_serp']) + title: Focus + full_content: + default: false + description: Return full page content for each result, in addition to its title, url, and description. Works with + either search_depth value. Higher recall and cost. + title: Full Content + type: boolean + include_domains: + anyOf: + - items: + type: string + maxItems: 50 + type: array + - type: 'null' + description: List of domains to include in search results. Maximum 50 domains. + title: Include Domains + locale: + default: en + description: Language/locale code (e.g., 'en', 'fr', 'de') + title: Locale + type: string + max_results: + default: 10 + description: Maximum number of results to return. Actual count may be lower depending on availability. + maximum: 100.0 + minimum: 1.0 + title: Max Results + type: integer + max_subagents: + default: 3 + description: Maximum number of subagents to execute in parallel for WSA focus modes (shopping, social, geo). Ignored + for SERP focus modes. + maximum: 10.0 + minimum: 1.0 + title: Max Subagents + type: integer + output_format: + $ref: '#/components/schemas/ParsingType' + default: markdown + description: 'Output format: plain_text, markdown, or simplified_html' + query: + description: Search query string + minLength: 1 + title: Query + type: string + safe_search: + anyOf: + - $ref: '#/components/schemas/SafeSearch' + - type: 'null' + description: 'Adult-content filtering: ''off'', ''moderate'' or ''strict''. When omitted, each search provider applies + its own default. Your account may enforce a minimum level, in which case the stricter of the two applies and is + reported back in the response. Filtering is best effort, not guaranteed. With search_depth=''lite'', ''moderate'' + applies the same filtering as ''strict''. A level above ''off'' is rejected with focus ''serp'', ''shopping'', + ''geo'' or ''social'', or with custom subagents. With search_depth=''lite'' it is also rejected with focus ''location'', + time_range=''hour'', some countries, and queries over 400 characters or 50 words including the domain filters + a focus adds (focus ''academic'' adds about 360 characters, so most academic queries are rejected).' + search_depth: + anyOf: + - $ref: '#/components/schemas/SearchDepth' + - type: 'null' + description: 'Content richness: ''lite'' (titles, URLs, snippets) or ''standard'' (rich content, default).' + start_date: + anyOf: + - type: string + - type: 'null' + description: 'Filter results after this date (format: YYYY-MM-DD or YYYY)' + title: Start Date + time_range: + anyOf: + - $ref: '#/components/schemas/TimeRange' + - type: 'null' + description: 'Filter by recency: hour, day, week, month, or year. Cannot be combined with start_date/end_date.' + required: + - query + title: SearchRequest + type: object + SearchResponse: + description: 'Response model from SearchService with results and optional LLM answer. + + + Note: request_id is always a valid UUID generated internally by the middleware, + + so no validation is needed.' + properties: + answer: + anyOf: + - type: string + - type: 'null' + title: Answer + answer_citations: + anyOf: + - items: + $ref: '#/components/schemas/Citation' + type: array + - type: 'null' + description: Citations mapping citation markers to result indices + title: Answer Citations + request_id: + description: Unique identifier for this request (UUID) + title: Request Id + type: string + results: + items: + $ref: '#/components/schemas/ResultModel' + title: Results + type: array + safe_search: + anyOf: + - $ref: '#/components/schemas/SafeSearch' + - type: 'null' + description: 'The effective safe search level: the stricter of the requested level and any minimum your account + enforces. Omitted when neither was set. With filtering on, empty results can mean every match was filtered out.' + serp_data: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: Cleaned SERP entities (e.g. KnowledgeGraph, TopStory, RelatedSearch). Only present for focus='serp'. + title: Serp Data + total_results: + description: Number of results returned + title: Total Results + type: integer + required: + - total_results + - results + - request_id + title: SearchResponse + type: object + Selector: + description: CSS selector or array of alternative selectors. Use an array when you have multiple possible selectors + for the same element. + examples: + - '#submit-button' + - button.primary + - - '#submit-button' + - .submit-btn + - button[type="submit"] + oneOf: + - minLength: 1 + type: string + - items: + minLength: 1 + type: string + minItems: 1 + type: array + SerpAsyncResponse: + additionalProperties: false + description: Response when an async SERP task is created successfully. + properties: + status: + const: success + description: Status indicating the async SERP task was created successfully. + type: string + task: + additionalProperties: false + description: The created async task details. + properties: + _query: {} + account_name: + description: Account name that owns the task. + type: string + api_type: + enum: + - web + - serp + - ecommerce + - social + - media + - agent + - extract + - fast-serp + - labs + type: string + batch_id: + anyOf: + - type: string + - type: 'null' + description: Batch ID if this task is part of a batch. + examples: + - 4b0a90bf-c951-42e4-95b3-a95a65ba69fc + created_at: + description: Timestamp when the task was created. + examples: + - '2024-01-15T10:30:00Z' + type: string + download_url: + anyOf: + - format: uri + type: string + - type: 'null' + description: URL for downloading the task results. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000/results + error: + anyOf: + - type: string + - type: 'null' + description: Error message if the task failed. + examples: + - Connection timeout + error_type: + anyOf: + - type: string + - type: 'null' + description: Classification of the error type. + examples: + - timeout_error + id: + description: Unique task identifier. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + minLength: 1 + type: string + input: + description: Original input data for the task. + modified_at: + description: Timestamp when the task was last modified. + examples: + - '2024-01-15T10:35:00Z' + type: string + output_url: + anyOf: + - type: string + - type: 'null' + description: Storage location of the output data. + queue: + description: Queue name the task was submitted to. + type: string + state: + description: Current state of the task. + enum: + - pending + - queued + - in_progress + - success + - error + examples: + - pending + type: string + status_code: + description: HTTP status code from the task execution. + examples: + - 200 + type: number + status_url: + description: URL for checking the task status. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000 + format: uri + type: string + required: + - id + - state + - status_url + - created_at + - input + - _query + type: object + required: + - status + - task + type: object + SerpBatchPayload: + properties: + inputs: + description: Array of SERP requests. Each object can include search parameters and async/storage settings. + items: + allOf: + - properties: + country: + description: ISO Alpha-2 country code used to access the target search engine (e.g. US, DE, GB). + examples: + - US + type: string + device: + description: Device type used for the search request. + enum: + - desktop + - mobile + examples: + - desktop + type: string + domain: + default: com + description: Top-level domain for the search engine (e.g. "com", "co.uk", "de"). + examples: + - com + type: string + locale: + description: Locale used for the search request. + examples: + - en + type: string + location: + description: Geo-location for the search (canonical Google location name). + examples: + - New York, New York, United States + type: string + num_results: + description: Number of results to return (1–100). + examples: + - 10 + maximum: 100 + minimum: 1 + type: integer + page: + description: The result page number for pagination. + examples: + - 1 + maximum: 9007199254740991 + minimum: 1 + type: integer + parse: + default: true + description: When true, the SERP response is parsed into structured JSON. + examples: + - true + type: boolean + query: + description: The search keyword or phrase to query. + examples: + - nimble web data + type: string + render: + default: false + description: Whether to render the page in a browser before extracting. + examples: + - false + type: boolean + resolve_url: + description: 'When true, search result links that point at a search-engine redirector are resolved from + the redirector''s Location header without loading the destination page. Best-effort within a time budget: + links that cannot be resolved in time are returned unchanged.' + examples: + - true + type: boolean + search_engine: + description: The search engine to query. + enum: + - google_search + - google_sge + - google_aio + - google_maps_search + - google_maps_reviews + - google_maps_place + - google_news + - google_images + - bing_search + - yandex_search + examples: + - google_search + type: string + show_hidden_results: + description: When true, disables Google result filtering (filter=0) so omitted/duplicate and highly similar + pages are also returned. Applies to Google search engines. + examples: + - false + type: boolean + zdr: + description: Redact retained customer input. Async and batch require customer storage_url; execution context + expires after the configured retention period. + type: boolean + type: object + - properties: + callback_url: + description: URL to call back when async operation completes + examples: + - https://example.com/webhook/callback + type: string + storage_compress: + description: Whether to compress stored data + examples: + - true + type: boolean + storage_object_name: + description: Custom name for the stored object + examples: + - result-2024-01-15.json + type: string + storage_type: + description: Type of storage to use for results + examples: + - s3 + type: string + storage_url: + description: URL for storage location + examples: + - s3://bucket-name/path/to/object + type: string + type: object + minItems: 1 + type: array + shared_inputs: + allOf: + - properties: + country: + description: ISO Alpha-2 country code used to access the target search engine (e.g. US, DE, GB). + examples: + - US + type: string + device: + description: Device type used for the search request. + enum: + - desktop + - mobile + examples: + - desktop + type: string + domain: + default: com + description: Top-level domain for the search engine (e.g. "com", "co.uk", "de"). + examples: + - com + type: string + locale: + description: Locale used for the search request. + examples: + - en + type: string + location: + description: Geo-location for the search (canonical Google location name). + examples: + - New York, New York, United States + type: string + num_results: + description: Number of results to return (1–100). + examples: + - 10 + maximum: 100 + minimum: 1 + type: integer + page: + description: The result page number for pagination. + examples: + - 1 + maximum: 9007199254740991 + minimum: 1 + type: integer + parse: + default: true + description: When true, the SERP response is parsed into structured JSON. + examples: + - true + type: boolean + query: + description: The search keyword or phrase to query. + examples: + - nimble web data + type: string + render: + default: false + description: Whether to render the page in a browser before extracting. + examples: + - false + type: boolean + resolve_url: + description: 'When true, search result links that point at a search-engine redirector are resolved from the + redirector''s Location header without loading the destination page. Best-effort within a time budget: links + that cannot be resolved in time are returned unchanged.' + examples: + - true + type: boolean + search_engine: + description: The search engine to query. + enum: + - google_search + - google_sge + - google_aio + - google_maps_search + - google_maps_reviews + - google_maps_place + - google_news + - google_images + - bing_search + - yandex_search + examples: + - google_search + type: string + show_hidden_results: + description: When true, disables Google result filtering (filter=0) so omitted/duplicate and highly similar + pages are also returned. Applies to Google search engines. + examples: + - false + type: boolean + zdr: + description: Redact retained customer input. Async and batch require customer storage_url; execution context + expires after the configured retention period. + type: boolean + type: object + - properties: + callback_url: + description: URL to call back when async operation completes + examples: + - https://example.com/webhook/callback + type: string + storage_compress: + description: Whether to compress stored data + examples: + - true + type: boolean + storage_object_name: + description: Custom name for the stored object + examples: + - result-2024-01-15.json + type: string + storage_type: + description: Type of storage to use for results + examples: + - s3 + type: string + storage_url: + description: URL for storage location + examples: + - s3://bucket-name/path/to/object + type: string + type: object + description: Shared parameters applied to the entire batch. Can include search parameters and async/storage settings. + required: + - inputs + type: object + SerpBatchResponse: + additionalProperties: false + description: Response when a batch of SERP tasks is created successfully. + properties: + batch_id: + description: Unique identifier for the batch. + type: string + batch_size: + description: Number of tasks in the batch. + type: number + tasks: + description: List of created tasks. + items: + additionalProperties: false + properties: + _query: {} + account_name: + description: Account name that owns the task. + type: string + api_type: + enum: + - web + - serp + - ecommerce + - social + - media + - agent + - extract + - fast-serp + - labs + type: string + batch_id: + anyOf: + - type: string + - type: 'null' + description: Batch ID if this task is part of a batch. + examples: + - 4b0a90bf-c951-42e4-95b3-a95a65ba69fc + created_at: + description: Timestamp when the task was created. + examples: + - '2024-01-15T10:30:00Z' + type: string + download_url: + anyOf: + - format: uri + type: string + - type: 'null' + description: URL for downloading the task results. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000/results + error: + anyOf: + - type: string + - type: 'null' + description: Error message if the task failed. + examples: + - Connection timeout + error_type: + anyOf: + - type: string + - type: 'null' + description: Classification of the error type. + examples: + - timeout_error + id: + description: Unique task identifier. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + minLength: 1 + type: string + input: + description: Original input data for the task. + modified_at: + description: Timestamp when the task was last modified. + examples: + - '2024-01-15T10:35:00Z' + type: string + output_url: + anyOf: + - type: string + - type: 'null' + description: Storage location of the output data. + queue: + description: Queue name the task was submitted to. + type: string + state: + description: Current state of the task. + enum: + - pending + - queued + - in_progress + - success + - error + examples: + - pending + type: string + status_code: + description: HTTP status code from the task execution. + examples: + - 200 + type: number + status_url: + description: URL for checking the task status. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000 + format: uri + type: string + required: + - id + - state + - status_url + - created_at + - input + - _query + type: object + type: array + required: + - batch_id + - batch_size + - tasks + type: object + SerpPayload: + description: Request body model for the /serp endpoint + properties: + country: + description: ISO Alpha-2 country code used to access the target search engine (e.g. US, DE, GB). + examples: + - US + type: string + device: + description: Device type used for the search request. + enum: + - desktop + - mobile + examples: + - desktop + type: string + domain: + default: com + description: Top-level domain for the search engine (e.g. "com", "co.uk", "de"). + examples: + - com + type: string + locale: + description: Locale used for the search request. + examples: + - en + type: string + location: + description: Geo-location for the search (canonical Google location name). + examples: + - New York, New York, United States + type: string + num_results: + description: Number of results to return (1–100). + examples: + - 10 + maximum: 100 + minimum: 1 + type: integer + page: + description: The result page number for pagination. + examples: + - 1 + maximum: 9007199254740991 + minimum: 1 + type: integer + parse: + default: true + description: When true, the SERP response is parsed into structured JSON. + examples: + - true + type: boolean + query: + description: The search keyword or phrase to query. + examples: + - nimble web data + type: string + render: + default: false + description: Whether to render the page in a browser before extracting. + examples: + - false + type: boolean + resolve_url: + description: 'When true, search result links that point at a search-engine redirector are resolved to their final + destination URLs. Best-effort within a time budget: links that cannot be resolved in time are returned unchanged.' + examples: + - true + type: boolean + search_engine: + description: The search engine to query. + enum: + - google_search + - google_sge + - google_aio + - google_maps_search + - google_maps_reviews + - google_maps_place + - google_news + - google_images + - bing_search + - yandex_search + examples: + - google_search + type: string + show_hidden_results: + description: When true, disables Google result filtering (filter=0) so omitted/duplicate and highly similar pages + are also returned. Applies to Google search engines. + examples: + - false + type: boolean + zdr: + description: Redact retained customer input. Async and batch require customer storage_url; execution context expires + after the configured retention period. + type: boolean + required: + - search_engine + type: object + SourceCategory: + description: 'What *kind* of source this is (classified by the compress LLM), independent + + of TrustSourceType (how authoritative it is for a specific claim). Deliberately + + uses "official" rather than "primary" so the two axes can never collide. + + + Also doubles as the sub-question''s ``source_intent`` (what kind of source a + + question *needs*) — the two concepts overlap enough that a single enum lets + + ``classify_source_importance`` compare "what we got" against "what we asked + + for" directly.' + enum: + - official + - news + - social + - academic + - aggregator + - marketplace + - other + title: SourceCategory + type: string + TaskErrorResponse: + additionalProperties: false + description: Error response for task operations. + properties: + error: + description: Error message describing what went wrong. + examples: + - task not found + type: string + status: + const: failed + description: Status indicating the request failed. + type: string + required: + - status + - error + type: object + TaskFailedResponse: + additionalProperties: false + description: Response when task execution failed. + properties: + error: + description: Error message. + examples: + - task failed + type: string + status: + const: failed + description: Status indicating the task failed. + type: string + task: + additionalProperties: false + description: The failed task details. + properties: + _query: {} + account_name: + description: Account name that owns the task. + type: string + api_type: + enum: + - web + - serp + - ecommerce + - social + - media + - agent + - extract + - fast-serp + - labs + type: string + batch_id: + anyOf: + - type: string + - type: 'null' + description: Batch ID if this task is part of a batch. + examples: + - 4b0a90bf-c951-42e4-95b3-a95a65ba69fc + created_at: + description: Timestamp when the task was created. + examples: + - '2024-01-15T10:30:00Z' + type: string + download_url: + anyOf: + - format: uri + type: string + - type: 'null' + description: URL for downloading the task results. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000/results + error: + anyOf: + - type: string + - type: 'null' + description: Error message if the task failed. + examples: + - Connection timeout + error_type: + anyOf: + - type: string + - type: 'null' + description: Classification of the error type. + examples: + - timeout_error + id: + description: Unique task identifier. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + minLength: 1 + type: string + input: + description: Original input data for the task. + modified_at: + description: Timestamp when the task was last modified. + examples: + - '2024-01-15T10:35:00Z' + type: string + output_url: + anyOf: + - type: string + - type: 'null' + description: Storage location of the output data. + queue: + description: Queue name the task was submitted to. + type: string + state: + description: Current state of the task. + enum: + - pending + - queued + - in_progress + - success + - error + examples: + - pending + type: string + status_code: + description: HTTP status code from the task execution. + examples: + - 200 + type: number + status_url: + description: URL for checking the task status. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000 + format: uri + type: string + required: + - id + - state + - status_url + - created_at + - input + - _query + type: object + required: + - status + - error + - task + type: object + TaskListResponse: + additionalProperties: false + description: Paginated list of tasks response. + properties: + data: + description: Array of task objects. + items: + additionalProperties: false + properties: + _query: {} + account_name: + description: Account name that owns the task. + type: string + api_type: + enum: + - web + - serp + - ecommerce + - social + - media + - agent + - extract + - fast-serp + - labs + type: string + batch_id: + anyOf: + - type: string + - type: 'null' + description: Batch ID if this task is part of a batch. + examples: + - 4b0a90bf-c951-42e4-95b3-a95a65ba69fc + created_at: + description: Timestamp when the task was created. + examples: + - '2024-01-15T10:30:00Z' + type: string + download_url: + anyOf: + - format: uri + type: string + - type: 'null' + description: URL for downloading the task results. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000/results + error: + anyOf: + - type: string + - type: 'null' + description: Error message if the task failed. + examples: + - Connection timeout + error_type: + anyOf: + - type: string + - type: 'null' + description: Classification of the error type. + examples: + - timeout_error + id: + description: Unique task identifier. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + minLength: 1 + type: string + input: + description: Original input data for the task. + modified_at: + description: Timestamp when the task was last modified. + examples: + - '2024-01-15T10:35:00Z' + type: string + output_url: + anyOf: + - type: string + - type: 'null' + description: Storage location of the output data. + queue: + description: Queue name the task was submitted to. + type: string + state: + description: Current state of the task. + enum: + - pending + - queued + - in_progress + - success + - error + examples: + - pending + type: string + status_code: + description: HTTP status code from the task execution. + examples: + - 200 + type: number + status_url: + description: URL for checking the task status. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000 + format: uri + type: string + required: + - id + - state + - status_url + - created_at + - input + - _query + type: object + type: array + pagination: + additionalProperties: false + properties: + has_next: + description: Whether there are more tasks available. + type: boolean + next_cursor: + anyOf: + - type: string + - type: 'null' + description: Cursor to use for fetching the next page. + total: + description: Total number of tasks. + type: number + required: + - has_next + - next_cursor + - total + type: object + required: + - data + - pagination + type: object + TaskNotFoundErrorResponse: + additionalProperties: false + description: Error response when the specified task is not found. + properties: + error: + const: task not found + description: Error message indicating the task was not found. + type: string + status: + const: failed + description: Status indicating the request failed. + type: string + required: + - status + - error + type: object + TaskPendingResponse: + additionalProperties: false + description: Response when task is still pending. + properties: + error: + const: task not finished yet + description: Error message indicating task is not finished yet. + type: string + status: + const: failed + description: Status indicating the task is still pending. + type: string + required: + - status + - error + type: object + TaskProgress: + additionalProperties: false + description: Approximate progress of a running (in_progress) task. + properties: + bytes_done: + description: Bytes of the output written so far. + examples: + - 52428800 + maximum: 9007199254740991 + minimum: 0 + type: integer + bytes_total: + description: Expected size in bytes, often an estimate; omitted when unknown. + examples: + - 104857600 + exclusiveMinimum: 0 + maximum: 9007199254740991 + type: integer + percent: + description: floor(100 * bytes_done / bytes_total), capped at 99 until the task succeeds; omitted when bytes_total + is unknown. Approximate. + examples: + - 50 + maximum: 99 + minimum: 0 + type: integer + updated_at: + description: When this progress was measured (ISO 8601). + examples: + - '2026-10-20T10:00:00.000Z' + type: string + required: + - bytes_done + - updated_at + type: object + TaskResponseSchema: + additionalProperties: false + description: Response containing task details. + properties: + task: + additionalProperties: false + properties: + _query: {} + account_name: + description: Account name that owns the task. + type: string + api_type: + enum: + - web + - serp + - ecommerce + - social + - media + - agent + - extract + - fast-serp + - labs + type: string + batch_id: + anyOf: + - type: string + - type: 'null' + description: Batch ID if this task is part of a batch. + examples: + - 4b0a90bf-c951-42e4-95b3-a95a65ba69fc + created_at: + description: Timestamp when the task was created. + examples: + - '2024-01-15T10:30:00Z' + type: string + download_url: + anyOf: + - format: uri + type: string + - type: 'null' + description: URL for downloading the task results. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000/results + error: + anyOf: + - type: string + - type: 'null' + description: Error message if the task failed. + examples: + - Connection timeout + error_type: + anyOf: + - type: string + - type: 'null' + description: Classification of the error type. + examples: + - timeout_error + id: + description: Unique task identifier. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + minLength: 1 + type: string + input: + description: Original input data for the task. + modified_at: + description: Timestamp when the task was last modified. + examples: + - '2024-01-15T10:35:00Z' + type: string + output_url: + anyOf: + - type: string + - type: 'null' + description: Storage location of the output data. + progress: + $ref: '#/components/schemas/TaskProgress' + description: Approximate progress, present only while the task is in_progress and the job reports it (media + downloads with media_extractor). + queue: + description: Queue name the task was submitted to. + type: string + state: + description: Current state of the task. + enum: + - pending + - queued + - in_progress + - success + - error + examples: + - pending + type: string + status_code: + description: HTTP status code from the task execution. + examples: + - 200 + type: number + status_url: + description: URL for checking the task status. + examples: + - https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000 + format: uri + type: string + required: + - id + - state + - status_url + - created_at + - input + - _query + type: object + required: + - task + type: object + TaskRunErrorPublicV1: + properties: + message: + description: Human-readable error description. + title: Message + type: string + ref_id: + description: Reference ID (equals the run id). + title: Ref Id + type: string + required: + - ref_id + - message + title: TaskRunErrorPublicV1 + type: object + TaskRunErrorPublicV2: + properties: + message: + description: Human-readable error description. + title: Message + type: string + ref_id: + description: Reference ID (equals the run id). + title: Ref Id + type: string + required: + - ref_id + - message + title: TaskRunErrorPublicV2 + type: object + TaskRunFailedResultPublicV1: + properties: + error: + $ref: '#/components/schemas/TaskRunErrorPublicV1' + description: Structured error detail. + run: + $ref: '#/components/schemas/TaskRunResponsePublicV1' + description: Task run object with status 'failed'. + required: + - run + - error + title: TaskRunFailedResultPublicV1 + type: object + TaskRunFailedResultPublicV2: + properties: + error: + $ref: '#/components/schemas/TaskRunErrorPublicV2' + description: Structured error detail. + run: + $ref: '#/components/schemas/TaskRunResponsePublicV2' + description: Task run object with status 'failed'. + required: + - run + - error + title: TaskRunFailedResultPublicV2 + type: object + TaskRunJsonOutputPublicV1: + properties: + content: + anyOf: + - additionalProperties: true + type: object + - items: {} + type: array + description: The final structured output. + title: Content + sources: + description: 'Sources the output cites, deduplicated by URL in citation order. Always present, including when trust + is off (`trust: null`).' + items: + $ref: '#/components/schemas/TaskRunOutputSource' + title: Sources + type: array + trust: + anyOf: + - $ref: '#/components/schemas/JsonRunTrust' + - type: 'null' + description: Trust and citation metadata for the output. + type: + const: json + default: json + description: Output content type. + title: Type + type: string + required: + - content + - trust + title: TaskRunJsonOutputPublicV1 + type: object + TaskRunJsonOutputPublicV2: + properties: + content: + anyOf: + - additionalProperties: true + type: object + - items: {} + type: array + description: The final structured output. + title: Content + sources: + description: 'Sources the output cites, deduplicated by URL in citation order. Always present, including when trust + is off (`trust: null`).' + items: + $ref: '#/components/schemas/TaskRunOutputSource' + title: Sources + type: array + trust: + anyOf: + - $ref: '#/components/schemas/JsonRunTrust' + - type: 'null' + description: Trust and citation metadata for the output. + type: + const: json + default: json + description: Output content type. + title: Type + type: string + required: + - content + - trust + title: TaskRunJsonOutputPublicV2 + type: object + TaskRunOutputSource: + description: A source the output cites. Present in every trust mode, unlike ``trust.sources``. + properties: + title: + anyOf: + - type: string + - type: 'null' + title: Title + url: + title: Url + type: string + required: + - url + title: TaskRunOutputSource + type: object + TaskRunResponsePublicV1: + properties: + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run completed. + title: Completed At + created_at: + description: When the run was created. + format: date-time + title: Created At + type: string + effort: + $ref: '#/components/schemas/Effort' + description: Effort level used for the run. + error: + anyOf: + - $ref: '#/components/schemas/TaskRunErrorPublicV1' + - type: 'null' + description: Error details when the run failed. + id: + description: Run identifier, format "task_run_{uuid}". + title: Id + type: string + interaction_id: + description: Interaction ID. + title: Interaction Id + type: string + is_active: + description: True while status is 'queued' or 'running'. + title: Is Active + type: boolean + prompt: + anyOf: + - type: string + - type: 'null' + description: Prompt submitted for the run. + title: Prompt + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run started executing. + title: Started At + status: + $ref: '#/components/schemas/TaskRunStatusValue' + description: Current run status. + trust_mode: + anyOf: + - $ref: '#/components/schemas/TrustMode' + - type: 'null' + description: 'Trust mode this run resolved to: the request''s trust_mode, else the agent''s, else no_trust. no_trust + runs return `output.trust: null`. Null for runs created before trust_mode existed, which ran with trust.' + web_search_agent_id: + description: Web Search Agent instance this run belongs to. + title: Web Search Agent Id + type: string + required: + - id + - interaction_id + - status + - is_active + - effort + - created_at + - web_search_agent_id + title: TaskRunResponsePublicV1 + type: object + TaskRunResponsePublicV2: + properties: + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run completed. + title: Completed At + created_at: + description: When the run was created. + format: date-time + title: Created At + type: string + effort: + $ref: '#/components/schemas/Effort' + description: Effort level used for the run. + error: + anyOf: + - $ref: '#/components/schemas/TaskRunErrorPublicV2' + - type: 'null' + description: Error details when the run failed. + id: + description: Run identifier, format "task_run_{uuid}". + title: Id + type: string + interaction_id: + description: Interaction ID. + title: Interaction Id + type: string + is_active: + description: True while status is 'queued' or 'running'. + title: Is Active + type: boolean + prompt: + anyOf: + - type: string + - type: 'null' + description: Prompt submitted for the run. + title: Prompt + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: When the run started executing. + title: Started At + status: + $ref: '#/components/schemas/TaskRunStatusValue' + description: Current run status. + trust_mode: + anyOf: + - $ref: '#/components/schemas/TrustMode' + - type: 'null' + description: 'Trust mode this run resolved to: the request''s trust_mode, else the agent''s, else no_trust. no_trust + runs return `output.trust: null`. Null for runs created before trust_mode existed, which ran with trust.' + web_search_agent_id: + description: Web Search Agent instance this run belongs to. + title: Web Search Agent Id + type: string + required: + - id + - interaction_id + - status + - is_active + - effort + - created_at + - web_search_agent_id + title: TaskRunResponsePublicV2 + type: object + TaskRunResultPublicV1: + properties: + output: + anyOf: + - $ref: '#/components/schemas/TaskRunTextOutputPublicV1' + - $ref: '#/components/schemas/TaskRunJsonOutputPublicV1' + description: Output from the completed task. + title: Output + run: + $ref: '#/components/schemas/TaskRunResponsePublicV1' + description: Task run object with status 'completed'. + required: + - run + - output + title: TaskRunResultPublicV1 + type: object + TaskRunResultPublicV2: + properties: + output: + anyOf: + - $ref: '#/components/schemas/TaskRunTextOutputPublicV2' + - $ref: '#/components/schemas/TaskRunJsonOutputPublicV2' + description: Output from the completed task. + title: Output + run: + $ref: '#/components/schemas/TaskRunResponsePublicV2' + description: Task run object with status 'completed'. + stats: + anyOf: + - $ref: '#/components/schemas/RunStatsPublicV2' + - type: 'null' + description: Counts of the work the agent did. Null for runs completed before this was recorded. + required: + - run + - output + title: TaskRunResultPublicV2 + type: object + TaskRunStatusValue: + description: Lowercase status values used in API responses (distinct from the DB-level TaskRunStatus enum). + enum: + - queued + - running + - completed + - failed + - cancelled + title: TaskRunStatusValue + type: string + TaskRunTextOutputPublicV1: + properties: + content: + description: The final prose answer. + title: Content + type: string + sources: + description: 'Sources the output cites, deduplicated by URL in citation order. Always present, including when trust + is off (`trust: null`).' + items: + $ref: '#/components/schemas/TaskRunOutputSource' + title: Sources + type: array + trust: + anyOf: + - $ref: '#/components/schemas/TextRunTrust' + - type: 'null' + description: Trust and citation metadata for the output. + type: + const: text + default: text + description: Output content type. + title: Type + type: string + required: + - content + - trust + title: TaskRunTextOutputPublicV1 + type: object + TaskRunTextOutputPublicV2: + properties: + content: + description: The final prose answer. + title: Content + type: string + sources: + description: 'Sources the output cites, deduplicated by URL in citation order. Always present, including when trust + is off (`trust: null`).' + items: + $ref: '#/components/schemas/TaskRunOutputSource' + title: Sources + type: array + trust: + anyOf: + - $ref: '#/components/schemas/TextRunTrust' + - type: 'null' + description: Trust and citation metadata for the output. + type: + const: text + default: text + description: Output content type. + title: Type + type: string + required: + - content + - trust + title: TaskRunTextOutputPublicV2 + type: object + TemplateFeatureFlagsPublicV1: + properties: + is_localization_supported: + default: false + title: Is Localization Supported + type: boolean + is_pagination_supported: + default: false + title: Is Pagination Supported + type: boolean + title: TemplateFeatureFlagsPublicV1 + type: object + TemplateGenerationResponsePublicV1: + properties: + agent_name: + anyOf: + - type: string + - type: 'null' + title: Agent Name + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + created_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Created At + error: + anyOf: + - type: string + - type: 'null' + title: Error + generated_version: + anyOf: + - $ref: '#/components/schemas/TemplateVersionResponsePublicV1' + - type: 'null' + generated_version_id: + anyOf: + - format: uuid + type: string + - type: 'null' + title: Generated Version Id + id: + format: uuid + title: Id + type: string + source_version_id: + anyOf: + - format: uuid + type: string + - type: 'null' + title: Source Version Id + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + status: + title: Status + type: string + summary: + anyOf: + - type: string + - type: 'null' + title: Summary + required: + - id + - status + title: TemplateGenerationResponsePublicV1 + type: object + TemplateInputPropertyPublicV1: + properties: + default: + anyOf: + - type: string + - type: boolean + - type: integer + - type: number + - type: 'null' + title: Default + description: + anyOf: + - type: string + - type: 'null' + title: Description + examples: + anyOf: + - items: {} + type: array + - type: 'null' + title: Examples + is_localization_param: + default: false + title: Is Localization Param + type: boolean + is_pagination_param: + default: false + title: Is Pagination Param + type: boolean + name: + default: '' + title: Name + type: string + required: + default: false + title: Required + type: boolean + rules: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Rules + type: + default: string + title: Type + type: string + title: TemplateInputPropertyPublicV1 + type: object + TemplatePublicV1: + properties: + description: + anyOf: + - type: string + - type: 'null' + title: Description + display_name: + title: Display Name + type: string + domain: + anyOf: + - type: string + - type: 'null' + title: Domain + entity_type: + anyOf: + - type: string + - type: 'null' + title: Entity Type + is_public: + title: Is Public + type: boolean + managed_by: + anyOf: + - type: string + - type: 'null' + title: Managed By + name: + title: Name + type: string + vertical: + anyOf: + - type: string + - type: 'null' + title: Vertical + required: + - name + - is_public + - display_name + title: TemplatePublicV1 + type: object + TemplateSamplePublicV1: + properties: + input: + anyOf: + - $ref: '#/components/schemas/JsonValue' + - type: 'null' + output: + anyOf: + - $ref: '#/components/schemas/JsonValue' + - type: 'null' + title: TemplateSamplePublicV1 + type: object + TemplateVersionMetadataPublicV1: + properties: + data_source: + anyOf: + - type: string + - type: 'null' + title: Data Source + description: + anyOf: + - type: string + - type: 'null' + title: Description + display_name: + anyOf: + - type: string + - type: 'null' + title: Display Name + domain: + anyOf: + - type: string + - type: 'null' + title: Domain + entity_type: + anyOf: + - type: string + - type: 'null' + title: Entity Type + tags: + items: + type: string + title: Tags + type: array + vertical: + anyOf: + - type: string + - type: 'null' + title: Vertical + title: TemplateVersionMetadataPublicV1 + type: object + TemplateVersionResponsePublicV1: + properties: + agent_name: + title: Agent Name + type: string + created_at: + format: date-time + title: Created At + type: string + id: + format: uuid + title: Id + type: string + input_schema: + additionalProperties: true + title: Input Schema + type: object + metadata: + $ref: '#/components/schemas/TemplateVersionMetadataPublicV1' + output_schema: + additionalProperties: true + title: Output Schema + type: object + samples: + anyOf: + - items: + $ref: '#/components/schemas/TemplateSamplePublicV1' + type: array + - type: 'null' + title: Samples + version_number: + title: Version Number + type: integer + required: + - id + - agent_name + - version_number + - metadata + - input_schema + - output_schema + - created_at + title: TemplateVersionResponsePublicV1 + type: object + TextClaimTrust: + description: Trust metadata for one claim in a prose answer, keyed by callout marker. + properties: + callout: + description: Callout marker number referencing this claim in the answer text. + title: Callout + type: integer + citations: + description: Citations backing this claim. + items: + $ref: '#/components/schemas/TrustCitation' + title: Citations + type: array + confidence: + $ref: '#/components/schemas/TrustConfidence' + description: Confidence in this claim. + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + required: + - citations + - confidence + - reasoning + - callout + title: TextClaimTrust + type: object + TextRunTrust: + description: 'Trust metadata for a prose answer: run-level confidence plus per-claim citations.' + properties: + claims: + description: Per-claim trust, keyed by callout markers in the answer text. + items: + $ref: '#/components/schemas/TextClaimTrust' + title: Claims + type: array + confidence: + $ref: '#/components/schemas/TrustConfidence' + description: Overall confidence in the answer. + reasoning: + description: Why this confidence level was assigned. + title: Reasoning + type: string + sources: + description: Sources consulted while producing the answer. + items: + $ref: '#/components/schemas/TrustSource' + title: Sources + type: array + required: + - sources + - confidence + - reasoning + - claims + title: TextRunTrust + type: object + TimeRange: + description: Time range filters passed to Webit SERP API as 'time' parameter. + enum: + - hour + - day + - week + - month + - year + title: TimeRange + type: string + TriggerJobRunRequestPublicV1: + description: 'Optional body for a manual run: inputs applied to this run only.' + properties: + inputs: + anyOf: + - $ref: '#/components/schemas/JobInputsPublicV1' + - type: 'null' + description: Inputs to use for this run only. The job's own configuration is left unchanged; omit the body to run + the job with its configured inputs. + title: TriggerJobRunRequestPublicV1 + type: object + TriggerJobRunRequestPublicV2: + description: 'Optional body for a manual run: inputs applied to this run only.' + properties: + inputs: + anyOf: + - $ref: '#/components/schemas/JobInputsPublicV2' + - type: 'null' + description: Inputs to use for this run only. The job's own configuration is left unchanged; omit the body to run + the job with its configured inputs. + title: TriggerJobRunRequestPublicV2 + type: object + TrustCitation: + description: A citation backing a specific claim in the answer. + properties: + excerpts: + anyOf: + - items: + type: string + type: array + - type: 'null' + description: Verbatim excerpts supporting the claim. + title: Excerpts + extract_template_name: + anyOf: + - type: string + - type: 'null' + description: Extract template used to read the source, when one was used. + title: Extract Template Name + source_category: + anyOf: + - $ref: '#/components/schemas/SourceCategory' + - type: 'null' + description: 'Kind of source: official, news, social, academic, aggregator, or other.' + source_intent: + anyOf: + - $ref: '#/components/schemas/SourceCategory' + - type: 'null' + description: Kind of source the underlying question asked for. + source_type: + anyOf: + - $ref: '#/components/schemas/TrustSourceType' + - type: 'null' + description: 'How authoritative the source is: ''primary'' or ''secondary''.' + title: + anyOf: + - type: string + - type: 'null' + description: Title of the cited page. + title: Title + url: + description: URL of the cited page. + title: Url + type: string + required: + - url + title: TrustCitation + type: object + TrustConfidence: + enum: + - high + - medium + - low + - pre_existing + title: TrustConfidence + type: string + TrustMode: + enum: + - no_trust + - full_trust + title: TrustMode + type: string + TrustSource: + description: A source consulted while producing the answer. + properties: + extract_template_name: + anyOf: + - type: string + - type: 'null' + description: Extract template used to read the source, when one was used. + title: Extract Template Name + source_category: + anyOf: + - $ref: '#/components/schemas/SourceCategory' + - type: 'null' + description: 'Kind of source: official, news, social, academic, aggregator, or other.' + source_intent: + anyOf: + - $ref: '#/components/schemas/SourceCategory' + - type: 'null' + description: Kind of source the underlying question asked for. + title: + anyOf: + - type: string + - type: 'null' + description: Title of the source page. + title: Title + type: + $ref: '#/components/schemas/TrustSourceType' + description: 'How authoritative the source is: ''primary'' or ''secondary''.' + url: + description: URL of the source page. + title: Url + type: string + required: + - url + - type + title: TrustSource + type: object + TrustSourceType: + enum: + - primary + - secondary + title: TrustSourceType + type: string + UpdateJobRequestPublicV1: + description: Partial update for an existing job; omitted fields are left unchanged. + properties: + description: + anyOf: + - type: string + - type: 'null' + description: New description. + title: Description + destination: + anyOf: + - $ref: '#/components/schemas/JobDestinationPublicV1' + - type: 'null' + description: New output destination. + display_name: + anyOf: + - type: string + - type: 'null' + description: New display name. + title: Display Name + inputs: + anyOf: + - $ref: '#/components/schemas/JobInputsPublicV1' + - type: 'null' + description: New input data configuration. + schedule: + anyOf: + - $ref: '#/components/schemas/JobSchedulePublicV1' + - type: 'null' + description: New cron schedule. + title: UpdateJobRequestPublicV1 + type: object + UpdateJobRequestPublicV2: + description: Partial update for an existing job; omitted fields are left unchanged. + properties: + description: + anyOf: + - type: string + - type: 'null' + description: New description. + title: Description + destination: + anyOf: + - $ref: '#/components/schemas/JobDestinationPublicV2' + - type: 'null' + description: New output destination. + display_name: + anyOf: + - type: string + - type: 'null' + description: New display name. + title: Display Name + inputs: + anyOf: + - $ref: '#/components/schemas/JobInputsPublicV2' + - type: 'null' + description: New input data configuration. + schedule: + anyOf: + - $ref: '#/components/schemas/JobSchedulePublicV2' + - type: 'null' + description: New cron schedule. + title: UpdateJobRequestPublicV2 + type: object + UsageCatalogConfigurationPublicV2: + description: A configuration that can be used as a filter. + properties: + filter: + description: 'The value to pass as `configuration` on `GET /v2/usage`: `.`.' + examples: + - extractApi.vx6 + title: Filter + type: string + key: + description: Configuration key, unique within its product. + examples: + - vx6 + title: Key + type: string + name: + description: Current display name. + examples: + - Extract API VX6 + title: Name + type: string + status: + description: '`active`: on sale. `deprecated`: still billed, not sold to new customers. `retired`: no longer billed; + listed because past usage carries its key.' + enum: + - active + - deprecated + - retired + examples: + - active + title: Status + type: string + required: + - key + - filter + - name + - status + title: UsageCatalogConfigurationPublicV2 + type: object + UsageCatalogProductPublicV2: + description: A product and its configurations. + properties: + configurations: + description: Configurations of this product. + items: + $ref: '#/components/schemas/UsageCatalogConfigurationPublicV2' + title: Configurations + type: array + key: + description: Product key. + examples: + - extractApi + title: Key + type: string + name: + description: Current display name. + examples: + - Extract API + title: Name + type: string + required: + - key + - name + - configurations + title: UsageCatalogProductPublicV2 + type: object + UsageCatalogPublicV2: + description: Every service, product and configuration usage can be filtered and grouped by. + properties: + services: + description: Services, each with its products. + items: + $ref: '#/components/schemas/UsageCatalogServicePublicV2' + title: Services + type: array + required: + - services + title: UsageCatalogPublicV2 + type: object + UsageCatalogServicePublicV2: + description: A service and its products. + properties: + key: + description: Service key. + examples: + - data + title: Key + type: string + name: + description: Current display name. + examples: + - Nimble API + title: Name + type: string + products: + description: Products of this service. + items: + $ref: '#/components/schemas/UsageCatalogProductPublicV2' + title: Products + type: array + required: + - key + - name + - products + title: UsageCatalogServicePublicV2 + type: object + UsageConfigurationNamePublicV2: + description: The configuration usage was billed on. + properties: + key: + anyOf: + - type: string + - type: 'null' + description: Configuration key, unique within its product. `null` for usage on a legacy name the catalog no longer + has; such usage cannot be filtered by product or configuration. + examples: + - vx6 + title: Key + name: + description: Current display name, or the legacy name when `key` is `null`. + examples: + - Extract API VX6 + title: Name + type: string + required: + - key + - name + title: UsageConfigurationNamePublicV2 + type: object + UsageDimensionsPublicV2: + description: The dimension values of a row. Only the dimensions in `group_by` are present. + properties: + api_key: + anyOf: + - type: string + - type: 'null' + description: API key id the usage authenticated with; `null` when it used no API key. + examples: + - 0123456789abcdef0123456789abcdef + title: Api Key + configuration: + anyOf: + - $ref: '#/components/schemas/UsageConfigurationNamePublicV2' + - type: 'null' + description: Configuration the usage was billed on; `null` when the usage carries none. + country: + anyOf: + - type: string + - type: 'null' + description: Target country (ISO 3166-1 alpha-2); `null` when not recorded. + examples: + - US + title: Country + domain: + anyOf: + - type: string + - type: 'null' + description: Target domain; `null` when not recorded, and for the row combining every domain outside the top 100 + (see `meta.domains_capped`). + examples: + - example.com + title: Domain + product: + anyOf: + - $ref: '#/components/schemas/UsageNamePublicV2' + - type: 'null' + description: Product the usage belongs to; `null` when the usage is on a legacy name. + service: + anyOf: + - $ref: '#/components/schemas/UsageNamePublicV2' + - type: 'null' + description: Service the usage belongs to. + title: UsageDimensionsPublicV2 + type: object + UsageMetaPublicV2: + description: How the response was produced. + properties: + domains_capped: + default: false + description: Only the top 100 domains are broken out; the rest are combined in the row with domain null. Present, + as true, only when such a row is in the result. + examples: + - true + title: Domains Capped + type: boolean + end: + description: 'End of the range answered (UTC): the requested end rounded up to a whole bucket.' + examples: + - '2026-11-03T00:00:00Z' + format: date-time + title: End + type: string + excluded_services: + default: [] + description: Service keys left out because they cannot be split or filtered by the requested `api_key`, `domain` + or `country`, or because their usage cannot be read yet; their usage is not in `data` or `totals`. + examples: + - - ip + items: + type: string + title: Excluded Services + type: array + granularity: + description: Time bucket size used. + enum: + - hour + - day + - month + examples: + - day + title: Granularity + type: string + last_usage_at: + anyOf: + - format: date-time + type: string + - type: 'null' + description: Most recent usage recorded for this account (UTC) in the services queried, at any time (not limited + to the range); `null` when there is none. + examples: + - '2026-11-02T13:00:00Z' + title: Last Usage At + partial: + description: 'True when figures may still change: figures for recent periods are still being loaded (the last hour + or two for `hour`; today, and yesterday until 05:00 UTC, for `day`; the current month, and the previous one until + the 4th, for `month`), or part of the usage could not be read this time.' + examples: + - true + title: Partial + type: boolean + range_snapped: + description: True when the requested range did not fall on bucket boundaries, so `start` and `end` were widened + to whole buckets and the edge buckets are reported whole. + examples: + - false + title: Range Snapped + type: boolean + start: + description: 'Start of the range answered (UTC): the requested start rounded down to a whole bucket.' + examples: + - '2026-10-27T00:00:00Z' + format: date-time + title: Start + type: string + total: + description: Number of rows before `limit` and `offset`; page while `offset + limit < total`. + examples: + - 7 + title: Total + type: integer + truncated: + description: 'True when the range held more rows than one call can read: rows are cut, and `totals` may be incomplete + too. Narrow the range, the filters or `group_by` to see all usage.' + examples: + - false + title: Truncated + type: boolean + required: + - start + - end + - granularity + - range_snapped + - partial + - last_usage_at + - truncated + - total + title: UsageMetaPublicV2 + type: object + UsageMetricsPublicV2: + description: Usage figures. A metric a service does not measure is `null`, not 0. + properties: + bytes_in: + anyOf: + - type: integer + - type: 'null' + description: Request bytes sent; `null` when the service does not measure it. + examples: + - 10240 + title: Bytes In + bytes_out: + anyOf: + - type: integer + - type: 'null' + description: Response bytes received; `null` when the service does not measure it. + examples: + - 2048000 + title: Bytes Out + cost_usd: + anyOf: + - type: string + - type: 'null' + description: Cost in US dollars, as a decimal string. Row costs are rounded to the cent per underlying bucket, so + rows may not add up exactly to `totals.cost_usd`. `null` for accounts on fixed-price plans, whose spend isn't + shown. + examples: + - '1.24' + title: Cost Usd + errors: + description: Requests and runs that did not succeed. + examples: + - 2 + title: Errors + type: integer + requests: + anyOf: + - type: integer + - type: 'null' + description: Requests made; `null` for usage counted in runs only. + examples: + - 120 + title: Requests + runs: + anyOf: + - type: integer + - type: 'null' + description: Web Search Agent runs; `null` for usage counted in requests only. + examples: + - null + title: Runs + success_rate: + anyOf: + - type: number + - type: 'null' + description: '`successes` divided by `requests` plus `runs`, 0 to 1; `null` when there were none.' + examples: + - 0.9833 + title: Success Rate + successes: + description: Successful requests and runs. + examples: + - 118 + title: Successes + type: integer + required: + - requests + - runs + - successes + - errors + - success_rate + - bytes_in + - bytes_out + - cost_usd + title: UsageMetricsPublicV2 + type: object + UsageNamePublicV2: + description: 'A catalog entry: its permanent key and its current display name.' + properties: + key: + description: Permanent key; use it in filters. Never changes. + examples: + - data + title: Key + type: string + name: + description: Current display name. May change at any time. + examples: + - Nimble API + title: Name + type: string + required: + - key + - name + title: UsageNamePublicV2 + type: object + UsageResponsePublicV2: + description: Usage of the calling account over a time range. + properties: + data: + description: Rows, newest-bucket last, largest usage first within a bucket. + items: + $ref: '#/components/schemas/UsageRowPublicV2' + title: Data + type: array + meta: + $ref: '#/components/schemas/UsageMetaPublicV2' + description: Range, granularity, freshness and row count of this response. + totals: + $ref: '#/components/schemas/UsageMetricsPublicV2' + description: Figures for the whole range and filters, across every row. + required: + - data + - totals + - meta + title: UsageResponsePublicV2 + type: object + UsageRowPublicV2: + description: Usage for one combination of the `group_by` dimensions. + properties: + dimensions: + $ref: '#/components/schemas/UsageDimensionsPublicV2' + description: Dimension values of this row. + metrics: + $ref: '#/components/schemas/UsageMetricsPublicV2' + description: Usage figures of this row. + timestamp: + anyOf: + - format: date-time + type: string + - type: 'null' + description: Start of the time bucket (UTC). Present only when `group_by` includes `time`. + examples: + - '2026-10-27T00:00:00Z' + title: Timestamp + required: + - dimensions + - metrics + title: UsageRowPublicV2 + type: object + ValidationError: + properties: + ctx: + title: Context + type: object + input: + title: Input + loc: + items: + anyOf: + - type: string + - type: integer + title: Location + type: array + msg: + title: Message + type: string + type: + title: Error Type + type: string + required: + - loc + - msg + - type + title: ValidationError + type: object + WSAMetadata: + description: Metadata for WSA-based search results. + properties: + agent_name: + title: Agent Name + type: string + required: + - agent_name + title: WSAMetadata + type: object + WaitAction: + additionalProperties: false + description: Wait for a specified duration + properties: + wait: + oneOf: + - $ref: '#/components/schemas/Duration' + - additionalProperties: false + properties: + duration: + $ref: '#/components/schemas/Duration' + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + required: + - duration + type: object + required: + - wait + type: object + WaitForElementAction: + additionalProperties: false + description: Wait for an element to appear or reach a specific state + properties: + wait_for_element: + oneOf: + - $ref: '#/components/schemas/Selector' + - additionalProperties: false + properties: + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + selector: + $ref: '#/components/schemas/Selector' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + timeout: + default: 15000 + description: 'Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.' + minimum: 0 + type: number + visible: + type: boolean + required: + - selector + type: object + required: + - wait_for_element + type: object + WaitForNavigationAction: + additionalProperties: false + description: Wait for page navigation to complete + properties: + wait_for_navigation: + oneOf: + - enum: + - load + - domcontentloaded + - networkidle0 + - networkidle2 + type: string + - additionalProperties: false + properties: + navigation: + enum: + - load + - domcontentloaded + - networkidle0 + - networkidle2 + type: string + required: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string + "true"/"false". Default: true.' + skip: + anyOf: + - type: boolean + - const: 'true' + type: string + - const: 'false' + type: string + description: 'Whether to skip this action. Accepts boolean or string "true"/"false". Default: false.' + timeout: + default: 15000 + description: 'Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.' + minimum: 0 + type: number + required: + - navigation + type: object + required: + - wait_for_navigation + type: object + WebSearchAgentCreateRequestPublicV1: + properties: + agent_name: + anyOf: + - type: string + - type: 'null' + description: Stable agent name. + title: Agent Name + description: + anyOf: + - type: string + - type: 'null' + description: Agent description shown to users. + title: Description + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly agent name shown to users. + title: Display Name + domain_expertise: + anyOf: + - type: string + - type: 'null' + description: Domain expertise or operating context for the agent. + title: Domain Expertise + effort: + $ref: '#/components/schemas/Effort' + default: high + description: Default effort level for this agent's runs. + goals: + deprecated: true + description: Ordered goals for the agent to follow. + items: + type: string + title: Goals + type: array + icon: + anyOf: + - type: string + - type: 'null' + description: Icon identifier used when presenting the agent. + title: Icon + is_active: + default: true + description: Whether the agent can be used to start new runs. + title: Is Active + type: boolean + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: JSON schema describing the structured output the agent should produce. + title: Output Schema + sources: + $ref: '#/components/schemas/AgentSourcesPublicV1' + description: Source guidance for the agent. + suggested_questions: + description: Suggested prompts users can run with this agent. + items: + type: string + title: Suggested Questions + type: array + template: + anyOf: + - type: string + - type: 'null' + description: Template name to materialize this instance from. When set, the scalar fields and child rows are copied + from the template. + title: Template + trust_mode: + $ref: '#/components/schemas/TrustMode' + default: full_trust + description: Default trust mode for this agent's runs. no_trust (default; also what null means) skips trust and + grounding; full_trust scores each value's confidence and checks it against its sources. + use_case: + anyOf: + - $ref: '#/components/schemas/WebSearchAgentUseCase' + - type: 'null' + description: Primary use case supported by the agent. + title: WebSearchAgentCreateRequestPublicV1 + type: object + WebSearchAgentCreateRequestPublicV2: + properties: + agent_name: + anyOf: + - type: string + - type: 'null' + description: Stable agent name. + title: Agent Name + description: + anyOf: + - type: string + - type: 'null' + description: Agent description shown to users. + title: Description + display_name: + anyOf: + - type: string + - type: 'null' + description: Human-friendly agent name shown to users. + title: Display Name + effort: + $ref: '#/components/schemas/Effort' + default: high + description: Default effort level for this agent's runs. + goals: + deprecated: true + description: Ordered goals for the agent to follow. + items: + type: string + title: Goals + type: array + icon: + anyOf: + - type: string + - type: 'null' + description: Icon identifier used when presenting the agent. + title: Icon + is_active: + default: true + description: Whether the agent can be used to start new runs. + title: Is Active + type: boolean + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: JSON schema describing the structured output the agent should produce. + title: Output Schema + skill: + anyOf: + - type: string + - type: 'null' + description: Skill or operating context for the agent. + title: Skill + sources: + $ref: '#/components/schemas/AgentSourcesPublicV2' + description: Source guidance for the agent. + suggested_questions: + description: Suggested prompts users can run with this agent. + items: + type: string + title: Suggested Questions + type: array + template: + anyOf: + - type: string + - type: 'null' + description: Template name to materialize this instance from. When set, the scalar fields and child rows are copied + from the template. + title: Template + trust_mode: + $ref: '#/components/schemas/TrustMode' + default: full_trust + description: Default trust mode for this agent's runs. no_trust (default; also what null means) skips trust and + grounding; full_trust scores each value's confidence and checks it against its sources. + use_case: + anyOf: + - $ref: '#/components/schemas/WebSearchAgentUseCase' + - type: 'null' + description: Primary use case supported by the agent. + title: WebSearchAgentCreateRequestPublicV2 + type: object + WebSearchAgentGoalResponsePublicV1: + properties: + goal: + description: Goal text. + title: Goal + type: string + id: + description: Unique goal identifier (wsag_). + title: Id + type: string + order: + description: Zero-based goal position. + title: Order + type: integer + required: + - id + - goal + - order + title: WebSearchAgentGoalResponsePublicV1 + type: object + WebSearchAgentGoalResponsePublicV2: + properties: + goal: + description: Goal text. + title: Goal + type: string + id: + description: Unique goal identifier (wsag_). + title: Id + type: string + order: + description: Zero-based goal position. + title: Order + type: integer + required: + - id + - goal + - order + title: WebSearchAgentGoalResponsePublicV2 + type: object + WebSearchAgentResponsePublicV1: + properties: + agent_name: + anyOf: + - type: string + - type: 'null' + description: Stable agent name. + title: Agent Name + created_at: + description: When the agent was created. + format: date-time + title: Created At + type: string + description: + description: Agent description shown to users. + title: Description + type: string + display_name: + description: Human-friendly agent name shown to users. + title: Display Name + type: string + domain_expertise: + description: Domain expertise or operating context for the agent. + title: Domain Expertise + type: string + effort: + $ref: '#/components/schemas/Effort' + description: Default effort level for this agent's runs. + goals: + deprecated: true + description: Ordered goals for the agent to follow. + items: + $ref: '#/components/schemas/WebSearchAgentGoalResponsePublicV1' + title: Goals + type: array + icon: + description: Icon identifier used when presenting the agent. + title: Icon + type: string + id: + description: Unique web search agent identifier (wsa_). + title: Id + type: string + is_active: + description: Whether the agent can be used to start new runs. + title: Is Active + type: boolean + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: JSON schema describing the structured output the agent should produce. + title: Output Schema + sources: + $ref: '#/components/schemas/AgentSourcesResponsePublicV1' + description: Source guidance for the agent. + suggested_questions: + description: Suggested prompts users can run with this agent. + items: + $ref: '#/components/schemas/WebSearchAgentSuggestedQuestionResponsePublicV1' + title: Suggested Questions + type: array + trust_mode: + $ref: '#/components/schemas/TrustMode' + description: Default trust mode for this agent's runs. + updated_at: + description: When the agent was last updated. + format: date-time + title: Updated At + type: string + use_case: + $ref: '#/components/schemas/WebSearchAgentUseCase' + description: Primary use case supported by the agent. + required: + - id + - display_name + - description + - icon + - effort + - domain_expertise + - use_case + - output_schema + - trust_mode + - is_active + - created_at + - updated_at + - sources + - suggested_questions + title: WebSearchAgentResponsePublicV1 + type: object + WebSearchAgentResponsePublicV2: + properties: + agent_name: + anyOf: + - type: string + - type: 'null' + description: Stable agent name. + title: Agent Name + created_at: + description: When the agent was created. + format: date-time + title: Created At + type: string + description: + description: Agent description shown to users. + title: Description + type: string + display_name: + description: Human-friendly agent name shown to users. + title: Display Name + type: string + effort: + $ref: '#/components/schemas/Effort' + description: Default effort level for this agent's runs. + goals: + deprecated: true + description: Ordered goals for the agent to follow. + items: + $ref: '#/components/schemas/WebSearchAgentGoalResponsePublicV2' + title: Goals + type: array + icon: + description: Icon identifier used when presenting the agent. + title: Icon + type: string + id: + description: Unique web search agent identifier (wsa_). + title: Id + type: string + is_active: + description: Whether the agent can be used to start new runs. + title: Is Active + type: boolean + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: JSON schema describing the structured output the agent should produce. + title: Output Schema + skill: + description: Skill or operating context for the agent. + title: Skill + type: string + sources: + $ref: '#/components/schemas/AgentSourcesResponsePublicV2' + description: Source guidance for the agent. + suggested_questions: + description: Suggested prompts users can run with this agent. + items: + $ref: '#/components/schemas/WebSearchAgentSuggestedQuestionResponsePublicV2' + title: Suggested Questions + type: array + trust_mode: + $ref: '#/components/schemas/TrustMode' + description: Default trust mode for this agent's runs. + updated_at: + description: When the agent was last updated. + format: date-time + title: Updated At + type: string + use_case: + $ref: '#/components/schemas/WebSearchAgentUseCase' + description: Primary use case supported by the agent. + required: + - id + - display_name + - description + - icon + - effort + - skill + - use_case + - output_schema + - trust_mode + - is_active + - created_at + - updated_at + - sources + - suggested_questions + title: WebSearchAgentResponsePublicV2 + type: object + WebSearchAgentRunCreateRequestPublicV1: + properties: + effort: + anyOf: + - $ref: '#/components/schemas/Effort' + - type: 'null' + description: Effort level overriding the agent default for this run. + enable_events: + default: false + description: Whether to stream run events when supported. + title: Enable Events + type: boolean + input: + description: User prompt or task instructions for the run. + title: Input + type: string + input_data: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - additionalProperties: true + type: object + - type: 'null' + description: 'Existing records to ENRICH: a list of partial rows, or a single object, mirroring output_schema''s + shape.' + title: Input Data + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: JSON schema overriding the agent's default structured output for this run. + title: Output Schema + previous_interaction_id: + anyOf: + - type: string + - type: 'null' + description: Previous interaction identifier used to continue a conversation. + title: Previous Interaction Id + sources: + anyOf: + - $ref: '#/components/schemas/AgentSourcesPublicV1' + - type: 'null' + description: Source guidance overriding the agent default. + trust_mode: + anyOf: + - $ref: '#/components/schemas/TrustMode' + - type: 'null' + description: 'Per-run trust override. When unset, the run uses the agent''s trust_mode, which defaults to no_trust + (trust off). no_trust skips trust and grounding and returns `trust: null`; full_trust enables trust and grounding.' + required: + - input + title: WebSearchAgentRunCreateRequestPublicV1 + type: object + WebSearchAgentRunCreateRequestPublicV2: + properties: + agent_name: + anyOf: + - type: string + - type: 'null' + description: Stable agent name. On this no-agent-id route, an unseen name creates a new agent; an existing name + reuses it. Ignored on the /{agent_id}/runs route. + title: Agent Name + effort: + anyOf: + - $ref: '#/components/schemas/Effort' + - type: 'null' + description: Effort level overriding the agent default for this run. + enable_events: + default: false + description: Whether to stream run events when supported. + title: Enable Events + type: boolean + input: + description: User prompt or task instructions for the run. + title: Input + type: string + input_data: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - additionalProperties: true + type: object + - type: 'null' + description: 'Existing records to ENRICH: a list of partial rows, or a single object, mirroring output_schema''s + shape.' + title: Input Data + memory: + $ref: '#/components/schemas/WebSearchAgentRunMemoryConfigPublicV2' + description: Memory settings for this run. Not yet available to every account. + origin: + const: api + default: api + description: Origin of public API runs. Public requests are always API-originated. + title: Origin + type: string + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: JSON schema overriding the agent's default structured output for this run. + title: Output Schema + previous_interaction_id: + anyOf: + - type: string + - type: 'null' + description: Previous interaction identifier used to continue a conversation. + title: Previous Interaction Id + skill: + anyOf: + - type: string + - type: 'null' + description: Skill override for this run. One-time only, except when this run creates a new agent via agent_name, + in which case it becomes the new agent's stored skill. + title: Skill + sources: + anyOf: + - $ref: '#/components/schemas/AgentSourcesPublicV2' + - type: 'null' + description: Source guidance overriding the agent default. + trust_mode: + anyOf: + - $ref: '#/components/schemas/TrustMode' + - type: 'null' + description: 'Per-run trust override. When unset, the run uses the agent''s trust_mode, which defaults to no_trust + (trust off). no_trust skips trust and grounding and returns `trust: null`; full_trust enables trust and grounding.' + use_case: + anyOf: + - $ref: '#/components/schemas/WebSearchAgentUseCase' + - type: 'null' + description: Only settable when this run creates a new agent (via agent_name, or when no agent is resolved), in + which case it becomes the new agent's stored use_case. For a run against an existing agent, this must match the + agent's own use_case — passing the same value is accepted as a no-op, a different value is rejected. + required: + - input + title: WebSearchAgentRunCreateRequestPublicV2 + type: object + WebSearchAgentRunMemoryConfigPublicV2: + properties: + enabled: + default: false + description: Whether the run loads the agent's published memory. + title: Enabled + type: boolean + title: WebSearchAgentRunMemoryConfigPublicV2 + type: object + WebSearchAgentSourceCreateRequestPublicV1: + properties: + domains: + description: Domains included in this source group. + items: + type: string + title: Domains + type: array + order: + default: 0 + description: Zero-based source group position. + title: Order + type: integer + title: + description: Source group title. + title: Title + type: string + required: + - title + - domains + title: WebSearchAgentSourceCreateRequestPublicV1 + type: object + WebSearchAgentSourceCreateRequestPublicV2: + properties: + domains: + description: Domains included in this source group. + items: + type: string + title: Domains + type: array + order: + default: 0 + description: Zero-based source group position. + title: Order + type: integer + title: + description: Source group title. + title: Title + type: string + required: + - title + - domains + title: WebSearchAgentSourceCreateRequestPublicV2 + type: object + WebSearchAgentSourceResponsePublicV1: + properties: + domains: + description: Domains included in this source group. + items: + type: string + title: Domains + type: array + id: + description: Unique source group identifier (wsas_). + title: Id + type: string + order: + description: Zero-based source group position. + title: Order + type: integer + title: + description: Source group title. + title: Title + type: string + required: + - id + - title + - domains + - order + title: WebSearchAgentSourceResponsePublicV1 + type: object + WebSearchAgentSourceResponsePublicV2: + properties: + domains: + description: Domains included in this source group. + items: + type: string + title: Domains + type: array + id: + description: Unique source group identifier (wsas_). + title: Id + type: string + order: + description: Zero-based source group position. + title: Order + type: integer + title: + description: Source group title. + title: Title + type: string + required: + - id + - title + - domains + - order + title: WebSearchAgentSourceResponsePublicV2 + type: object + WebSearchAgentSuggestedQuestionResponsePublicV1: + properties: + id: + description: Unique suggested question identifier (wsasq_). + title: Id + type: string + order: + description: Zero-based suggested question position. + title: Order + type: integer + question: + description: Suggested prompt text. + title: Question + type: string + required: + - id + - question + - order + title: WebSearchAgentSuggestedQuestionResponsePublicV1 + type: object + WebSearchAgentSuggestedQuestionResponsePublicV2: + properties: + id: + description: Unique suggested question identifier (wsasq_). + title: Id + type: string + order: + description: Zero-based suggested question position. + title: Order + type: integer + question: + description: Suggested prompt text. + title: Question + type: string + required: + - id + - question + - order + title: WebSearchAgentSuggestedQuestionResponsePublicV2 + type: object + WebSearchAgentTemplateResponsePublicV1: + properties: + created_at: + description: When the template was created. + format: date-time + title: Created At + type: string + description: + description: Template description shown to users. + title: Description + type: string + display_name: + description: Human-friendly template name shown to users. + title: Display Name + type: string + domain_expertise: + description: Domain expertise or operating context for the template. + title: Domain Expertise + type: string + effort: + $ref: '#/components/schemas/Effort' + description: Default effort level for runs created from this template. + goals: + deprecated: true + description: Ordered goals for the template. + items: + $ref: '#/components/schemas/WebSearchAgentGoalResponsePublicV1' + title: Goals + type: array + icon: + description: Icon identifier used when presenting the template. + title: Icon + type: string + id: + description: Unique template identifier (wsat_). + title: Id + type: string + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: JSON schema describing the structured output the agent should produce. + title: Output Schema + sources: + description: Ordered source groups for the template. + items: + $ref: '#/components/schemas/WebSearchAgentSourceResponsePublicV1' + title: Sources + type: array + suggested_questions: + description: Suggested prompts for the template. + items: + $ref: '#/components/schemas/WebSearchAgentSuggestedQuestionResponsePublicV1' + title: Suggested Questions + type: array + template_name: + description: Stable template name used to create agent instances. + title: Template Name + type: string + updated_at: + description: When the template was last updated. + format: date-time + title: Updated At + type: string + use_case: + $ref: '#/components/schemas/WebSearchAgentUseCase' + description: Primary use case supported by the template. + required: + - id + - template_name + - display_name + - description + - icon + - effort + - domain_expertise + - use_case + - output_schema + - created_at + - updated_at + - sources + - suggested_questions + title: WebSearchAgentTemplateResponsePublicV1 + type: object + WebSearchAgentTemplateResponsePublicV2: + properties: + created_at: + description: When the template was created. + format: date-time + title: Created At + type: string + description: + description: Template description shown to users. + title: Description + type: string + display_name: + description: Human-friendly template name shown to users. + title: Display Name + type: string + effort: + $ref: '#/components/schemas/Effort' + description: Default effort level for runs created from this template. + goals: + deprecated: true + description: Ordered goals for the template. + items: + $ref: '#/components/schemas/WebSearchAgentGoalResponsePublicV2' + title: Goals + type: array + icon: + description: Icon identifier used when presenting the template. + title: Icon + type: string + id: + description: Unique template identifier (wsat_). + title: Id + type: string + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: JSON schema describing the structured output the agent should produce. + title: Output Schema + skill: + description: Skill or operating context for the template. + title: Skill + type: string + sources: + description: Ordered source groups for the template. + items: + $ref: '#/components/schemas/WebSearchAgentSourceResponsePublicV2' + title: Sources + type: array + suggested_questions: + description: Suggested prompts for the template. + items: + $ref: '#/components/schemas/WebSearchAgentSuggestedQuestionResponsePublicV2' + title: Suggested Questions + type: array + template_name: + description: Stable template name used to create agent instances. + title: Template Name + type: string + updated_at: + description: When the template was last updated. + format: date-time + title: Updated At + type: string + use_case: + $ref: '#/components/schemas/WebSearchAgentUseCase' + description: Primary use case supported by the template. + required: + - id + - template_name + - display_name + - description + - icon + - effort + - skill + - use_case + - output_schema + - created_at + - updated_at + - sources + - suggested_questions + title: WebSearchAgentTemplateResponsePublicV2 + type: object + WebSearchAgentUseCase: + enum: + - research + - enrichment + - dataset_building + title: WebSearchAgentUseCase + type: string + WebTrafficMonth: + properties: + month: + anyOf: + - type: string + - type: 'null' + description: YYYY-MM + title: Month + visits: + anyOf: + - type: integer + - type: number + - type: 'null' + title: Visits + title: WebTrafficMonth + type: object + SdkStringVariant45b9c162d044: + description: Resource type for network capture filtering + examples: + - document + - script + - xhr + - fetch + type: string + SdkStringVariantb885fffd6042: + description: Skills or capabilities required for the request + examples: + - dynamic-content + private: true + type: string + x-private: true + SdkStringVariant5b1cd5713a37: + type: string + SdkStringVariant7a06ddd6b0fd: + description: Resource type for network capture filtering + enum: + - document + - stylesheet + - image + - media + - font + - script + - texttrack + - xhr + - fetch + - prefetch + - eventsource + - websocket + - manifest + - signedexchange + - ping + - cspviolationreport + - preflight + - other + - fedcm + examples: + - document + - script + - xhr + - fetch + type: string + securitySchemes: + APIKeyCookie: + in: cookie + name: token + type: apiKey + BearerAuth: + in: header + name: Authorization + scheme: bearer + type: http + HTTPBearer: + scheme: bearer + type: http +info: + description: Nimble API + title: API Gateway + version: 2.0.0 +openapi: 3.1.0 +paths: + /v2/agents: + get: + description: List the active Web Search Agents in your account. Results are scoped to the workspace resolved from your + token (or the optional `workspace_id` query parameter) and paginated with `offset`/`limit`. + operationId: listAgents + parameters: + - in: query + name: offset + required: false + schema: + default: 0 + minimum: 0 + title: Offset + type: integer + - in: query + name: limit + required: false + schema: + default: 100 + maximum: 200 + minimum: 1 + title: Limit + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse_WebSearchAgentResponsePublicV2_' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: List Agents + tags: + - Public API + post: + description: Create a Web Search Agent. Either pass `template` to materialize a pre-built template (its fields, goals, + sources, and suggested questions are copied), or define the agent from scratch with `display_name`, `goals`, `sources`, + and an optional `output_schema` for structured results. + operationId: createAgent + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebSearchAgentCreateRequestPublicV2' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/WebSearchAgentResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Create Agent + tags: + - Public API + /v2/agents/runs: + post: + description: Creates a minimal persistent Web Search Agent and starts a run for it. The response includes `web_search_agent_id` + for later agent and run queries. + operationId: createGeneratedAgentRun + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebSearchAgentRunCreateRequestPublicV2' + required: true + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskRunResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Create Run With Generated Agent + tags: + - Public API + /v2/agents/templates: + get: + description: List the pre-built agent templates available to your account. Use a template's `template_name` with `POST + /v2/agents` to create an agent instance from it. + operationId: listAgentTemplates + parameters: + - in: query + name: offset + required: false + schema: + default: 0 + minimum: 0 + title: Offset + type: integer + - in: query + name: limit + required: false + schema: + default: 100 + maximum: 200 + minimum: 1 + title: Limit + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse_WebSearchAgentTemplateResponsePublicV2_' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: List Agent Templates + tags: + - Public API + /v2/agents/templates/{template_name}: + get: + description: Retrieve a single agent template by its stable `template_name`. + operationId: getAgentTemplate + parameters: + - in: path + name: template_name + required: true + schema: + title: Template Name + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WebSearchAgentTemplateResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Get Agent Template + tags: + - Public API + /v2/agents/{agent_id}: + delete: + description: 'Deactivate an agent. This is a soft delete: the agent can no longer start new runs, but its existing runs + and their results remain retrievable.' + operationId: deactivateAgent + parameters: + - in: path + name: agent_id + required: true + schema: + format: uuid + title: Agent Id + type: string + responses: + '204': + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Deactivate Agent + tags: + - Public API + get: + description: Retrieve a single Web Search Agent by ID. + operationId: getAgent + parameters: + - in: path + name: agent_id + required: true + schema: + format: uuid + title: Agent Id + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WebSearchAgentResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Get Agent + tags: + - Public API + patch: + description: 'Update an agent with a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) document — an array + of `{op, path, value}` operations applied to the agent, e.g. `[{"op": "replace", "path": "/display_name", "value": + "My agent"}]`. Returns the updated agent.' + operationId: updateAgent + parameters: + - in: path + name: agent_id + required: true + schema: + format: uuid + title: Agent Id + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JsonPatchDocument' + application/json-patch+json: + schema: + $ref: '#/components/schemas/JsonPatchDocument' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WebSearchAgentResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Update Agent + tags: + - Public API + /v2/agents/{agent_id}/runs: + get: + description: List the runs of an agent, newest first, paginated with `offset`/`limit`. + operationId: listAgentRuns + parameters: + - in: path + name: agent_id + required: true + schema: + format: uuid + title: Agent Id + type: string + - in: query + name: offset + required: false + schema: + default: 0 + minimum: 0 + title: Offset + type: integer + - in: query + name: limit + required: false + schema: + default: 100 + maximum: 200 + minimum: 1 + title: Limit + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse_TaskRunResponsePublicV2_' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: List Agent Runs + tags: + - Public API + post: + description: 'Start an agent run. The run executes asynchronously: the response returns immediately with status `queued`, + then poll `GET .../runs/{run_id}` until `completed` and fetch the output from `GET .../runs/{run_id}/result` — or + set `enable_events: true` and follow `GET .../runs/{run_id}/events` for live progress. + + + To enrich existing records instead of researching from scratch, pass them in `input_data`; this requires an `output_schema` + (on the request or the agent).' + operationId: createAgentRun + parameters: + - in: path + name: agent_id + required: true + schema: + format: uuid + title: Agent Id + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebSearchAgentRunCreateRequestPublicV2' + required: true + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskRunResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Create Agent Run + tags: + - Public API + /v2/agents/{agent_id}/runs/{run_id}: + get: + description: 'Retrieve a run''s current state. Poll this endpoint after creating a run: the run is finished once `status` + is `completed`, `failed`, or `cancelled`.' + operationId: getAgentRun + parameters: + - in: path + name: agent_id + required: true + schema: + format: uuid + title: Agent Id + type: string + - in: path + name: run_id + required: true + schema: + title: Run Id + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskRunResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Get Agent Run + tags: + - Public API + /v2/agents/{agent_id}/runs/{run_id}/events: + get: + description: 'Stream a run''s progress as [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) + (`text/event-stream`). Create the run with `enable_events: true` to have events published. A keep-alive comment is + sent every 15 seconds.' + operationId: streamAgentRunEvents + parameters: + - in: path + name: agent_id + required: true + schema: + format: uuid + title: Agent Id + type: string + - in: path + name: run_id + required: true + schema: + title: Run Id + type: string + responses: + '200': + content: + text/event-stream: + schema: + discriminator: + mapping: + task_run.progress_msg.exec_status: '#/components/schemas/GatewayDef_4f3b7ab2bb4e1911_TaskRunProgressMsgEvent' + task_run.progress_msg.plan: '#/components/schemas/GatewayDef_4f3b7ab2bb4e1911_TaskRunProgressMsgEvent' + task_run.progress_msg.tool: '#/components/schemas/GatewayDef_4f3b7ab2bb4e1911_TaskRunProgressMsgEvent' + task_run.progress_stats: '#/components/schemas/GatewayDef_c0fe0f39c374a83b_TaskRunProgressStatsEvent' + task_run.state: '#/components/schemas/GatewayDef_fd08b460e1d38459_TaskRunStateEvent' + propertyName: type + oneOf: + - $ref: '#/components/schemas/GatewayDef_fd08b460e1d38459_TaskRunStateEvent' + - $ref: '#/components/schemas/GatewayDef_4f3b7ab2bb4e1911_TaskRunProgressMsgEvent' + - $ref: '#/components/schemas/GatewayDef_c0fe0f39c374a83b_TaskRunProgressStatsEvent' + description: Server-sent event stream of run activity. + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Stream Agent Run Events + tags: + - Public API + /v2/agents/{agent_id}/runs/{run_id}/result: + get: + description: 'Fetch the output of a completed run. The `output` is `type: "text"` (a prose answer) or `type: "json"` + (structured data matching the output schema), plus `trust` metadata with per-claim citations for the answer. + + + While the run is still `queued` or `running` this endpoint returns `409`; if the run `failed` or was `cancelled` it + returns `422` with the run and error details.' + operationId: getAgentRunResult + parameters: + - in: path + name: agent_id + required: true + schema: + format: uuid + title: Agent Id + type: string + - in: path + name: run_id + required: true + schema: + title: Run Id + type: string + responses: + '200': + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/TaskRunResultPublicV2' + - $ref: '#/components/schemas/TaskRunFailedResultPublicV2' + title: Response Get Run Result Public V2 Api V2 Public Web Search Agents Agent Id Runs Run Id Result Get + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Get Agent Run Result + tags: + - Public API + /v2/batches: + get: + description: Retrieve a paginated list of batches for the authenticated account. + responses: + '200': + description: List of batches returned successfully. + security: + - BearerAuth: [] + summary: List batches + tags: + - Batches + operationId: listBatches + /v2/batches/{batch_id}: + get: + description: Retrieve the details of a batch including all its tasks and completion status. + parameters: + - description: The unique identifier of the batch. + in: path + name: batch_id + required: true + schema: + description: The unique identifier of the batch. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchGetResponse' + description: Batch found and returned successfully. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskErrorResponse' + description: Batch not found. + security: + - BearerAuth: [] + summary: Get batch details + tags: + - Batches + operationId: getBatch + /v2/batches/{batch_id}/progress: + get: + description: Retrieve lightweight progress information for a batch without fetching all task details. + parameters: + - description: The unique identifier of the batch. + in: path + name: batch_id + required: true + schema: + description: The unique identifier of the batch. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchProgressResponse' + description: Batch progress returned successfully. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskErrorResponse' + description: Batch not found. + security: + - BearerAuth: [] + summary: Get batch progress + tags: + - Batches + operationId: getBatchProgress + /v2/crawl: + get: + parameters: + - description: Filter crawls by their status. + in: query + name: status + schema: + default: all + description: Filter crawls by their status. + enum: + - queued + - running + - succeeded + - failed + - canceled + - all + examples: + - queued + type: string + - description: Cursor for pagination. + in: query + name: cursor + schema: + anyOf: + - type: string + - type: 'null' + default: null + description: Cursor for pagination. + - description: Number of crawls to return per page. + in: query + name: limit + schema: + default: 100 + description: Number of crawls to return per page. + examples: + - 10 + maximum: 9007199254740991 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CrawlByFiltersResponse' + description: Successful Response - List of Crawl Tasks + security: + - BearerAuth: [] + summary: Crawl by Filter + tags: + - Crawl + operationId: listCrawls + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CrawlPayload' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CrawlApiResponse' + description: Successful Response - Crawl Task Created + security: + - BearerAuth: [] + summary: Create crawl task + tags: + - Crawl + operationId: createCrawl + /v2/crawl/{id}: + delete: + parameters: + - description: The unique identifier of the crawl task. + in: path + name: id + required: true + schema: + description: The unique identifier of the crawl task. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + additionalProperties: false + properties: + status: + enum: + - canceled + type: string + required: + - status + type: object + description: Successful Response + '404': + description: Crawl Not Found + security: + - BearerAuth: [] + summary: Cancel Crawl + tags: + - Crawl + operationId: deleteCrawl + get: + parameters: + - description: The unique identifier of the crawl task. + in: path + name: id + required: true + schema: + description: The unique identifier of the crawl task. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CrawlApiResponse' + description: Successful Response + security: + - BearerAuth: [] + summary: Get crawl data + tags: + - Crawl + operationId: getCrawl + /v2/domain-knowledge/driver: + get: + description: Resolves the suggested driver for a given URL or agent name. Exactly one of `url` or `agent` must be provided. + parameters: + - description: Target domain to resolve driver for (e.g. amazon.com). + in: query + name: url + schema: + description: Target domain to resolve driver for (e.g. amazon.com). + examples: + - amazon.com + type: string + - description: Agent name to resolve driver for (e.g. nimble-ecommerce). + in: query + name: agent + schema: + description: Agent name to resolve driver for (e.g. nimble-ecommerce). + examples: + - nimble-ecommerce + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DriverResolutionResponse' + description: Driver resolution result + '400': + content: + application/json: + schema: + additionalProperties: false + properties: + msg: + type: string + status: + const: failed + type: string + required: + - status + - msg + type: object + description: Bad Request — both or neither url/agent provided + '404': + content: + application/json: + schema: + additionalProperties: false + properties: + msg: + type: string + status: + const: failed + type: string + required: + - status + - msg + type: object + description: Agent not found + security: + - BearerAuth: [] + summary: Get Driver + tags: + - Domain Knowledge + operationId: getDomainKnowledgeDriver + /v2/extract: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractPayload' + responses: + '200': + content: + application/json: + schema: + additionalProperties: false + properties: + data: + additionalProperties: false + properties: + browser_actions: + additionalProperties: false + description: Browser actions execution results. Present only when browser_actions were specified in + the request. + properties: + results: + items: + additionalProperties: false + properties: + duration: + minimum: 0 + type: number + error: + type: string + name: + enum: + - goto + - wait + - wait_for_element + - wait_for_navigation + - click + - fill + - press + - scroll + - auto_scroll + - screenshot + - get_cookies + - eval + - fetch + type: string + result: {} + status: + enum: + - no-run + - in-progress + - done + - error + - skipped + type: string + required: + - name + - status + - duration + type: object + readOnly: true + type: array + success: + type: boolean + total_duration: + minimum: 0 + type: number + required: + - success + - results + - total_duration + type: object + cookies: + description: The cookies collected from browser actions during the task. + items: {} + type: array + eval: + description: The evaluation results from browser actions during the task. + items: {} + type: array + fetch: + description: The http requests from browser actions made during the task. + items: {} + type: array + headers: + additionalProperties: + type: string + description: The headers received during the task. + propertyNames: + type: string + type: object + html: + description: The HTML content of the page. + type: string + links: + description: List of all unique URLs found on the page. + items: + type: string + type: array + markdown: + description: The Markdown version of the HTML content. + type: string + network_capture: + description: The network capture data collected during the task. + items: + additionalProperties: false + properties: + errorMessage: + type: string + filter: + additionalProperties: false + properties: + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + resource_type: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + - items: + $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + minItems: 1 + type: array + status_code: + anyOf: + - maximum: 599 + minimum: 100 + type: number + - items: + maximum: 599 + minimum: 100 + type: number + minItems: 1 + type: array + url: + additionalProperties: false + properties: + type: + default: exact + enum: + - exact + - contains + type: string + value: + type: string + required: + - type + - value + type: object + validation: + default: false + type: boolean + wait_for_requests_count: + default: 0 + minimum: 0 + type: number + wait_for_requests_count_timeout: + exclusiveMinimum: 0 + maximum: 300000 + type: number + required: + - validation + - wait_for_requests_count + type: object + results: + items: + additionalProperties: false + properties: + request: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + method: + type: string + resource_type: + description: Resource type for network capture filtering + enum: + - document + - stylesheet + - image + - media + - font + - script + - texttrack + - xhr + - fetch + - prefetch + - eventsource + - websocket + - manifest + - signedexchange + - ping + - cspviolationreport + - preflight + - other + - fedcm + examples: + - document + - script + - xhr + - fetch + type: string + url: + type: string + required: + - resource_type + - method + - url + - headers + type: object + response: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + serialization: + enum: + - none + - base64 + type: string + status: + type: number + status_text: + type: string + required: + - status + - status_text + - headers + - serialization + - body + type: object + required: + - request + - response + type: object + type: array + required: + - filter + - results + type: object + readOnly: true + type: array + pages_html: + description: Individual HTML content of each pagination page, before merging. + items: + type: string + type: array + parsing: + anyOf: + - $ref: '#/components/schemas/ParsingSuccessResult' + - $ref: '#/components/schemas/ParsingErrorResult' + - additionalProperties: {} + propertyNames: + type: string + type: object + description: The parsing results extracted from the HTML & network content. + redirects: + description: The list of redirects that occurred during the task. + items: + additionalProperties: false + properties: + status_code: + maximum: 599 + minimum: 100 + type: number + url: + type: string + required: + - status_code + - url + type: object + type: array + screenshots: + description: Screenshots taken during the task, from browser actions, or the screenshot format. + items: {} + type: array + type: object + debug: + additionalProperties: false + properties: + performance_metrics: + additionalProperties: + type: number + description: Performance metrics collected during the task. + propertyNames: + type: string + type: object + proxy_total_bytes_usage: + description: Total bytes used by the proxy during the task. + minimum: 0 + type: number + transformed_output: + description: The transformed output after applying any transformations. + userbrowser: + description: The userbrowser instance using during the task. + type: object + metadata: + additionalProperties: false + properties: + agent: + description: The name of the agent used for the query. + type: string + driver: + description: The driver used for the task. + type: string + localization_id: + description: The localization identifier for the query. + type: string + query_duration: + description: The duration in milliseconds of the query processing. + type: number + query_time: + description: The time when the query was received. + type: string + response_parameters: + description: Additional response parameters. + tag: + description: A tag associated with the query. + type: string + type: object + pagination: + anyOf: + - additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + - items: + additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + type: array + description: Pagination information if applicable. + status: + description: The status of the task. + enum: + - success + - skipped + - fatal + - error + - postponed + - ignored + - rejected + - blocked + type: string + status_code: + description: The HTTP status code of the task. + type: number + task_id: + description: Unique identifier for the task. + type: string + url: + description: The final URL. + type: string + warnings: + description: List of warnings generated during the task. + items: + type: string + type: array + required: + - task_id + - url + - status + - data + - metadata + type: object + description: Successful Response + security: + - BearerAuth: [] + summary: Extract + tags: + - Extract + operationId: extract + /v2/extract/async: + post: + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ExtractPayload' + - properties: + callback_url: + description: URL to call back when async operation completes + examples: + - https://example.com/webhook/callback + type: string + storage_compress: + description: Whether to compress stored data + examples: + - true + type: boolean + storage_object_name: + description: Custom name for the stored object + examples: + - result-2024-01-15.json + type: string + storage_type: + description: Type of storage to use for results + examples: + - s3 + type: string + storage_url: + description: URL for storage location + examples: + - s3://bucket-name/path/to/object + type: string + type: object + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractAsyncResponse' + description: Task created successfully + security: + - BearerAuth: [] + summary: Extract Async Endpoint + tags: + - Extract + operationId: submitAsyncExtract + /v2/extract/batch: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractBatchPayload' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractBatchResponse' + description: Batch created successfully + security: + - BearerAuth: [] + summary: Extract Batch Endpoint + tags: + - Extract + operationId: submitBatchExtract + /v2/extract/templates: + get: + operationId: listExtractTemplates + parameters: + - description: 'Which templates to list: the account''s own, the shared public catalog, or both.' + in: query + name: privacy + required: false + schema: + $ref: '#/components/schemas/PrivacyFilterPublicV2' + default: all + description: 'Which templates to list: the account''s own, the shared public catalog, or both.' + - description: Case-insensitive keyword match on name, display name, description, domain, and tags. + in: query + name: search + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Case-insensitive keyword match on name, display name, description, domain, and tags. + title: Search + - in: query + name: offset + required: false + schema: + default: 0 + minimum: 0 + title: Offset + type: integer + - in: query + name: limit + required: false + schema: + default: 100 + maximum: 200 + minimum: 1 + title: Limit + type: integer + requestBody: + content: + application/json: + schema: + anyOf: + - contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/ExtractTemplateFilterPublicV2' + type: string + - type: 'null' + title: Filter + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse_ExtractTemplateResponsePublicV2_' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: List Extract Templates Public V2 + tags: + - Extract Templates (public) + /v2/extract/templates/async: + post: + description: Execute Extraction Template Async Endpoint + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ExtractionTemplateBody' + - properties: + callback_url: + description: URL to call back when async operation completes + examples: + - https://example.com/webhook/callback + type: string + storage_compress: + description: Whether to compress stored data + examples: + - true + type: boolean + storage_object_name: + description: Custom name for the stored object + examples: + - result-2024-01-15.json + type: string + storage_type: + description: Type of storage to use for results + examples: + - s3 + type: string + storage_url: + description: URL for storage location + examples: + - s3://bucket-name/path/to/object + type: string + type: object + responses: + '200': + content: + application/json: + schema: + additionalProperties: false + properties: + status: + const: success + type: string + task: + additionalProperties: {} + properties: {} + type: object + required: + - status + - task + type: object + description: Async Task Created + security: + - BearerAuth: [] + tags: + - Extraction Templates + operationId: runExtractTemplateAsync + /v2/extract/templates/batch: + post: + description: Execute Extraction Template Batch Endpoint + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractionTemplateBatchBody' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractBatchResponse' + description: Batch Created + security: + - BearerAuth: [] + tags: + - Extraction Templates + operationId: runExtractTemplateBatch + /v2/extract/templates/generations: + post: + operationId: createExtractTemplateGeneration + requestBody: + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/CreateExtractTemplateGenerationRequestPublicV2' + - $ref: '#/components/schemas/CreateExtractTemplateRefinementRequestPublicV2' + title: Request + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractTemplateGenerationResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Create Extract Template Generation Public V2 + tags: + - Extract Templates (public) + /v2/extract/templates/generations/{generation_id}: + get: + operationId: getExtractTemplateGeneration + parameters: + - in: path + name: generation_id + required: true + schema: + format: uuid + title: Generation Id + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractTemplateGenerationResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Get Extract Template Generation Public V2 + tags: + - Extract Templates (public) + /v2/extract/templates/run: + post: + description: Execute Extraction Template Realtime Endpoint + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractionTemplateBody' + responses: + '200': + content: + application/json: + schema: + additionalProperties: false + properties: + data: + additionalProperties: false + properties: + browser_actions: + additionalProperties: false + description: Browser actions execution results. Present only when browser_actions were specified in + the request. + properties: + results: + items: + additionalProperties: false + properties: + duration: + minimum: 0 + type: number + error: + type: string + name: + enum: + - goto + - wait + - wait_for_element + - wait_for_navigation + - click + - fill + - press + - scroll + - auto_scroll + - screenshot + - get_cookies + - eval + - fetch + type: string + result: {} + status: + enum: + - no-run + - in-progress + - done + - error + - skipped + type: string + required: + - name + - status + - duration + type: object + readOnly: true + type: array + success: + type: boolean + total_duration: + minimum: 0 + type: number + required: + - success + - results + - total_duration + type: object + cookies: + description: The cookies collected from browser actions during the task. + items: {} + type: array + eval: + description: The evaluation results from browser actions during the task. + items: {} + type: array + fetch: + description: The http requests from browser actions made during the task. + items: {} + type: array + headers: + additionalProperties: + type: string + description: The headers received during the task. + propertyNames: + type: string + type: object + html: + description: The HTML content of the page. + type: string + links: + description: List of all unique URLs found on the page. + items: + type: string + type: array + markdown: + description: The Markdown version of the HTML content. + type: string + network_capture: + description: The network capture data collected during the task. + items: + additionalProperties: false + properties: + errorMessage: + type: string + filter: + additionalProperties: false + properties: + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + resource_type: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + - items: + $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + minItems: 1 + type: array + status_code: + anyOf: + - maximum: 599 + minimum: 100 + type: number + - items: + maximum: 599 + minimum: 100 + type: number + minItems: 1 + type: array + url: + additionalProperties: false + properties: + type: + default: exact + enum: + - exact + - contains + type: string + value: + type: string + required: + - type + - value + type: object + validation: + default: false + type: boolean + wait_for_requests_count: + default: 0 + minimum: 0 + type: number + wait_for_requests_count_timeout: + exclusiveMinimum: 0 + maximum: 300000 + type: number + required: + - validation + - wait_for_requests_count + type: object + results: + items: + additionalProperties: false + properties: + request: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + method: + type: string + resource_type: + description: Resource type for network capture filtering + enum: + - document + - stylesheet + - image + - media + - font + - script + - texttrack + - xhr + - fetch + - prefetch + - eventsource + - websocket + - manifest + - signedexchange + - ping + - cspviolationreport + - preflight + - other + - fedcm + examples: + - document + - script + - xhr + - fetch + type: string + url: + type: string + required: + - resource_type + - method + - url + - headers + type: object + response: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + serialization: + enum: + - none + - base64 + type: string + status: + type: number + status_text: + type: string + required: + - status + - status_text + - headers + - serialization + - body + type: object + required: + - request + - response + type: object + type: array + required: + - filter + - results + type: object + readOnly: true + type: array + pages_html: + description: Individual HTML content of each pagination page, before merging. + items: + type: string + type: array + parsing: + anyOf: + - $ref: '#/components/schemas/ParsingSuccessResult' + - $ref: '#/components/schemas/ParsingErrorResult' + - additionalProperties: {} + propertyNames: + type: string + type: object + description: The parsing results extracted from the HTML & network content. + redirects: + description: The list of redirects that occurred during the task. + items: + additionalProperties: false + properties: + status_code: + maximum: 599 + minimum: 100 + type: number + url: + type: string + required: + - status_code + - url + type: object + type: array + screenshots: + description: Screenshots taken during the task, from browser actions, or the screenshot format. + items: {} + type: array + type: object + debug: + additionalProperties: false + properties: + performance_metrics: + additionalProperties: + type: number + description: Performance metrics collected during the task. + propertyNames: + type: string + type: object + proxy_total_bytes_usage: + description: Total bytes used by the proxy during the task. + minimum: 0 + type: number + transformed_output: + description: The transformed output after applying any transformations. + userbrowser: + description: The userbrowser instance using during the task. + type: object + metadata: + additionalProperties: false + properties: + agent: + description: The name of the agent used for the query. + type: string + driver: + description: The driver used for the task. + type: string + localization_id: + description: The localization identifier for the query. + type: string + query_duration: + description: The duration in milliseconds of the query processing. + type: number + query_time: + description: The time when the query was received. + type: string + response_parameters: + description: Additional response parameters. + tag: + description: A tag associated with the query. + type: string + type: object + pagination: + anyOf: + - additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + - items: + additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + type: array + description: Pagination information if applicable. + status: + description: The status of the task. + enum: + - success + - skipped + - fatal + - error + - postponed + - ignored + - rejected + - blocked + type: string + status_code: + description: The HTTP status code of the task. + type: number + task_id: + description: Unique identifier for the task. + type: string + url: + description: The final URL. + type: string + warnings: + description: List of warnings generated during the task. + items: + type: string + type: array + required: + - task_id + - url + - status + - data + - metadata + type: object + description: Successful Response + '404': + content: + application/json: + schema: + additionalProperties: {} + properties: + msg: + examples: + - Template not found + type: string + status: + const: failed + type: string + required: + - status + - msg + type: object + description: Template Not Found + security: + - BearerAuth: [] + tags: + - Extraction Templates + operationId: runExtractTemplate + /v2/extract/templates/{extract_template_name}: + delete: + operationId: deleteExtractTemplate + parameters: + - in: path + name: extract_template_name + required: true + schema: + title: Extract Template Name + type: string + responses: + '204': + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Delete Extract Template Public V2 + tags: + - Extract Templates (public) + get: + operationId: getExtractTemplate + parameters: + - in: path + name: extract_template_name + required: true + schema: + title: Extract Template Name + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractTemplateResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Get Extract Template Public V2 + tags: + - Extract Templates (public) + patch: + operationId: updateExtractTemplate + parameters: + - in: path + name: extract_template_name + required: true + schema: + title: Extract Template Name + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JsonPatchDocument' + application/json-patch+json: + schema: + $ref: '#/components/schemas/JsonPatchDocument' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractTemplateResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Patch Extract Template Public V2 + tags: + - Extract Templates (public) + /v2/extract/templates/{extract_template_name}/versions: + get: + operationId: listExtractTemplateVersions + parameters: + - in: path + name: extract_template_name + required: true + schema: + title: Extract Template Name + type: string + - in: query + name: offset + required: false + schema: + default: 0 + minimum: 0 + title: Offset + type: integer + - in: query + name: limit + required: false + schema: + default: 100 + maximum: 200 + minimum: 1 + title: Limit + type: integer + requestBody: + content: + application/json: + schema: + anyOf: + - contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/EmptyListFilter' + type: string + - type: 'null' + title: Filter + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse_ExtractTemplateVersionResponsePublicV2_' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: List Extract Template Versions Public V2 + tags: + - Extract Templates (public) + /v2/extract/templates/{extract_template_name}/versions/{version_id}: + get: + operationId: getExtractTemplateVersion + parameters: + - in: path + name: extract_template_name + required: true + schema: + title: Extract Template Name + type: string + - in: path + name: version_id + required: true + schema: + format: uuid + title: Version Id + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ExtractTemplateVersionResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + summary: Get Extract Template Version Public V2 + tags: + - Extract Templates (public) + /v2/fast-serp: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SerpPayload' + responses: + '200': + content: + application/json: + schema: + additionalProperties: false + properties: + data: + additionalProperties: false + properties: + browser_actions: + additionalProperties: false + description: Browser actions execution results. Present only when browser_actions were specified in + the request. + properties: + results: + items: + additionalProperties: false + properties: + duration: + minimum: 0 + type: number + error: + type: string + name: + enum: + - goto + - wait + - wait_for_element + - wait_for_navigation + - click + - fill + - press + - scroll + - auto_scroll + - screenshot + - get_cookies + - eval + - fetch + type: string + result: {} + status: + enum: + - no-run + - in-progress + - done + - error + - skipped + type: string + required: + - name + - status + - duration + type: object + readOnly: true + type: array + success: + type: boolean + total_duration: + minimum: 0 + type: number + required: + - success + - results + - total_duration + type: object + cookies: + description: The cookies collected from browser actions during the task. + items: {} + type: array + eval: + description: The evaluation results from browser actions during the task. + items: {} + type: array + fetch: + description: The http requests from browser actions made during the task. + items: {} + type: array + headers: + additionalProperties: + type: string + description: The headers received during the task. + propertyNames: + type: string + type: object + html: + description: The HTML content of the page. + type: string + links: + description: List of all unique URLs found on the page. + items: + type: string + type: array + markdown: + description: The Markdown version of the HTML content. + type: string + network_capture: + description: The network capture data collected during the task. + items: + additionalProperties: false + properties: + errorMessage: + type: string + filter: + additionalProperties: false + properties: + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + resource_type: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + - items: + $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + minItems: 1 + type: array + status_code: + anyOf: + - maximum: 599 + minimum: 100 + type: number + - items: + maximum: 599 + minimum: 100 + type: number + minItems: 1 + type: array + url: + additionalProperties: false + properties: + type: + default: exact + enum: + - exact + - contains + type: string + value: + type: string + required: + - type + - value + type: object + validation: + default: false + type: boolean + wait_for_requests_count: + default: 0 + minimum: 0 + type: number + wait_for_requests_count_timeout: + exclusiveMinimum: 0 + maximum: 300000 + type: number + required: + - validation + - wait_for_requests_count + type: object + results: + items: + additionalProperties: false + properties: + request: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + method: + type: string + resource_type: + description: Resource type for network capture filtering + enum: + - document + - stylesheet + - image + - media + - font + - script + - texttrack + - xhr + - fetch + - prefetch + - eventsource + - websocket + - manifest + - signedexchange + - ping + - cspviolationreport + - preflight + - other + - fedcm + examples: + - document + - script + - xhr + - fetch + type: string + url: + type: string + required: + - resource_type + - method + - url + - headers + type: object + response: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + serialization: + enum: + - none + - base64 + type: string + status: + type: number + status_text: + type: string + required: + - status + - status_text + - headers + - serialization + - body + type: object + required: + - request + - response + type: object + type: array + required: + - filter + - results + type: object + readOnly: true + type: array + pages_html: + description: Individual HTML content of each pagination page, before merging. + items: + type: string + type: array + parsing: + anyOf: + - $ref: '#/components/schemas/ParsingSuccessResult' + - $ref: '#/components/schemas/ParsingErrorResult' + - additionalProperties: {} + propertyNames: + type: string + type: object + description: The parsing results extracted from the HTML & network content. + redirects: + description: The list of redirects that occurred during the task. + items: + additionalProperties: false + properties: + status_code: + maximum: 599 + minimum: 100 + type: number + url: + type: string + required: + - status_code + - url + type: object + type: array + screenshots: + description: Screenshots taken during the task, from browser actions, or the screenshot format. + items: {} + type: array + type: object + debug: + additionalProperties: false + properties: + performance_metrics: + additionalProperties: + type: number + description: Performance metrics collected during the task. + propertyNames: + type: string + type: object + proxy_total_bytes_usage: + description: Total bytes used by the proxy during the task. + minimum: 0 + type: number + transformed_output: + description: The transformed output after applying any transformations. + userbrowser: + description: The userbrowser instance using during the task. + type: object + metadata: + additionalProperties: false + properties: + agent: + description: The name of the agent used for the query. + type: string + driver: + description: The driver used for the task. + type: string + localization_id: + description: The localization identifier for the query. + type: string + query_duration: + description: The duration in milliseconds of the query processing. + type: number + query_time: + description: The time when the query was received. + type: string + response_parameters: + description: Additional response parameters. + tag: + description: A tag associated with the query. + type: string + type: object + pagination: + anyOf: + - additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + - items: + additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + type: array + description: Pagination information if applicable. + status: + description: The status of the task. + enum: + - success + - skipped + - fatal + - error + - postponed + - ignored + - rejected + - blocked + type: string + status_code: + description: The HTTP status code of the task. + type: number + task_id: + description: Unique identifier for the task. + type: string + url: + description: The final URL. + type: string + warnings: + description: List of warnings generated during the task. + items: + type: string + type: array + required: + - task_id + - url + - status + - data + - metadata + type: object + description: Successful Response + security: + - BearerAuth: [] + summary: Fast SERP + tags: + - SERP + operationId: fastSerp + /v2/jobs: + get: + operationId: listJobs + parameters: + - in: query + name: offset + required: false + schema: + default: 0 + minimum: 0 + title: Offset + type: integer + - in: query + name: limit + required: false + schema: + default: 100 + maximum: 200 + minimum: 1 + title: Limit + type: integer + requestBody: + content: + application/json: + schema: + anyOf: + - contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/JobListFilterPublicV2' + type: string + - type: 'null' + title: Filter + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse_JobPublicV2_' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: List Jobs Public V2 + tags: + - Jobs (public v2) + post: + operationId: createJob + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateJobRequestPublicV2' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/JobPublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Create Job Public V2 + tags: + - Jobs (public v2) + /v2/jobs/runs/{run_id}: + get: + operationId: getJobRun + parameters: + - in: path + name: run_id + required: true + schema: + title: Run Id + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/JobRunDetailPublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Get Run Public V2 + tags: + - Jobs (public v2) + /v2/jobs/runs/{run_id}/artifacts: + get: + operationId: listJobRunArtifacts + parameters: + - in: path + name: run_id + required: true + schema: + title: Run Id + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ArtifactListPublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: List Run Artifacts Public V2 + tags: + - Jobs (public v2) + /v2/jobs/runs/{run_id}/artifacts/{artifact_id}: + get: + operationId: getJobRunArtifact + parameters: + - in: path + name: run_id + required: true + schema: + title: Run Id + type: string + - in: path + name: artifact_id + required: true + schema: + title: Artifact Id + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ArtifactPublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Get Run Artifact Public V2 + tags: + - Jobs (public v2) + /v2/jobs/runs/{run_id}/artifacts/{artifact_id}/download-url: + get: + operationId: getJobRunArtifactDownloadUrl + parameters: + - in: path + name: run_id + required: true + schema: + title: Run Id + type: string + - in: path + name: artifact_id + required: true + schema: + title: Artifact Id + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ArtifactDownloadUrlPublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Get Run Artifact Download Url Public V2 + tags: + - Jobs (public v2) + /v2/jobs/runs/{run_id}/artifacts/{artifact_id}/preview: + get: + operationId: previewJobRunArtifact + parameters: + - in: path + name: run_id + required: true + schema: + title: Run Id + type: string + - in: path + name: artifact_id + required: true + schema: + title: Artifact Id + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ArtifactPreviewPublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Preview Run Artifact Public V2 + tags: + - Jobs (public v2) + /v2/jobs/runs/{run_id}/cancel: + post: + operationId: cancelJobRun + parameters: + - in: path + name: run_id + required: true + schema: + title: Run Id + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/JobRunCancelResponsePublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Cancel Run Public V2 + tags: + - Jobs (public v2) + /v2/jobs/{job_id}: + delete: + operationId: deleteJob + parameters: + - in: path + name: job_id + required: true + schema: + title: Job Id + type: string + responses: + '204': + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Delete Job Public V2 + tags: + - Jobs (public v2) + get: + operationId: getJob + parameters: + - in: path + name: job_id + required: true + schema: + title: Job Id + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/JobPublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Get Job Public V2 + tags: + - Jobs (public v2) + patch: + operationId: updateJob + parameters: + - in: path + name: job_id + required: true + schema: + title: Job Id + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateJobRequestPublicV2' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/JobPublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Update Job Public V2 + tags: + - Jobs (public v2) + /v2/jobs/{job_id}/runs: + get: + operationId: listJobRuns + parameters: + - in: path + name: job_id + required: true + schema: + title: Job Id + type: string + - in: query + name: offset + required: false + schema: + default: 0 + minimum: 0 + title: Offset + type: integer + - in: query + name: limit + required: false + schema: + default: 100 + maximum: 200 + minimum: 1 + title: Limit + type: integer + requestBody: + content: + application/json: + schema: + anyOf: + - contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/JobRunListFilterPublicV2' + type: string + - type: 'null' + title: Filter + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse_JobRunPublicV2_' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: List Job Runs Public V2 + tags: + - Jobs (public v2) + post: + operationId: triggerJobRun + parameters: + - in: path + name: job_id + required: true + schema: + title: Job Id + type: string + requestBody: + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/TriggerJobRunRequestPublicV2' + - type: 'null' + title: Body + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/JobRunPublicV2' + description: Successful Response + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Validation Error + security: + - HTTPBearer: [] + - APIKeyCookie: [] + summary: Trigger Job Run Public V2 + tags: + - Jobs (public v2) + /v2/map: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapPayload' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MapResponse' + description: Successful Response + security: + - BearerAuth: [] + summary: Create map task + tags: + - Map + operationId: mapUrls + /v2/media: + post: + description: Download media from a URL. Waits for the result before responding. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MediaPayload' + responses: + '200': + content: + application/json: + schema: + additionalProperties: false + properties: + data: + additionalProperties: false + properties: + browser_actions: + additionalProperties: false + description: Browser actions execution results. Present only when browser_actions were specified in + the request. + properties: + results: + items: + additionalProperties: false + properties: + duration: + minimum: 0 + type: number + error: + type: string + name: + enum: + - goto + - wait + - wait_for_element + - wait_for_navigation + - click + - fill + - press + - scroll + - auto_scroll + - screenshot + - get_cookies + - eval + - fetch + type: string + result: {} + status: + enum: + - no-run + - in-progress + - done + - error + - skipped + type: string + required: + - name + - status + - duration + type: object + readOnly: true + type: array + success: + type: boolean + total_duration: + minimum: 0 + type: number + required: + - success + - results + - total_duration + type: object + cookies: + description: The cookies collected from browser actions during the task. + items: {} + type: array + eval: + description: The evaluation results from browser actions during the task. + items: {} + type: array + fetch: + description: The http requests from browser actions made during the task. + items: {} + type: array + headers: + additionalProperties: + type: string + description: The headers received during the task. + propertyNames: + type: string + type: object + html: + description: The HTML content of the page. + type: string + links: + description: List of all unique URLs found on the page. + items: + type: string + type: array + markdown: + description: The Markdown version of the HTML content. + type: string + network_capture: + description: The network capture data collected during the task. + items: + additionalProperties: false + properties: + errorMessage: + type: string + filter: + additionalProperties: false + properties: + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + resource_type: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + - items: + $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + minItems: 1 + type: array + status_code: + anyOf: + - maximum: 599 + minimum: 100 + type: number + - items: + maximum: 599 + minimum: 100 + type: number + minItems: 1 + type: array + url: + additionalProperties: false + properties: + type: + default: exact + enum: + - exact + - contains + type: string + value: + type: string + required: + - type + - value + type: object + validation: + default: false + type: boolean + wait_for_requests_count: + default: 0 + minimum: 0 + type: number + wait_for_requests_count_timeout: + exclusiveMinimum: 0 + maximum: 300000 + type: number + required: + - validation + - wait_for_requests_count + type: object + results: + items: + additionalProperties: false + properties: + request: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + method: + type: string + resource_type: + description: Resource type for network capture filtering + enum: + - document + - stylesheet + - image + - media + - font + - script + - texttrack + - xhr + - fetch + - prefetch + - eventsource + - websocket + - manifest + - signedexchange + - ping + - cspviolationreport + - preflight + - other + - fedcm + examples: + - document + - script + - xhr + - fetch + type: string + url: + type: string + required: + - resource_type + - method + - url + - headers + type: object + response: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + serialization: + enum: + - none + - base64 + type: string + status: + type: number + status_text: + type: string + required: + - status + - status_text + - headers + - serialization + - body + type: object + required: + - request + - response + type: object + type: array + required: + - filter + - results + type: object + readOnly: true + type: array + pages_html: + description: Individual HTML content of each pagination page, before merging. + items: + type: string + type: array + parsing: + anyOf: + - $ref: '#/components/schemas/ParsingSuccessResult' + - $ref: '#/components/schemas/ParsingErrorResult' + - additionalProperties: {} + propertyNames: + type: string + type: object + description: The parsing results extracted from the HTML & network content. + redirects: + description: The list of redirects that occurred during the task. + items: + additionalProperties: false + properties: + status_code: + maximum: 599 + minimum: 100 + type: number + url: + type: string + required: + - status_code + - url + type: object + type: array + screenshots: + description: Screenshots taken during the task, from browser actions, or the screenshot format. + items: {} + type: array + type: object + debug: + additionalProperties: false + properties: + performance_metrics: + additionalProperties: + type: number + description: Performance metrics collected during the task. + propertyNames: + type: string + type: object + proxy_total_bytes_usage: + description: Total bytes used by the proxy during the task. + minimum: 0 + type: number + transformed_output: + description: The transformed output after applying any transformations. + userbrowser: + description: The userbrowser instance using during the task. + type: object + metadata: + additionalProperties: false + properties: + agent: + description: The name of the agent used for the query. + type: string + driver: + description: The driver used for the task. + type: string + localization_id: + description: The localization identifier for the query. + type: string + query_duration: + description: The duration in milliseconds of the query processing. + type: number + query_time: + description: The time when the query was received. + type: string + response_parameters: + description: Additional response parameters. + tag: + description: A tag associated with the query. + type: string + type: object + pagination: + anyOf: + - additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + - items: + additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + type: array + description: Pagination information if applicable. + status: + description: The status of the task. + enum: + - success + - skipped + - fatal + - error + - postponed + - ignored + - rejected + - blocked + type: string + status_code: + description: The HTTP status code of the task. + type: number + task_id: + description: Unique identifier for the task. + type: string + url: + description: The final URL. + type: string + warnings: + description: List of warnings generated during the task. + items: + type: string + type: array + required: + - task_id + - url + - status + - data + - metadata + type: object + description: Successful Response + security: + - BearerAuth: [] + summary: Download Media + tags: + - Media + operationId: captureMedia + /v2/media/async: + post: + description: Download media from a URL asynchronously. Returns a task ID immediately. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MediaAsyncPayload' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MediaAsyncResponse' + description: Task created successfully + security: + - BearerAuth: [] + summary: Download Media Async + tags: + - Media + operationId: captureMediaAsync + /v2/search: + post: + operationId: performSearch + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SearchRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SearchResponse' + description: Successful Response + security: + - BearerAuth: [] + summary: Search + tags: + - Search + /v2/serp: + post: + parameters: + - description: Enable retention protection before JSON body parsing. + in: header + name: x-nimble-zdr + schema: + description: Enable retention protection before JSON body parsing. + enum: + - 'true' + - 'false' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SerpPayload' + responses: + '200': + content: + application/json: + schema: + additionalProperties: false + properties: + data: + additionalProperties: false + properties: + browser_actions: + additionalProperties: false + description: Browser actions execution results. Present only when browser_actions were specified in + the request. + properties: + results: + items: + additionalProperties: false + properties: + duration: + minimum: 0 + type: number + error: + type: string + name: + enum: + - goto + - wait + - wait_for_element + - wait_for_navigation + - click + - fill + - press + - scroll + - auto_scroll + - screenshot + - get_cookies + - eval + - fetch + type: string + result: {} + status: + enum: + - no-run + - in-progress + - done + - error + - skipped + type: string + required: + - name + - status + - duration + type: object + readOnly: true + type: array + success: + type: boolean + total_duration: + minimum: 0 + type: number + required: + - success + - results + - total_duration + type: object + cookies: + description: The cookies collected from browser actions during the task. + items: {} + type: array + eval: + description: The evaluation results from browser actions during the task. + items: {} + type: array + fetch: + description: The http requests from browser actions made during the task. + items: {} + type: array + headers: + additionalProperties: + type: string + description: The headers received during the task. + propertyNames: + type: string + type: object + html: + description: The HTML content of the page. + type: string + links: + description: List of all unique URLs found on the page. + items: + type: string + type: array + markdown: + description: The Markdown version of the HTML content. + type: string + network_capture: + description: The network capture data collected during the task. + items: + additionalProperties: false + properties: + errorMessage: + type: string + filter: + additionalProperties: false + properties: + method: + enum: + - GET + - HEAD + - POST + - PUT + - DELETE + - CONNECT + - OPTIONS + - TRACE + - PATCH + type: string + resource_type: + anyOf: + - $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + - items: + $ref: '#/components/schemas/SdkStringVariant7a06ddd6b0fd' + minItems: 1 + type: array + status_code: + anyOf: + - maximum: 599 + minimum: 100 + type: number + - items: + maximum: 599 + minimum: 100 + type: number + minItems: 1 + type: array + url: + additionalProperties: false + properties: + type: + default: exact + enum: + - exact + - contains + type: string + value: + type: string + required: + - type + - value + type: object + validation: + default: false + type: boolean + wait_for_requests_count: + default: 0 + minimum: 0 + type: number + wait_for_requests_count_timeout: + exclusiveMinimum: 0 + maximum: 300000 + type: number + required: + - validation + - wait_for_requests_count + type: object + results: + items: + additionalProperties: false + properties: + request: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + method: + type: string + resource_type: + description: Resource type for network capture filtering + enum: + - document + - stylesheet + - image + - media + - font + - script + - texttrack + - xhr + - fetch + - prefetch + - eventsource + - websocket + - manifest + - signedexchange + - ping + - cspviolationreport + - preflight + - other + - fedcm + examples: + - document + - script + - xhr + - fetch + type: string + url: + type: string + required: + - resource_type + - method + - url + - headers + type: object + response: + additionalProperties: false + properties: + body: + type: string + headers: + additionalProperties: + type: string + propertyNames: + type: string + type: object + serialization: + enum: + - none + - base64 + type: string + status: + type: number + status_text: + type: string + required: + - status + - status_text + - headers + - serialization + - body + type: object + required: + - request + - response + type: object + type: array + required: + - filter + - results + type: object + readOnly: true + type: array + pages_html: + description: Individual HTML content of each pagination page, before merging. + items: + type: string + type: array + parsing: + anyOf: + - $ref: '#/components/schemas/ParsingSuccessResult' + - $ref: '#/components/schemas/ParsingErrorResult' + - additionalProperties: {} + propertyNames: + type: string + type: object + description: The parsing results extracted from the HTML & network content. + redirects: + description: The list of redirects that occurred during the task. + items: + additionalProperties: false + properties: + status_code: + maximum: 599 + minimum: 100 + type: number + url: + type: string + required: + - status_code + - url + type: object + type: array + screenshots: + description: Screenshots taken during the task, from browser actions, or the screenshot format. + items: {} + type: array + type: object + debug: + additionalProperties: false + properties: + performance_metrics: + additionalProperties: + type: number + description: Performance metrics collected during the task. + propertyNames: + type: string + type: object + proxy_total_bytes_usage: + description: Total bytes used by the proxy during the task. + minimum: 0 + type: number + transformed_output: + description: The transformed output after applying any transformations. + userbrowser: + description: The userbrowser instance using during the task. + type: object + metadata: + additionalProperties: false + properties: + agent: + description: The name of the agent used for the query. + type: string + driver: + description: The driver used for the task. + type: string + localization_id: + description: The localization identifier for the query. + type: string + query_duration: + description: The duration in milliseconds of the query processing. + type: number + query_time: + description: The time when the query was received. + type: string + response_parameters: + description: Additional response parameters. + tag: + description: A tag associated with the query. + type: string + type: object + pagination: + anyOf: + - additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + - items: + additionalProperties: false + properties: + next_page_params: + additionalProperties: {} + properties: {} + type: object + required: + - next_page_params + type: object + type: array + description: Pagination information if applicable. + status: + description: The status of the task. + enum: + - success + - skipped + - fatal + - error + - postponed + - ignored + - rejected + - blocked + type: string + status_code: + description: The HTTP status code of the task. + type: number + task_id: + description: Unique identifier for the task. + type: string + url: + description: The final URL. + type: string + warnings: + description: List of warnings generated during the task. + items: + type: string + type: array + required: + - task_id + - url + - status + - data + - metadata + type: object + description: Successful Response + security: + - BearerAuth: [] + summary: SERP + tags: + - SERP + operationId: serp + /v2/serp/async: + post: + parameters: + - description: Enable retention protection before JSON body parsing. + in: header + name: x-nimble-zdr + schema: + description: Enable retention protection before JSON body parsing. + enum: + - 'true' + - 'false' + type: string + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SerpPayload' + - properties: + callback_url: + description: URL to call back when async operation completes + examples: + - https://example.com/webhook/callback + type: string + storage_compress: + description: Whether to compress stored data + examples: + - true + type: boolean + storage_object_name: + description: Custom name for the stored object + examples: + - result-2024-01-15.json + type: string + storage_type: + description: Type of storage to use for results + examples: + - s3 + type: string + storage_url: + description: URL for storage location + examples: + - s3://bucket-name/path/to/object + type: string + type: object + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SerpAsyncResponse' + description: Task created successfully + security: + - BearerAuth: [] + summary: SERP Async Endpoint + tags: + - SERP + operationId: submitAsyncSerp + /v2/serp/batch: + post: + parameters: + - description: Enable retention protection before JSON body parsing. + in: header + name: x-nimble-zdr + schema: + description: Enable retention protection before JSON body parsing. + enum: + - 'true' + - 'false' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SerpBatchPayload' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SerpBatchResponse' + description: Batch created successfully + security: + - BearerAuth: [] + summary: SERP Batch Endpoint + tags: + - SERP + operationId: submitBatchSerp + /v2/tasks: + get: + description: Retrieve a paginated list of tasks for the authenticated account. + parameters: + - description: Cursor for pagination. Use the next_cursor from the previous response. + in: query + name: cursor + schema: + description: Cursor for pagination. Use the next_cursor from the previous response. + format: uuid + type: string + - description: Number of tasks to return per page. + in: query + name: limit + schema: + default: 100 + description: Number of tasks to return per page. + examples: + - 10 + maximum: 9007199254740991 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskListResponse' + description: List of tasks returned successfully. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskErrorResponse' + description: Invalid query parameters. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskErrorResponse' + description: Internal server error while retrieving tasks. + security: + - BearerAuth: [] + summary: List tasks + tags: + - Tasks + operationId: listTasks + /v2/tasks/{task_id}: + get: + description: Retrieve the details of a specific task by its ID. + parameters: + - description: The unique identifier of the task. + in: path + name: task_id + required: true + schema: + description: The unique identifier of the task. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskResponseSchema' + description: Task found and returned successfully. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskNotFoundErrorResponse' + description: Task not found. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskErrorResponse' + description: Internal server error while retrieving task. + security: + - BearerAuth: [] + summary: Get task details + tags: + - Tasks + operationId: getTask + /v2/tasks/{task_id}/results: + get: + description: Retrieve the results of a completed task. + parameters: + - description: The unique identifier of the task. + in: path + name: task_id + required: true + schema: + description: The unique identifier of the task. + examples: + - 123e4567-e89b-12d3-a456-426614174000 + type: string + responses: + '200': + content: + application/json: + schema: + additionalProperties: {} + description: The results of the completed task. + propertyNames: + type: string + type: object + description: Task results + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskPendingResponse' + description: Task is still pending and results are not yet available. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskErrorResponse' + description: Task not found or results are no longer available. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskFailedResponse' + description: Task failed or error retrieving results. + security: + - BearerAuth: [] + summary: Get task results + tags: + - Tasks + operationId: getTaskResults +servers: +- url: https://sdk.nimbleway.com diff --git a/candidate/generated/.github/workflows/python.yml b/candidate/generated/.github/workflows/python.yml new file mode 100644 index 0000000..01b4775 --- /dev/null +++ b/candidate/generated/.github/workflows/python.yml @@ -0,0 +1,34 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: nimble_client Python package + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Test with pytest + run: | + pytest --cov=nimble_client diff --git a/candidate/generated/.gitignore b/candidate/generated/.gitignore new file mode 100644 index 0000000..65b06b9 --- /dev/null +++ b/candidate/generated/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Ipython Notebook +.ipynb_checkpoints diff --git a/candidate/generated/.gitlab-ci.yml b/candidate/generated/.gitlab-ci.yml new file mode 100644 index 0000000..39ea979 --- /dev/null +++ b/candidate/generated/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=nimble_client + +pytest-3.11: + extends: .pytest + image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine +pytest-3.13: + extends: .pytest + image: python:3.13-alpine +pytest-3.14: + extends: .pytest + image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/candidate/generated/.openapi-generator-ignore b/candidate/generated/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/candidate/generated/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/candidate/generated/.openapi-generator/FILES b/candidate/generated/.openapi-generator/FILES new file mode 100644 index 0000000..3915dd7 --- /dev/null +++ b/candidate/generated/.openapi-generator/FILES @@ -0,0 +1,399 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +git_push.sh +nimble_client/__init__.py +nimble_client/api/__init__.py +nimble_client/api/batches_api.py +nimble_client/api/crawl_api.py +nimble_client/api/domain_knowledge_api.py +nimble_client/api/extract_api.py +nimble_client/api/extract_templates_public_api.py +nimble_client/api/extraction_templates_api.py +nimble_client/api/jobs_public_v2_api.py +nimble_client/api/map_api.py +nimble_client/api/media_api.py +nimble_client/api/public_api_api.py +nimble_client/api/search_api.py +nimble_client/api/serp_api.py +nimble_client/api/tasks_api.py +nimble_client/api_client.py +nimble_client/api_response.py +nimble_client/configuration.py +nimble_client/exceptions.py +nimble_client/models/__init__.py +nimble_client/models/agent_batch_body.py +nimble_client/models/agent_batch_body_inputs_inner.py +nimble_client/models/agent_batch_body_shared_inputs.py +nimble_client/models/agent_body.py +nimble_client/models/agent_sources_public_v1.py +nimble_client/models/agent_sources_public_v2.py +nimble_client/models/agent_sources_response_public_v1.py +nimble_client/models/agent_sources_response_public_v2.py +nimble_client/models/amount.py +nimble_client/models/answer_annotation_citation.py +nimble_client/models/answer_marker_citation.py +nimble_client/models/answer_request.py +nimble_client/models/answer_response.py +nimble_client/models/artifact_download_url_public_v1.py +nimble_client/models/artifact_download_url_public_v2.py +nimble_client/models/artifact_list_public_v1.py +nimble_client/models/artifact_list_public_v2.py +nimble_client/models/artifact_preview_public_v1.py +nimble_client/models/artifact_preview_public_v2.py +nimble_client/models/artifact_public_v1.py +nimble_client/models/artifact_public_v2.py +nimble_client/models/auto_scroll_action.py +nimble_client/models/auto_scroll_action_auto_scroll.py +nimble_client/models/auto_scroll_action_auto_scroll_one_of.py +nimble_client/models/auto_scroll_action_auto_scroll_one_of_required.py +nimble_client/models/auto_scroll_action_auto_scroll_one_of_skip.py +nimble_client/models/avg_duration_seconds.py +nimble_client/models/batch_get_response.py +nimble_client/models/batch_get_response_tasks_inner.py +nimble_client/models/batch_progress_response.py +nimble_client/models/browser_action.py +nimble_client/models/citation.py +nimble_client/models/citation_config.py +nimble_client/models/citations.py +nimble_client/models/click_action.py +nimble_client/models/click_action_click.py +nimble_client/models/click_action_click_one_of.py +nimble_client/models/company_entity.py +nimble_client/models/company_financials.py +nimble_client/models/company_headquarters.py +nimble_client/models/company_web_traffic.py +nimble_client/models/content.py +nimble_client/models/country_rank.py +nimble_client/models/crawl_api_response.py +nimble_client/models/crawl_api_response_completed_at.py +nimble_client/models/crawl_api_response_crawl_options.py +nimble_client/models/crawl_api_response_crawl_options_callback.py +nimble_client/models/crawl_api_response_crawl_options_callback_any_of.py +nimble_client/models/crawl_api_response_created_at.py +nimble_client/models/crawl_api_response_tasks_inner.py +nimble_client/models/crawl_by_filters_response.py +nimble_client/models/crawl_by_filters_response_pagination.py +nimble_client/models/crawl_payload.py +nimble_client/models/crawl_payload_callback.py +nimble_client/models/crawl_payload_callback_any_of.py +nimble_client/models/crawl_payload_callback_any_of_any_of.py +nimble_client/models/crawl_payload_extract_options.py +nimble_client/models/crawl_payload_extract_options_browser.py +nimble_client/models/crawl_payload_extract_options_browser_any_of.py +nimble_client/models/crawl_payload_extract_options_cookies.py +nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner.py +nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_expires.py +nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_max_age.py +nimble_client/models/crawl_payload_extract_options_file_parsing_options.py +nimble_client/models/crawl_payload_extract_options_headers_value.py +nimble_client/models/crawl_payload_extract_options_network_capture_inner.py +nimble_client/models/crawl_payload_extract_options_network_capture_inner_resource_type.py +nimble_client/models/crawl_payload_extract_options_network_capture_inner_url.py +nimble_client/models/crawl_payload_extract_options_parser.py +nimble_client/models/crawl_payload_extract_options_render.py +nimble_client/models/crawl_payload_extract_options_session.py +nimble_client/models/crawl_payload_extract_options_skill.py +nimble_client/models/create_extract_template_generation_request_public_v2.py +nimble_client/models/create_extract_template_metadata_public_v2.py +nimble_client/models/create_extract_template_refinement_request_public_v2.py +nimble_client/models/create_job_request_public_v1.py +nimble_client/models/create_job_request_public_v2.py +nimble_client/models/create_template_generation_request_public_v1.py +nimble_client/models/create_template_metadata_public_v1.py +nimble_client/models/create_template_refinement_request_public_v1.py +nimble_client/models/default.py +nimble_client/models/delete_crawl200_response.py +nimble_client/models/driver_resolution_response.py +nimble_client/models/duration.py +nimble_client/models/effort.py +nimble_client/models/eval_action.py +nimble_client/models/eval_action_eval.py +nimble_client/models/eval_action_eval_one_of.py +nimble_client/models/extract200_response.py +nimble_client/models/extract200_response_data.py +nimble_client/models/extract200_response_data_browser_actions.py +nimble_client/models/extract200_response_data_browser_actions_results_inner.py +nimble_client/models/extract200_response_data_network_capture_inner.py +nimble_client/models/extract200_response_data_network_capture_inner_filter.py +nimble_client/models/extract200_response_data_network_capture_inner_filter_resource_type.py +nimble_client/models/extract200_response_data_network_capture_inner_filter_status_code.py +nimble_client/models/extract200_response_data_network_capture_inner_filter_url.py +nimble_client/models/extract200_response_data_network_capture_inner_results_inner.py +nimble_client/models/extract200_response_data_network_capture_inner_results_inner_request.py +nimble_client/models/extract200_response_data_network_capture_inner_results_inner_response.py +nimble_client/models/extract200_response_data_parsing.py +nimble_client/models/extract200_response_data_redirects_inner.py +nimble_client/models/extract200_response_debug.py +nimble_client/models/extract200_response_metadata.py +nimble_client/models/extract200_response_pagination.py +nimble_client/models/extract200_response_pagination_any_of.py +nimble_client/models/extract200_response_pagination_any_of1_inner.py +nimble_client/models/extract_async_response.py +nimble_client/models/extract_async_response_task.py +nimble_client/models/extract_batch_payload.py +nimble_client/models/extract_batch_payload_inputs_inner.py +nimble_client/models/extract_batch_payload_inputs_inner_all_of_render.py +nimble_client/models/extract_batch_payload_shared_inputs.py +nimble_client/models/extract_batch_response.py +nimble_client/models/extract_batch_response_tasks_inner.py +nimble_client/models/extract_payload.py +nimble_client/models/extract_template_filter_public_v2.py +nimble_client/models/extract_template_generation_response_public_v2.py +nimble_client/models/extract_template_response_public_v2.py +nimble_client/models/extract_template_sample_public_v2.py +nimble_client/models/extract_template_version_metadata_public_v2.py +nimble_client/models/extract_template_version_response_public_v2.py +nimble_client/models/extraction_template_batch_body.py +nimble_client/models/extraction_template_batch_body_inputs_inner.py +nimble_client/models/extraction_template_batch_body_shared_inputs.py +nimble_client/models/extraction_template_body.py +nimble_client/models/fetch_action.py +nimble_client/models/fetch_action_fetch.py +nimble_client/models/fetch_action_fetch_one_of.py +nimble_client/models/fill_action.py +nimble_client/models/fill_options.py +nimble_client/models/fill_options_one_of.py +nimble_client/models/fill_options_one_of1.py +nimble_client/models/focus.py +nimble_client/models/full_template_public_v1.py +nimble_client/models/funding_round.py +nimble_client/models/funding_total.py +nimble_client/models/gateway_def033cecba0ba3d1d3_text_run_trust.py +nimble_client/models/gateway_def07f3b31eb3e5e2cb_trust_confidence.py +nimble_client/models/gateway_def07f55f9a59071b48_json_claim_trust.py +nimble_client/models/gateway_def0ce4e48f62cadb20_task_run_progress_stats_event.py +nimble_client/models/gateway_def1d511972aa34af3c_source_category.py +nimble_client/models/gateway_def21e0e16cb4d7d291_task_run_text_output.py +nimble_client/models/gateway_def2e37feaa5480a045_task_run_json_output.py +nimble_client/models/gateway_def30520b8ccd213fdc_text_run_trust.py +nimble_client/models/gateway_def386b2024130bc052_task_run_source_stats.py +nimble_client/models/gateway_def3a5c7c6bfa027c89_task_run_output_source.py +nimble_client/models/gateway_def3b1480fbbf8bec18_text_claim_trust.py +nimble_client/models/gateway_def4f3b7ab2bb4e1911_task_run_progress_msg_event.py +nimble_client/models/gateway_def54179423f3a3b0a8_json_claim_trust.py +nimble_client/models/gateway_def6651fbad4f19182d_task_run_status_value.py +nimble_client/models/gateway_def6d6a3bc063952be8_task_run_state_event.py +nimble_client/models/gateway_def74786d0cba87c515_trust_source.py +nimble_client/models/gateway_def7feddd7d853a299b_trust_source_type.py +nimble_client/models/gateway_def936b662c6aa9dee9_task_run_state_event_run.py +nimble_client/models/gateway_def977107e4b1c6ce11_trust_citation.py +nimble_client/models/gateway_def_a7c1b2a8ffcc3b45_json_run_trust.py +nimble_client/models/gateway_def_bc5dc0ea1fc57012_task_run_text_output.py +nimble_client/models/gateway_def_c0fe0f39c374a83b_task_run_progress_stats_event.py +nimble_client/models/gateway_def_ce9019f9e67ae903_trust_source.py +nimble_client/models/gateway_def_d1833882d7d67018_task_run_state_event_run.py +nimble_client/models/gateway_def_dc279d13fafb2038_task_run_json_output.py +nimble_client/models/gateway_def_eb0114a225123d8d_json_run_trust.py +nimble_client/models/gateway_def_f23bf5d9e6e07ed3_trust_citation.py +nimble_client/models/gateway_def_fb397fec4dcf2a13_text_claim_trust.py +nimble_client/models/gateway_def_fd08b460e1d38459_task_run_state_event.py +nimble_client/models/get_cookies_action.py +nimble_client/models/get_cookies_action_get_cookies.py +nimble_client/models/get_cookies_action_get_cookies_one_of.py +nimble_client/models/get_domain_knowledge_driver400_response.py +nimble_client/models/goto_action.py +nimble_client/models/goto_action_goto.py +nimble_client/models/goto_action_goto_one_of.py +nimble_client/models/http_validation_error.py +nimble_client/models/input_data.py +nimble_client/models/job_context_public_v1.py +nimble_client/models/job_context_public_v2.py +nimble_client/models/job_destination_public_v1.py +nimble_client/models/job_destination_public_v2.py +nimble_client/models/job_inputs_public_v1.py +nimble_client/models/job_inputs_public_v2.py +nimble_client/models/job_list_filter_public_v2.py +nimble_client/models/job_list_public_v1.py +nimble_client/models/job_public_v1.py +nimble_client/models/job_public_v2.py +nimble_client/models/job_run_cancel_response_public_v1.py +nimble_client/models/job_run_cancel_response_public_v2.py +nimble_client/models/job_run_detail_public_v1.py +nimble_client/models/job_run_detail_public_v2.py +nimble_client/models/job_run_error_public_v1.py +nimble_client/models/job_run_error_public_v2.py +nimble_client/models/job_run_list_filter_public_v2.py +nimble_client/models/job_run_list_public_v1.py +nimble_client/models/job_run_public_v1.py +nimble_client/models/job_run_public_v2.py +nimble_client/models/job_run_summary_public_v1.py +nimble_client/models/job_run_summary_public_v2.py +nimble_client/models/job_schedule_public_v1.py +nimble_client/models/job_schedule_public_v2.py +nimble_client/models/json_claim_trust.py +nimble_client/models/json_patch_op.py +nimble_client/models/json_run_trust.py +nimble_client/models/list_response_extract_template_response_public_v2.py +nimble_client/models/list_response_extract_template_version_response_public_v2.py +nimble_client/models/list_response_job_public_v2.py +nimble_client/models/list_response_job_run_public_v2.py +nimble_client/models/list_response_task_run_response_public_v1.py +nimble_client/models/list_response_task_run_response_public_v2.py +nimble_client/models/list_response_web_search_agent_response_public_v1.py +nimble_client/models/list_response_web_search_agent_response_public_v2.py +nimble_client/models/list_response_web_search_agent_template_response_public_v1.py +nimble_client/models/list_response_web_search_agent_template_response_public_v2.py +nimble_client/models/location_inner.py +nimble_client/models/managed_by.py +nimble_client/models/map_payload.py +nimble_client/models/map_response.py +nimble_client/models/map_response_links_inner.py +nimble_client/models/media_async_payload.py +nimble_client/models/media_async_payload_all_of_media_extractor_options.py +nimble_client/models/media_async_payload_all_of_storage.py +nimble_client/models/media_async_response.py +nimble_client/models/media_payload.py +nimble_client/models/media_payload_media_extractor_options.py +nimble_client/models/metadata.py +nimble_client/models/metadata_filter_public_v2.py +nimble_client/models/output.py +nimble_client/models/output1.py +nimble_client/models/output2.py +nimble_client/models/output3.py +nimble_client/models/parsing_error_result.py +nimble_client/models/parsing_success_result.py +nimble_client/models/parsing_type.py +nimble_client/models/press_action.py +nimble_client/models/press_action_press.py +nimble_client/models/press_action_press_one_of.py +nimble_client/models/privacy_filter_public_v1.py +nimble_client/models/privacy_filter_public_v2.py +nimble_client/models/privacy_level_public_v2.py +nimble_client/models/request.py +nimble_client/models/response_get_run_result_public_v2_api_v2_public_web_search_agents_agent_id_runs_run_id_result_get.py +nimble_client/models/result_model.py +nimble_client/models/revenue_annual.py +nimble_client/models/run_extract_template200_response.py +nimble_client/models/run_extract_template200_response_data.py +nimble_client/models/run_extract_template200_response_data_browser_actions.py +nimble_client/models/run_extract_template200_response_data_browser_actions_results_inner.py +nimble_client/models/run_extract_template200_response_data_network_capture_inner.py +nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter.py +nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter_url.py +nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner.py +nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_request.py +nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_response.py +nimble_client/models/run_extract_template200_response_data_redirects_inner.py +nimble_client/models/run_extract_template200_response_debug.py +nimble_client/models/run_extract_template200_response_metadata.py +nimble_client/models/run_extract_template200_response_pagination.py +nimble_client/models/run_extract_template404_response.py +nimble_client/models/run_extract_template_async200_response.py +nimble_client/models/run_extract_template_async_request.py +nimble_client/models/run_stats_public_v2.py +nimble_client/models/safe_search.py +nimble_client/models/screenshot_action.py +nimble_client/models/screenshot_action_screenshot.py +nimble_client/models/screenshot_action_screenshot_one_of.py +nimble_client/models/scroll_action.py +nimble_client/models/scroll_action_scroll.py +nimble_client/models/scroll_action_scroll_one_of.py +nimble_client/models/sdk_string_variant7a06ddd6b0fd.py +nimble_client/models/search_depth.py +nimble_client/models/search_request.py +nimble_client/models/search_response.py +nimble_client/models/selector.py +nimble_client/models/serp_async_response.py +nimble_client/models/serp_batch_payload.py +nimble_client/models/serp_batch_payload_inputs_inner.py +nimble_client/models/serp_batch_payload_shared_inputs.py +nimble_client/models/serp_batch_response.py +nimble_client/models/serp_metadata.py +nimble_client/models/serp_payload.py +nimble_client/models/stream_agent_run_events200_response.py +nimble_client/models/submit_async_extract_request.py +nimble_client/models/submit_async_serp_request.py +nimble_client/models/task_error_response.py +nimble_client/models/task_failed_response.py +nimble_client/models/task_failed_response_task.py +nimble_client/models/task_list_response.py +nimble_client/models/task_list_response_pagination.py +nimble_client/models/task_not_found_error_response.py +nimble_client/models/task_pending_response.py +nimble_client/models/task_progress.py +nimble_client/models/task_response_schema.py +nimble_client/models/task_response_schema_task.py +nimble_client/models/task_run_error_public_v1.py +nimble_client/models/task_run_error_public_v2.py +nimble_client/models/task_run_failed_result_public_v1.py +nimble_client/models/task_run_failed_result_public_v2.py +nimble_client/models/task_run_json_output_public_v1.py +nimble_client/models/task_run_json_output_public_v2.py +nimble_client/models/task_run_response_public_v1.py +nimble_client/models/task_run_response_public_v2.py +nimble_client/models/task_run_result_public_v1.py +nimble_client/models/task_run_result_public_v2.py +nimble_client/models/task_run_text_output_public_v1.py +nimble_client/models/task_run_text_output_public_v2.py +nimble_client/models/template_feature_flags_public_v1.py +nimble_client/models/template_generation_response_public_v1.py +nimble_client/models/template_input_property_public_v1.py +nimble_client/models/template_public_v1.py +nimble_client/models/template_sample_public_v1.py +nimble_client/models/template_version_metadata_public_v1.py +nimble_client/models/template_version_response_public_v1.py +nimble_client/models/text_claim_trust.py +nimble_client/models/text_run_trust.py +nimble_client/models/time_range.py +nimble_client/models/trigger_job_run_request_public_v1.py +nimble_client/models/trigger_job_run_request_public_v2.py +nimble_client/models/trust_citation.py +nimble_client/models/trust_mode.py +nimble_client/models/trust_source.py +nimble_client/models/update_job_request_public_v1.py +nimble_client/models/update_job_request_public_v2.py +nimble_client/models/usage_catalog_configuration_public_v2.py +nimble_client/models/usage_catalog_product_public_v2.py +nimble_client/models/usage_catalog_public_v2.py +nimble_client/models/usage_catalog_service_public_v2.py +nimble_client/models/usage_configuration_name_public_v2.py +nimble_client/models/usage_dimensions_public_v2.py +nimble_client/models/usage_meta_public_v2.py +nimble_client/models/usage_metrics_public_v2.py +nimble_client/models/usage_name_public_v2.py +nimble_client/models/usage_response_public_v2.py +nimble_client/models/usage_row_public_v2.py +nimble_client/models/validation_error.py +nimble_client/models/visits.py +nimble_client/models/visits_monthly.py +nimble_client/models/wait_action.py +nimble_client/models/wait_action_wait.py +nimble_client/models/wait_action_wait_one_of.py +nimble_client/models/wait_for_element_action.py +nimble_client/models/wait_for_element_action_wait_for_element.py +nimble_client/models/wait_for_element_action_wait_for_element_one_of.py +nimble_client/models/wait_for_navigation_action.py +nimble_client/models/wait_for_navigation_action_wait_for_navigation.py +nimble_client/models/wait_for_navigation_action_wait_for_navigation_one_of.py +nimble_client/models/web_search_agent_create_request_public_v1.py +nimble_client/models/web_search_agent_create_request_public_v2.py +nimble_client/models/web_search_agent_goal_response_public_v1.py +nimble_client/models/web_search_agent_goal_response_public_v2.py +nimble_client/models/web_search_agent_response_public_v1.py +nimble_client/models/web_search_agent_response_public_v2.py +nimble_client/models/web_search_agent_run_create_request_public_v1.py +nimble_client/models/web_search_agent_run_create_request_public_v2.py +nimble_client/models/web_search_agent_run_memory_config_public_v2.py +nimble_client/models/web_search_agent_source_create_request_public_v1.py +nimble_client/models/web_search_agent_source_create_request_public_v2.py +nimble_client/models/web_search_agent_source_response_public_v1.py +nimble_client/models/web_search_agent_source_response_public_v2.py +nimble_client/models/web_search_agent_suggested_question_response_public_v1.py +nimble_client/models/web_search_agent_suggested_question_response_public_v2.py +nimble_client/models/web_search_agent_template_response_public_v1.py +nimble_client/models/web_search_agent_template_response_public_v2.py +nimble_client/models/web_search_agent_use_case.py +nimble_client/models/web_traffic_month.py +nimble_client/models/workforce_total.py +nimble_client/models/wsa_metadata.py +nimble_client/py.typed +nimble_client/rest.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +tox.ini diff --git a/candidate/generated/.openapi-generator/VERSION b/candidate/generated/.openapi-generator/VERSION new file mode 100644 index 0000000..f6b1800 --- /dev/null +++ b/candidate/generated/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.27.0 diff --git a/candidate/generated/.travis.yml b/candidate/generated/.travis.yml new file mode 100644 index 0000000..f99b70a --- /dev/null +++ b/candidate/generated/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.11" + - "3.12" + - "3.13" + - "3.14" + - "3.15" + # uncomment the following if needed + #- "3.14-dev" # 3.14 development branch + #- "nightly" # nightly build +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=nimble_client diff --git a/candidate/generated/README.md b/candidate/generated/README.md new file mode 100644 index 0000000..fa74186 --- /dev/null +++ b/candidate/generated/README.md @@ -0,0 +1,588 @@ +# nimble-client +Nimble API + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 2.0.0 +- Package version: 1.0.0 +- Generator version: 7.27.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.11+ + +Packaging uses standard `[project]` metadata and `[dependency-groups]` (PEP 621/735). +Install the package with `python -m pip install .`; install development dependencies +with Poetry 2.2 or newer using `poetry install`, or pip 25.1 or newer using +`python -m pip install --group dev`. The latter installs the group, not the package. + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import nimble_client +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import nimble_client +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import nimble_client +from nimble_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://sdk.nimbleway.com +# See configuration.py for a list of all supported configuration parameters. +configuration = nimble_client.Configuration( + host = "https://sdk.nimbleway.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = nimble_client.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with nimble_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = nimble_client.BatchesApi(api_client) + batch_id = 'batch_id_example' # str | The unique identifier of the batch. + + try: + # Get batch details + api_response = api_instance.get_batch(batch_id) + print("The response of BatchesApi->get_batch:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling BatchesApi->get_batch: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://sdk.nimbleway.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*BatchesApi* | [**get_batch**](docs/BatchesApi.md#get_batch) | **GET** /v2/batches/{batch_id} | Get batch details +*BatchesApi* | [**get_batch_progress**](docs/BatchesApi.md#get_batch_progress) | **GET** /v2/batches/{batch_id}/progress | Get batch progress +*BatchesApi* | [**list_batches**](docs/BatchesApi.md#list_batches) | **GET** /v2/batches | List batches +*CrawlApi* | [**create_crawl**](docs/CrawlApi.md#create_crawl) | **POST** /v2/crawl | Create crawl task +*CrawlApi* | [**delete_crawl**](docs/CrawlApi.md#delete_crawl) | **DELETE** /v2/crawl/{id} | Cancel Crawl +*CrawlApi* | [**get_crawl**](docs/CrawlApi.md#get_crawl) | **GET** /v2/crawl/{id} | Get crawl data +*CrawlApi* | [**list_crawls**](docs/CrawlApi.md#list_crawls) | **GET** /v2/crawl | Crawl by Filter +*DomainKnowledgeApi* | [**get_domain_knowledge_driver**](docs/DomainKnowledgeApi.md#get_domain_knowledge_driver) | **GET** /v2/domain-knowledge/driver | Get Driver +*ExtractApi* | [**extract**](docs/ExtractApi.md#extract) | **POST** /v2/extract | Extract +*ExtractApi* | [**submit_async_extract**](docs/ExtractApi.md#submit_async_extract) | **POST** /v2/extract/async | Extract Async Endpoint +*ExtractApi* | [**submit_batch_extract**](docs/ExtractApi.md#submit_batch_extract) | **POST** /v2/extract/batch | Extract Batch Endpoint +*ExtractTemplatesPublicApi* | [**create_extract_template_generation**](docs/ExtractTemplatesPublicApi.md#create_extract_template_generation) | **POST** /v2/extract/templates/generations | Create Extract Template Generation Public V2 +*ExtractTemplatesPublicApi* | [**delete_extract_template**](docs/ExtractTemplatesPublicApi.md#delete_extract_template) | **DELETE** /v2/extract/templates/{extract_template_name} | Delete Extract Template Public V2 +*ExtractTemplatesPublicApi* | [**get_extract_template**](docs/ExtractTemplatesPublicApi.md#get_extract_template) | **GET** /v2/extract/templates/{extract_template_name} | Get Extract Template Public V2 +*ExtractTemplatesPublicApi* | [**get_extract_template_generation**](docs/ExtractTemplatesPublicApi.md#get_extract_template_generation) | **GET** /v2/extract/templates/generations/{generation_id} | Get Extract Template Generation Public V2 +*ExtractTemplatesPublicApi* | [**get_extract_template_version**](docs/ExtractTemplatesPublicApi.md#get_extract_template_version) | **GET** /v2/extract/templates/{extract_template_name}/versions/{version_id} | Get Extract Template Version Public V2 +*ExtractTemplatesPublicApi* | [**list_extract_template_versions**](docs/ExtractTemplatesPublicApi.md#list_extract_template_versions) | **GET** /v2/extract/templates/{extract_template_name}/versions | List Extract Template Versions Public V2 +*ExtractTemplatesPublicApi* | [**list_extract_templates**](docs/ExtractTemplatesPublicApi.md#list_extract_templates) | **GET** /v2/extract/templates | List Extract Templates Public V2 +*ExtractTemplatesPublicApi* | [**update_extract_template**](docs/ExtractTemplatesPublicApi.md#update_extract_template) | **PATCH** /v2/extract/templates/{extract_template_name} | Patch Extract Template Public V2 +*ExtractionTemplatesApi* | [**run_extract_template**](docs/ExtractionTemplatesApi.md#run_extract_template) | **POST** /v2/extract/templates/run | +*ExtractionTemplatesApi* | [**run_extract_template_async**](docs/ExtractionTemplatesApi.md#run_extract_template_async) | **POST** /v2/extract/templates/async | +*ExtractionTemplatesApi* | [**run_extract_template_batch**](docs/ExtractionTemplatesApi.md#run_extract_template_batch) | **POST** /v2/extract/templates/batch | +*JobsPublicV2Api* | [**cancel_job_run**](docs/JobsPublicV2Api.md#cancel_job_run) | **POST** /v2/jobs/runs/{run_id}/cancel | Cancel Run Public V2 +*JobsPublicV2Api* | [**create_job**](docs/JobsPublicV2Api.md#create_job) | **POST** /v2/jobs | Create Job Public V2 +*JobsPublicV2Api* | [**delete_job**](docs/JobsPublicV2Api.md#delete_job) | **DELETE** /v2/jobs/{job_id} | Delete Job Public V2 +*JobsPublicV2Api* | [**get_job**](docs/JobsPublicV2Api.md#get_job) | **GET** /v2/jobs/{job_id} | Get Job Public V2 +*JobsPublicV2Api* | [**get_job_run**](docs/JobsPublicV2Api.md#get_job_run) | **GET** /v2/jobs/runs/{run_id} | Get Run Public V2 +*JobsPublicV2Api* | [**get_job_run_artifact**](docs/JobsPublicV2Api.md#get_job_run_artifact) | **GET** /v2/jobs/runs/{run_id}/artifacts/{artifact_id} | Get Run Artifact Public V2 +*JobsPublicV2Api* | [**get_job_run_artifact_download_url**](docs/JobsPublicV2Api.md#get_job_run_artifact_download_url) | **GET** /v2/jobs/runs/{run_id}/artifacts/{artifact_id}/download-url | Get Run Artifact Download Url Public V2 +*JobsPublicV2Api* | [**list_job_run_artifacts**](docs/JobsPublicV2Api.md#list_job_run_artifacts) | **GET** /v2/jobs/runs/{run_id}/artifacts | List Run Artifacts Public V2 +*JobsPublicV2Api* | [**list_job_runs**](docs/JobsPublicV2Api.md#list_job_runs) | **GET** /v2/jobs/{job_id}/runs | List Job Runs Public V2 +*JobsPublicV2Api* | [**list_jobs**](docs/JobsPublicV2Api.md#list_jobs) | **GET** /v2/jobs | List Jobs Public V2 +*JobsPublicV2Api* | [**preview_job_run_artifact**](docs/JobsPublicV2Api.md#preview_job_run_artifact) | **GET** /v2/jobs/runs/{run_id}/artifacts/{artifact_id}/preview | Preview Run Artifact Public V2 +*JobsPublicV2Api* | [**trigger_job_run**](docs/JobsPublicV2Api.md#trigger_job_run) | **POST** /v2/jobs/{job_id}/runs | Trigger Job Run Public V2 +*JobsPublicV2Api* | [**update_job**](docs/JobsPublicV2Api.md#update_job) | **PATCH** /v2/jobs/{job_id} | Update Job Public V2 +*MapApi* | [**map_urls**](docs/MapApi.md#map_urls) | **POST** /v2/map | Create map task +*MediaApi* | [**capture_media**](docs/MediaApi.md#capture_media) | **POST** /v2/media | Download Media +*MediaApi* | [**capture_media_async**](docs/MediaApi.md#capture_media_async) | **POST** /v2/media/async | Download Media Async +*PublicAPIApi* | [**create_agent**](docs/PublicAPIApi.md#create_agent) | **POST** /v2/agents | Create Agent +*PublicAPIApi* | [**create_agent_run**](docs/PublicAPIApi.md#create_agent_run) | **POST** /v2/agents/{agent_id}/runs | Create Agent Run +*PublicAPIApi* | [**create_generated_agent_run**](docs/PublicAPIApi.md#create_generated_agent_run) | **POST** /v2/agents/runs | Create Run With Generated Agent +*PublicAPIApi* | [**deactivate_agent**](docs/PublicAPIApi.md#deactivate_agent) | **DELETE** /v2/agents/{agent_id} | Deactivate Agent +*PublicAPIApi* | [**get_agent**](docs/PublicAPIApi.md#get_agent) | **GET** /v2/agents/{agent_id} | Get Agent +*PublicAPIApi* | [**get_agent_run**](docs/PublicAPIApi.md#get_agent_run) | **GET** /v2/agents/{agent_id}/runs/{run_id} | Get Agent Run +*PublicAPIApi* | [**get_agent_run_result**](docs/PublicAPIApi.md#get_agent_run_result) | **GET** /v2/agents/{agent_id}/runs/{run_id}/result | Get Agent Run Result +*PublicAPIApi* | [**get_agent_template**](docs/PublicAPIApi.md#get_agent_template) | **GET** /v2/agents/templates/{template_name} | Get Agent Template +*PublicAPIApi* | [**list_agent_runs**](docs/PublicAPIApi.md#list_agent_runs) | **GET** /v2/agents/{agent_id}/runs | List Agent Runs +*PublicAPIApi* | [**list_agent_templates**](docs/PublicAPIApi.md#list_agent_templates) | **GET** /v2/agents/templates | List Agent Templates +*PublicAPIApi* | [**list_agents**](docs/PublicAPIApi.md#list_agents) | **GET** /v2/agents | List Agents +*PublicAPIApi* | [**stream_agent_run_events**](docs/PublicAPIApi.md#stream_agent_run_events) | **GET** /v2/agents/{agent_id}/runs/{run_id}/events | Stream Agent Run Events +*PublicAPIApi* | [**update_agent**](docs/PublicAPIApi.md#update_agent) | **PATCH** /v2/agents/{agent_id} | Update Agent +*SERPApi* | [**fast_serp**](docs/SERPApi.md#fast_serp) | **POST** /v2/fast-serp | Fast SERP +*SERPApi* | [**serp**](docs/SERPApi.md#serp) | **POST** /v2/serp | SERP +*SERPApi* | [**submit_async_serp**](docs/SERPApi.md#submit_async_serp) | **POST** /v2/serp/async | SERP Async Endpoint +*SERPApi* | [**submit_batch_serp**](docs/SERPApi.md#submit_batch_serp) | **POST** /v2/serp/batch | SERP Batch Endpoint +*SearchApi* | [**perform_search**](docs/SearchApi.md#perform_search) | **POST** /v2/search | Search +*TasksApi* | [**get_task**](docs/TasksApi.md#get_task) | **GET** /v2/tasks/{task_id} | Get task details +*TasksApi* | [**get_task_results**](docs/TasksApi.md#get_task_results) | **GET** /v2/tasks/{task_id}/results | Get task results +*TasksApi* | [**list_tasks**](docs/TasksApi.md#list_tasks) | **GET** /v2/tasks | List tasks + + +## Documentation For Models + + - [AgentBatchBody](docs/AgentBatchBody.md) + - [AgentBatchBodyInputsInner](docs/AgentBatchBodyInputsInner.md) + - [AgentBatchBodySharedInputs](docs/AgentBatchBodySharedInputs.md) + - [AgentBody](docs/AgentBody.md) + - [AgentSourcesPublicV1](docs/AgentSourcesPublicV1.md) + - [AgentSourcesPublicV2](docs/AgentSourcesPublicV2.md) + - [AgentSourcesResponsePublicV1](docs/AgentSourcesResponsePublicV1.md) + - [AgentSourcesResponsePublicV2](docs/AgentSourcesResponsePublicV2.md) + - [Amount](docs/Amount.md) + - [AnswerAnnotationCitation](docs/AnswerAnnotationCitation.md) + - [AnswerMarkerCitation](docs/AnswerMarkerCitation.md) + - [AnswerRequest](docs/AnswerRequest.md) + - [AnswerResponse](docs/AnswerResponse.md) + - [ArtifactDownloadUrlPublicV1](docs/ArtifactDownloadUrlPublicV1.md) + - [ArtifactDownloadUrlPublicV2](docs/ArtifactDownloadUrlPublicV2.md) + - [ArtifactListPublicV1](docs/ArtifactListPublicV1.md) + - [ArtifactListPublicV2](docs/ArtifactListPublicV2.md) + - [ArtifactPreviewPublicV1](docs/ArtifactPreviewPublicV1.md) + - [ArtifactPreviewPublicV2](docs/ArtifactPreviewPublicV2.md) + - [ArtifactPublicV1](docs/ArtifactPublicV1.md) + - [ArtifactPublicV2](docs/ArtifactPublicV2.md) + - [AutoScrollAction](docs/AutoScrollAction.md) + - [AutoScrollActionAutoScroll](docs/AutoScrollActionAutoScroll.md) + - [AutoScrollActionAutoScrollOneOf](docs/AutoScrollActionAutoScrollOneOf.md) + - [AutoScrollActionAutoScrollOneOfRequired](docs/AutoScrollActionAutoScrollOneOfRequired.md) + - [AutoScrollActionAutoScrollOneOfSkip](docs/AutoScrollActionAutoScrollOneOfSkip.md) + - [AvgDurationSeconds](docs/AvgDurationSeconds.md) + - [BatchGetResponse](docs/BatchGetResponse.md) + - [BatchGetResponseTasksInner](docs/BatchGetResponseTasksInner.md) + - [BatchProgressResponse](docs/BatchProgressResponse.md) + - [BrowserAction](docs/BrowserAction.md) + - [Citation](docs/Citation.md) + - [CitationConfig](docs/CitationConfig.md) + - [Citations](docs/Citations.md) + - [ClickAction](docs/ClickAction.md) + - [ClickActionClick](docs/ClickActionClick.md) + - [ClickActionClickOneOf](docs/ClickActionClickOneOf.md) + - [CompanyEntity](docs/CompanyEntity.md) + - [CompanyFinancials](docs/CompanyFinancials.md) + - [CompanyHeadquarters](docs/CompanyHeadquarters.md) + - [CompanyWebTraffic](docs/CompanyWebTraffic.md) + - [Content](docs/Content.md) + - [CountryRank](docs/CountryRank.md) + - [CrawlApiResponse](docs/CrawlApiResponse.md) + - [CrawlApiResponseCompletedAt](docs/CrawlApiResponseCompletedAt.md) + - [CrawlApiResponseCrawlOptions](docs/CrawlApiResponseCrawlOptions.md) + - [CrawlApiResponseCrawlOptionsCallback](docs/CrawlApiResponseCrawlOptionsCallback.md) + - [CrawlApiResponseCrawlOptionsCallbackAnyOf](docs/CrawlApiResponseCrawlOptionsCallbackAnyOf.md) + - [CrawlApiResponseCreatedAt](docs/CrawlApiResponseCreatedAt.md) + - [CrawlApiResponseTasksInner](docs/CrawlApiResponseTasksInner.md) + - [CrawlByFiltersResponse](docs/CrawlByFiltersResponse.md) + - [CrawlByFiltersResponsePagination](docs/CrawlByFiltersResponsePagination.md) + - [CrawlPayload](docs/CrawlPayload.md) + - [CrawlPayloadCallback](docs/CrawlPayloadCallback.md) + - [CrawlPayloadCallbackAnyOf](docs/CrawlPayloadCallbackAnyOf.md) + - [CrawlPayloadCallbackAnyOfAnyOf](docs/CrawlPayloadCallbackAnyOfAnyOf.md) + - [CrawlPayloadExtractOptions](docs/CrawlPayloadExtractOptions.md) + - [CrawlPayloadExtractOptionsBrowser](docs/CrawlPayloadExtractOptionsBrowser.md) + - [CrawlPayloadExtractOptionsBrowserAnyOf](docs/CrawlPayloadExtractOptionsBrowserAnyOf.md) + - [CrawlPayloadExtractOptionsCookies](docs/CrawlPayloadExtractOptionsCookies.md) + - [CrawlPayloadExtractOptionsCookiesAnyOfInner](docs/CrawlPayloadExtractOptionsCookiesAnyOfInner.md) + - [CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires](docs/CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires.md) + - [CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge](docs/CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge.md) + - [CrawlPayloadExtractOptionsFileParsingOptions](docs/CrawlPayloadExtractOptionsFileParsingOptions.md) + - [CrawlPayloadExtractOptionsHeadersValue](docs/CrawlPayloadExtractOptionsHeadersValue.md) + - [CrawlPayloadExtractOptionsNetworkCaptureInner](docs/CrawlPayloadExtractOptionsNetworkCaptureInner.md) + - [CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType](docs/CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType.md) + - [CrawlPayloadExtractOptionsNetworkCaptureInnerUrl](docs/CrawlPayloadExtractOptionsNetworkCaptureInnerUrl.md) + - [CrawlPayloadExtractOptionsParser](docs/CrawlPayloadExtractOptionsParser.md) + - [CrawlPayloadExtractOptionsRender](docs/CrawlPayloadExtractOptionsRender.md) + - [CrawlPayloadExtractOptionsSession](docs/CrawlPayloadExtractOptionsSession.md) + - [CrawlPayloadExtractOptionsSkill](docs/CrawlPayloadExtractOptionsSkill.md) + - [CreateExtractTemplateGenerationRequestPublicV2](docs/CreateExtractTemplateGenerationRequestPublicV2.md) + - [CreateExtractTemplateMetadataPublicV2](docs/CreateExtractTemplateMetadataPublicV2.md) + - [CreateExtractTemplateRefinementRequestPublicV2](docs/CreateExtractTemplateRefinementRequestPublicV2.md) + - [CreateJobRequestPublicV1](docs/CreateJobRequestPublicV1.md) + - [CreateJobRequestPublicV2](docs/CreateJobRequestPublicV2.md) + - [CreateTemplateGenerationRequestPublicV1](docs/CreateTemplateGenerationRequestPublicV1.md) + - [CreateTemplateMetadataPublicV1](docs/CreateTemplateMetadataPublicV1.md) + - [CreateTemplateRefinementRequestPublicV1](docs/CreateTemplateRefinementRequestPublicV1.md) + - [Default](docs/Default.md) + - [DeleteCrawl200Response](docs/DeleteCrawl200Response.md) + - [DriverResolutionResponse](docs/DriverResolutionResponse.md) + - [Duration](docs/Duration.md) + - [Effort](docs/Effort.md) + - [EvalAction](docs/EvalAction.md) + - [EvalActionEval](docs/EvalActionEval.md) + - [EvalActionEvalOneOf](docs/EvalActionEvalOneOf.md) + - [Extract200Response](docs/Extract200Response.md) + - [Extract200ResponseData](docs/Extract200ResponseData.md) + - [Extract200ResponseDataBrowserActions](docs/Extract200ResponseDataBrowserActions.md) + - [Extract200ResponseDataBrowserActionsResultsInner](docs/Extract200ResponseDataBrowserActionsResultsInner.md) + - [Extract200ResponseDataNetworkCaptureInner](docs/Extract200ResponseDataNetworkCaptureInner.md) + - [Extract200ResponseDataNetworkCaptureInnerFilter](docs/Extract200ResponseDataNetworkCaptureInnerFilter.md) + - [Extract200ResponseDataNetworkCaptureInnerFilterResourceType](docs/Extract200ResponseDataNetworkCaptureInnerFilterResourceType.md) + - [Extract200ResponseDataNetworkCaptureInnerFilterStatusCode](docs/Extract200ResponseDataNetworkCaptureInnerFilterStatusCode.md) + - [Extract200ResponseDataNetworkCaptureInnerFilterUrl](docs/Extract200ResponseDataNetworkCaptureInnerFilterUrl.md) + - [Extract200ResponseDataNetworkCaptureInnerResultsInner](docs/Extract200ResponseDataNetworkCaptureInnerResultsInner.md) + - [Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest](docs/Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest.md) + - [Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse](docs/Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse.md) + - [Extract200ResponseDataParsing](docs/Extract200ResponseDataParsing.md) + - [Extract200ResponseDataRedirectsInner](docs/Extract200ResponseDataRedirectsInner.md) + - [Extract200ResponseDebug](docs/Extract200ResponseDebug.md) + - [Extract200ResponseMetadata](docs/Extract200ResponseMetadata.md) + - [Extract200ResponsePagination](docs/Extract200ResponsePagination.md) + - [Extract200ResponsePaginationAnyOf](docs/Extract200ResponsePaginationAnyOf.md) + - [Extract200ResponsePaginationAnyOf1Inner](docs/Extract200ResponsePaginationAnyOf1Inner.md) + - [ExtractAsyncResponse](docs/ExtractAsyncResponse.md) + - [ExtractAsyncResponseTask](docs/ExtractAsyncResponseTask.md) + - [ExtractBatchPayload](docs/ExtractBatchPayload.md) + - [ExtractBatchPayloadInputsInner](docs/ExtractBatchPayloadInputsInner.md) + - [ExtractBatchPayloadInputsInnerAllOfRender](docs/ExtractBatchPayloadInputsInnerAllOfRender.md) + - [ExtractBatchPayloadSharedInputs](docs/ExtractBatchPayloadSharedInputs.md) + - [ExtractBatchResponse](docs/ExtractBatchResponse.md) + - [ExtractBatchResponseTasksInner](docs/ExtractBatchResponseTasksInner.md) + - [ExtractPayload](docs/ExtractPayload.md) + - [ExtractTemplateFilterPublicV2](docs/ExtractTemplateFilterPublicV2.md) + - [ExtractTemplateGenerationResponsePublicV2](docs/ExtractTemplateGenerationResponsePublicV2.md) + - [ExtractTemplateResponsePublicV2](docs/ExtractTemplateResponsePublicV2.md) + - [ExtractTemplateSamplePublicV2](docs/ExtractTemplateSamplePublicV2.md) + - [ExtractTemplateVersionMetadataPublicV2](docs/ExtractTemplateVersionMetadataPublicV2.md) + - [ExtractTemplateVersionResponsePublicV2](docs/ExtractTemplateVersionResponsePublicV2.md) + - [ExtractionTemplateBatchBody](docs/ExtractionTemplateBatchBody.md) + - [ExtractionTemplateBatchBodyInputsInner](docs/ExtractionTemplateBatchBodyInputsInner.md) + - [ExtractionTemplateBatchBodySharedInputs](docs/ExtractionTemplateBatchBodySharedInputs.md) + - [ExtractionTemplateBody](docs/ExtractionTemplateBody.md) + - [FetchAction](docs/FetchAction.md) + - [FetchActionFetch](docs/FetchActionFetch.md) + - [FetchActionFetchOneOf](docs/FetchActionFetchOneOf.md) + - [FillAction](docs/FillAction.md) + - [FillOptions](docs/FillOptions.md) + - [FillOptionsOneOf](docs/FillOptionsOneOf.md) + - [FillOptionsOneOf1](docs/FillOptionsOneOf1.md) + - [Focus](docs/Focus.md) + - [FullTemplatePublicV1](docs/FullTemplatePublicV1.md) + - [FundingRound](docs/FundingRound.md) + - [FundingTotal](docs/FundingTotal.md) + - [GatewayDef033cecba0ba3d1d3TextRunTrust](docs/GatewayDef033cecba0ba3d1d3TextRunTrust.md) + - [GatewayDef07f3b31eb3e5e2cbTrustConfidence](docs/GatewayDef07f3b31eb3e5e2cbTrustConfidence.md) + - [GatewayDef07f55f9a59071b48JsonClaimTrust](docs/GatewayDef07f55f9a59071b48JsonClaimTrust.md) + - [GatewayDef0ce4e48f62cadb20TaskRunProgressStatsEvent](docs/GatewayDef0ce4e48f62cadb20TaskRunProgressStatsEvent.md) + - [GatewayDef1d511972aa34af3cSourceCategory](docs/GatewayDef1d511972aa34af3cSourceCategory.md) + - [GatewayDef21e0e16cb4d7d291TaskRunTextOutput](docs/GatewayDef21e0e16cb4d7d291TaskRunTextOutput.md) + - [GatewayDef2e37feaa5480a045TaskRunJsonOutput](docs/GatewayDef2e37feaa5480a045TaskRunJsonOutput.md) + - [GatewayDef30520b8ccd213fdcTextRunTrust](docs/GatewayDef30520b8ccd213fdcTextRunTrust.md) + - [GatewayDef386b2024130bc052TaskRunSourceStats](docs/GatewayDef386b2024130bc052TaskRunSourceStats.md) + - [GatewayDef3a5c7c6bfa027c89TaskRunOutputSource](docs/GatewayDef3a5c7c6bfa027c89TaskRunOutputSource.md) + - [GatewayDef3b1480fbbf8bec18TextClaimTrust](docs/GatewayDef3b1480fbbf8bec18TextClaimTrust.md) + - [GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent](docs/GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent.md) + - [GatewayDef54179423f3a3b0a8JsonClaimTrust](docs/GatewayDef54179423f3a3b0a8JsonClaimTrust.md) + - [GatewayDef6651fbad4f19182dTaskRunStatusValue](docs/GatewayDef6651fbad4f19182dTaskRunStatusValue.md) + - [GatewayDef6d6a3bc063952be8TaskRunStateEvent](docs/GatewayDef6d6a3bc063952be8TaskRunStateEvent.md) + - [GatewayDef74786d0cba87c515TrustSource](docs/GatewayDef74786d0cba87c515TrustSource.md) + - [GatewayDef7feddd7d853a299bTrustSourceType](docs/GatewayDef7feddd7d853a299bTrustSourceType.md) + - [GatewayDef936b662c6aa9dee9TaskRunStateEventRun](docs/GatewayDef936b662c6aa9dee9TaskRunStateEventRun.md) + - [GatewayDef977107e4b1c6ce11TrustCitation](docs/GatewayDef977107e4b1c6ce11TrustCitation.md) + - [GatewayDefA7c1b2a8ffcc3b45JsonRunTrust](docs/GatewayDefA7c1b2a8ffcc3b45JsonRunTrust.md) + - [GatewayDefBc5dc0ea1fc57012TaskRunTextOutput](docs/GatewayDefBc5dc0ea1fc57012TaskRunTextOutput.md) + - [GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent](docs/GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent.md) + - [GatewayDefCe9019f9e67ae903TrustSource](docs/GatewayDefCe9019f9e67ae903TrustSource.md) + - [GatewayDefD1833882d7d67018TaskRunStateEventRun](docs/GatewayDefD1833882d7d67018TaskRunStateEventRun.md) + - [GatewayDefDc279d13fafb2038TaskRunJsonOutput](docs/GatewayDefDc279d13fafb2038TaskRunJsonOutput.md) + - [GatewayDefEb0114a225123d8dJsonRunTrust](docs/GatewayDefEb0114a225123d8dJsonRunTrust.md) + - [GatewayDefF23bf5d9e6e07ed3TrustCitation](docs/GatewayDefF23bf5d9e6e07ed3TrustCitation.md) + - [GatewayDefFb397fec4dcf2a13TextClaimTrust](docs/GatewayDefFb397fec4dcf2a13TextClaimTrust.md) + - [GatewayDefFd08b460e1d38459TaskRunStateEvent](docs/GatewayDefFd08b460e1d38459TaskRunStateEvent.md) + - [GetCookiesAction](docs/GetCookiesAction.md) + - [GetCookiesActionGetCookies](docs/GetCookiesActionGetCookies.md) + - [GetCookiesActionGetCookiesOneOf](docs/GetCookiesActionGetCookiesOneOf.md) + - [GetDomainKnowledgeDriver400Response](docs/GetDomainKnowledgeDriver400Response.md) + - [GotoAction](docs/GotoAction.md) + - [GotoActionGoto](docs/GotoActionGoto.md) + - [GotoActionGotoOneOf](docs/GotoActionGotoOneOf.md) + - [HTTPValidationError](docs/HTTPValidationError.md) + - [InputData](docs/InputData.md) + - [JobContextPublicV1](docs/JobContextPublicV1.md) + - [JobContextPublicV2](docs/JobContextPublicV2.md) + - [JobDestinationPublicV1](docs/JobDestinationPublicV1.md) + - [JobDestinationPublicV2](docs/JobDestinationPublicV2.md) + - [JobInputsPublicV1](docs/JobInputsPublicV1.md) + - [JobInputsPublicV2](docs/JobInputsPublicV2.md) + - [JobListFilterPublicV2](docs/JobListFilterPublicV2.md) + - [JobListPublicV1](docs/JobListPublicV1.md) + - [JobPublicV1](docs/JobPublicV1.md) + - [JobPublicV2](docs/JobPublicV2.md) + - [JobRunCancelResponsePublicV1](docs/JobRunCancelResponsePublicV1.md) + - [JobRunCancelResponsePublicV2](docs/JobRunCancelResponsePublicV2.md) + - [JobRunDetailPublicV1](docs/JobRunDetailPublicV1.md) + - [JobRunDetailPublicV2](docs/JobRunDetailPublicV2.md) + - [JobRunErrorPublicV1](docs/JobRunErrorPublicV1.md) + - [JobRunErrorPublicV2](docs/JobRunErrorPublicV2.md) + - [JobRunListFilterPublicV2](docs/JobRunListFilterPublicV2.md) + - [JobRunListPublicV1](docs/JobRunListPublicV1.md) + - [JobRunPublicV1](docs/JobRunPublicV1.md) + - [JobRunPublicV2](docs/JobRunPublicV2.md) + - [JobRunSummaryPublicV1](docs/JobRunSummaryPublicV1.md) + - [JobRunSummaryPublicV2](docs/JobRunSummaryPublicV2.md) + - [JobSchedulePublicV1](docs/JobSchedulePublicV1.md) + - [JobSchedulePublicV2](docs/JobSchedulePublicV2.md) + - [JsonClaimTrust](docs/JsonClaimTrust.md) + - [JsonPatchOp](docs/JsonPatchOp.md) + - [JsonRunTrust](docs/JsonRunTrust.md) + - [ListResponseExtractTemplateResponsePublicV2](docs/ListResponseExtractTemplateResponsePublicV2.md) + - [ListResponseExtractTemplateVersionResponsePublicV2](docs/ListResponseExtractTemplateVersionResponsePublicV2.md) + - [ListResponseJobPublicV2](docs/ListResponseJobPublicV2.md) + - [ListResponseJobRunPublicV2](docs/ListResponseJobRunPublicV2.md) + - [ListResponseTaskRunResponsePublicV1](docs/ListResponseTaskRunResponsePublicV1.md) + - [ListResponseTaskRunResponsePublicV2](docs/ListResponseTaskRunResponsePublicV2.md) + - [ListResponseWebSearchAgentResponsePublicV1](docs/ListResponseWebSearchAgentResponsePublicV1.md) + - [ListResponseWebSearchAgentResponsePublicV2](docs/ListResponseWebSearchAgentResponsePublicV2.md) + - [ListResponseWebSearchAgentTemplateResponsePublicV1](docs/ListResponseWebSearchAgentTemplateResponsePublicV1.md) + - [ListResponseWebSearchAgentTemplateResponsePublicV2](docs/ListResponseWebSearchAgentTemplateResponsePublicV2.md) + - [LocationInner](docs/LocationInner.md) + - [ManagedBy](docs/ManagedBy.md) + - [MapPayload](docs/MapPayload.md) + - [MapResponse](docs/MapResponse.md) + - [MapResponseLinksInner](docs/MapResponseLinksInner.md) + - [MediaAsyncPayload](docs/MediaAsyncPayload.md) + - [MediaAsyncPayloadAllOfMediaExtractorOptions](docs/MediaAsyncPayloadAllOfMediaExtractorOptions.md) + - [MediaAsyncPayloadAllOfStorage](docs/MediaAsyncPayloadAllOfStorage.md) + - [MediaAsyncResponse](docs/MediaAsyncResponse.md) + - [MediaPayload](docs/MediaPayload.md) + - [MediaPayloadMediaExtractorOptions](docs/MediaPayloadMediaExtractorOptions.md) + - [Metadata](docs/Metadata.md) + - [MetadataFilterPublicV2](docs/MetadataFilterPublicV2.md) + - [Output](docs/Output.md) + - [Output1](docs/Output1.md) + - [Output2](docs/Output2.md) + - [Output3](docs/Output3.md) + - [ParsingErrorResult](docs/ParsingErrorResult.md) + - [ParsingSuccessResult](docs/ParsingSuccessResult.md) + - [ParsingType](docs/ParsingType.md) + - [PressAction](docs/PressAction.md) + - [PressActionPress](docs/PressActionPress.md) + - [PressActionPressOneOf](docs/PressActionPressOneOf.md) + - [PrivacyFilterPublicV1](docs/PrivacyFilterPublicV1.md) + - [PrivacyFilterPublicV2](docs/PrivacyFilterPublicV2.md) + - [PrivacyLevelPublicV2](docs/PrivacyLevelPublicV2.md) + - [Request](docs/Request.md) + - [ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet](docs/ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet.md) + - [ResultModel](docs/ResultModel.md) + - [RevenueAnnual](docs/RevenueAnnual.md) + - [RunExtractTemplate200Response](docs/RunExtractTemplate200Response.md) + - [RunExtractTemplate200ResponseData](docs/RunExtractTemplate200ResponseData.md) + - [RunExtractTemplate200ResponseDataBrowserActions](docs/RunExtractTemplate200ResponseDataBrowserActions.md) + - [RunExtractTemplate200ResponseDataBrowserActionsResultsInner](docs/RunExtractTemplate200ResponseDataBrowserActionsResultsInner.md) + - [RunExtractTemplate200ResponseDataNetworkCaptureInner](docs/RunExtractTemplate200ResponseDataNetworkCaptureInner.md) + - [RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter](docs/RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter.md) + - [RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl](docs/RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl.md) + - [RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner](docs/RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner.md) + - [RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest](docs/RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest.md) + - [RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse](docs/RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse.md) + - [RunExtractTemplate200ResponseDataRedirectsInner](docs/RunExtractTemplate200ResponseDataRedirectsInner.md) + - [RunExtractTemplate200ResponseDebug](docs/RunExtractTemplate200ResponseDebug.md) + - [RunExtractTemplate200ResponseMetadata](docs/RunExtractTemplate200ResponseMetadata.md) + - [RunExtractTemplate200ResponsePagination](docs/RunExtractTemplate200ResponsePagination.md) + - [RunExtractTemplate404Response](docs/RunExtractTemplate404Response.md) + - [RunExtractTemplateAsync200Response](docs/RunExtractTemplateAsync200Response.md) + - [RunExtractTemplateAsyncRequest](docs/RunExtractTemplateAsyncRequest.md) + - [RunStatsPublicV2](docs/RunStatsPublicV2.md) + - [SERPMetadata](docs/SERPMetadata.md) + - [SafeSearch](docs/SafeSearch.md) + - [ScreenshotAction](docs/ScreenshotAction.md) + - [ScreenshotActionScreenshot](docs/ScreenshotActionScreenshot.md) + - [ScreenshotActionScreenshotOneOf](docs/ScreenshotActionScreenshotOneOf.md) + - [ScrollAction](docs/ScrollAction.md) + - [ScrollActionScroll](docs/ScrollActionScroll.md) + - [ScrollActionScrollOneOf](docs/ScrollActionScrollOneOf.md) + - [SdkStringVariant7a06ddd6b0fd](docs/SdkStringVariant7a06ddd6b0fd.md) + - [SearchDepth](docs/SearchDepth.md) + - [SearchRequest](docs/SearchRequest.md) + - [SearchResponse](docs/SearchResponse.md) + - [Selector](docs/Selector.md) + - [SerpAsyncResponse](docs/SerpAsyncResponse.md) + - [SerpBatchPayload](docs/SerpBatchPayload.md) + - [SerpBatchPayloadInputsInner](docs/SerpBatchPayloadInputsInner.md) + - [SerpBatchPayloadSharedInputs](docs/SerpBatchPayloadSharedInputs.md) + - [SerpBatchResponse](docs/SerpBatchResponse.md) + - [SerpPayload](docs/SerpPayload.md) + - [StreamAgentRunEvents200Response](docs/StreamAgentRunEvents200Response.md) + - [SubmitAsyncExtractRequest](docs/SubmitAsyncExtractRequest.md) + - [SubmitAsyncSerpRequest](docs/SubmitAsyncSerpRequest.md) + - [TaskErrorResponse](docs/TaskErrorResponse.md) + - [TaskFailedResponse](docs/TaskFailedResponse.md) + - [TaskFailedResponseTask](docs/TaskFailedResponseTask.md) + - [TaskListResponse](docs/TaskListResponse.md) + - [TaskListResponsePagination](docs/TaskListResponsePagination.md) + - [TaskNotFoundErrorResponse](docs/TaskNotFoundErrorResponse.md) + - [TaskPendingResponse](docs/TaskPendingResponse.md) + - [TaskProgress](docs/TaskProgress.md) + - [TaskResponseSchema](docs/TaskResponseSchema.md) + - [TaskResponseSchemaTask](docs/TaskResponseSchemaTask.md) + - [TaskRunErrorPublicV1](docs/TaskRunErrorPublicV1.md) + - [TaskRunErrorPublicV2](docs/TaskRunErrorPublicV2.md) + - [TaskRunFailedResultPublicV1](docs/TaskRunFailedResultPublicV1.md) + - [TaskRunFailedResultPublicV2](docs/TaskRunFailedResultPublicV2.md) + - [TaskRunJsonOutputPublicV1](docs/TaskRunJsonOutputPublicV1.md) + - [TaskRunJsonOutputPublicV2](docs/TaskRunJsonOutputPublicV2.md) + - [TaskRunResponsePublicV1](docs/TaskRunResponsePublicV1.md) + - [TaskRunResponsePublicV2](docs/TaskRunResponsePublicV2.md) + - [TaskRunResultPublicV1](docs/TaskRunResultPublicV1.md) + - [TaskRunResultPublicV2](docs/TaskRunResultPublicV2.md) + - [TaskRunTextOutputPublicV1](docs/TaskRunTextOutputPublicV1.md) + - [TaskRunTextOutputPublicV2](docs/TaskRunTextOutputPublicV2.md) + - [TemplateFeatureFlagsPublicV1](docs/TemplateFeatureFlagsPublicV1.md) + - [TemplateGenerationResponsePublicV1](docs/TemplateGenerationResponsePublicV1.md) + - [TemplateInputPropertyPublicV1](docs/TemplateInputPropertyPublicV1.md) + - [TemplatePublicV1](docs/TemplatePublicV1.md) + - [TemplateSamplePublicV1](docs/TemplateSamplePublicV1.md) + - [TemplateVersionMetadataPublicV1](docs/TemplateVersionMetadataPublicV1.md) + - [TemplateVersionResponsePublicV1](docs/TemplateVersionResponsePublicV1.md) + - [TextClaimTrust](docs/TextClaimTrust.md) + - [TextRunTrust](docs/TextRunTrust.md) + - [TimeRange](docs/TimeRange.md) + - [TriggerJobRunRequestPublicV1](docs/TriggerJobRunRequestPublicV1.md) + - [TriggerJobRunRequestPublicV2](docs/TriggerJobRunRequestPublicV2.md) + - [TrustCitation](docs/TrustCitation.md) + - [TrustMode](docs/TrustMode.md) + - [TrustSource](docs/TrustSource.md) + - [UpdateJobRequestPublicV1](docs/UpdateJobRequestPublicV1.md) + - [UpdateJobRequestPublicV2](docs/UpdateJobRequestPublicV2.md) + - [UsageCatalogConfigurationPublicV2](docs/UsageCatalogConfigurationPublicV2.md) + - [UsageCatalogProductPublicV2](docs/UsageCatalogProductPublicV2.md) + - [UsageCatalogPublicV2](docs/UsageCatalogPublicV2.md) + - [UsageCatalogServicePublicV2](docs/UsageCatalogServicePublicV2.md) + - [UsageConfigurationNamePublicV2](docs/UsageConfigurationNamePublicV2.md) + - [UsageDimensionsPublicV2](docs/UsageDimensionsPublicV2.md) + - [UsageMetaPublicV2](docs/UsageMetaPublicV2.md) + - [UsageMetricsPublicV2](docs/UsageMetricsPublicV2.md) + - [UsageNamePublicV2](docs/UsageNamePublicV2.md) + - [UsageResponsePublicV2](docs/UsageResponsePublicV2.md) + - [UsageRowPublicV2](docs/UsageRowPublicV2.md) + - [ValidationError](docs/ValidationError.md) + - [Visits](docs/Visits.md) + - [VisitsMonthly](docs/VisitsMonthly.md) + - [WSAMetadata](docs/WSAMetadata.md) + - [WaitAction](docs/WaitAction.md) + - [WaitActionWait](docs/WaitActionWait.md) + - [WaitActionWaitOneOf](docs/WaitActionWaitOneOf.md) + - [WaitForElementAction](docs/WaitForElementAction.md) + - [WaitForElementActionWaitForElement](docs/WaitForElementActionWaitForElement.md) + - [WaitForElementActionWaitForElementOneOf](docs/WaitForElementActionWaitForElementOneOf.md) + - [WaitForNavigationAction](docs/WaitForNavigationAction.md) + - [WaitForNavigationActionWaitForNavigation](docs/WaitForNavigationActionWaitForNavigation.md) + - [WaitForNavigationActionWaitForNavigationOneOf](docs/WaitForNavigationActionWaitForNavigationOneOf.md) + - [WebSearchAgentCreateRequestPublicV1](docs/WebSearchAgentCreateRequestPublicV1.md) + - [WebSearchAgentCreateRequestPublicV2](docs/WebSearchAgentCreateRequestPublicV2.md) + - [WebSearchAgentGoalResponsePublicV1](docs/WebSearchAgentGoalResponsePublicV1.md) + - [WebSearchAgentGoalResponsePublicV2](docs/WebSearchAgentGoalResponsePublicV2.md) + - [WebSearchAgentResponsePublicV1](docs/WebSearchAgentResponsePublicV1.md) + - [WebSearchAgentResponsePublicV2](docs/WebSearchAgentResponsePublicV2.md) + - [WebSearchAgentRunCreateRequestPublicV1](docs/WebSearchAgentRunCreateRequestPublicV1.md) + - [WebSearchAgentRunCreateRequestPublicV2](docs/WebSearchAgentRunCreateRequestPublicV2.md) + - [WebSearchAgentRunMemoryConfigPublicV2](docs/WebSearchAgentRunMemoryConfigPublicV2.md) + - [WebSearchAgentSourceCreateRequestPublicV1](docs/WebSearchAgentSourceCreateRequestPublicV1.md) + - [WebSearchAgentSourceCreateRequestPublicV2](docs/WebSearchAgentSourceCreateRequestPublicV2.md) + - [WebSearchAgentSourceResponsePublicV1](docs/WebSearchAgentSourceResponsePublicV1.md) + - [WebSearchAgentSourceResponsePublicV2](docs/WebSearchAgentSourceResponsePublicV2.md) + - [WebSearchAgentSuggestedQuestionResponsePublicV1](docs/WebSearchAgentSuggestedQuestionResponsePublicV1.md) + - [WebSearchAgentSuggestedQuestionResponsePublicV2](docs/WebSearchAgentSuggestedQuestionResponsePublicV2.md) + - [WebSearchAgentTemplateResponsePublicV1](docs/WebSearchAgentTemplateResponsePublicV1.md) + - [WebSearchAgentTemplateResponsePublicV2](docs/WebSearchAgentTemplateResponsePublicV2.md) + - [WebSearchAgentUseCase](docs/WebSearchAgentUseCase.md) + - [WebTrafficMonth](docs/WebTrafficMonth.md) + - [WorkforceTotal](docs/WorkforceTotal.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### APIKeyCookie + +- **Type**: API key +- **API key parameter name**: token +- **Location**: + + +### BearerAuth + +- **Type**: Bearer authentication + + +### HTTPBearer + +- **Type**: Bearer authentication + + +## Author + + + + +## Request headers + +Header names are compared case-insensitively in all Python client libraries. +Request headers are copied; supplying `_headers` does not change the caller's dict +or the client's shared defaults. The public `_headers` argument retains its dict +validation and existing value serialization. Pydantic can coerce mappings such as HTTPX `Headers` to a dict, +combining repeated fields into a single value; `_headers` does not provide a +repeated-field or list-of-pairs API. + +Precedence, from lowest to highest: + +1. `_headers` (within one dict, the last inserted case variant wins). +2. Explicit OpenAPI header parameters and generated `Content-Type` (or `_content_type`). + Generated `Accept` is added only when neither `_headers` nor explicit header + parameters contain an `Accept` case variant. +3. `ApiClient.default_headers` (including headers set with `set_default_header`). +4. The client's `cookie` setting, for `Cookie`. +5. Authentication headers. A non-empty `_request_auth` replaces configured + authentication for that call; `{}` retains configured authentication. Cookie + authentication appends to the selected `Cookie` value. + +This retains the existing precedence for identically spelled names and extends it +to case variants. To override a generated content type, use `_content_type`; +client defaults still take precedence over it. The winning header's spelling and +value are retained for replacements. Cookie authentication uses the canonical +`Cookie` spelling and appends its value. Values containing legitimate +comma-separated lists are not split or deduplicated. This does not remove +duplicate values inside a header or change the handling of repeated fields +supplied directly to the transport. diff --git a/candidate/generated/git_push.sh b/candidate/generated/git_push.sh new file mode 100644 index 0000000..a35991c --- /dev/null +++ b/candidate/generated/git_push.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ -z "${git_host}" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" +fi + +if [ -z "${git_user_id}" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" +fi + +if [ -z "${git_repo_id}" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" +fi + +if [ -z "${release_note}" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "${release_note}" + +# Sets the new remote +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" + else + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" + fi +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/candidate/generated/nimble_client/__init__.py b/candidate/generated/nimble_client/__init__.py new file mode 100644 index 0000000..4d5578b --- /dev/null +++ b/candidate/generated/nimble_client/__init__.py @@ -0,0 +1,802 @@ +# coding: utf-8 + +# flake8: noqa + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# Define package exports +__all__ = [ + "BatchesApi", + "CrawlApi", + "DomainKnowledgeApi", + "ExtractApi", + "ExtractTemplatesPublicApi", + "ExtractionTemplatesApi", + "JobsPublicV2Api", + "MapApi", + "MediaApi", + "PublicAPIApi", + "SERPApi", + "SearchApi", + "TasksApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AgentBatchBody", + "AgentBatchBodyInputsInner", + "AgentBatchBodySharedInputs", + "AgentBody", + "AgentSourcesPublicV1", + "AgentSourcesPublicV2", + "AgentSourcesResponsePublicV1", + "AgentSourcesResponsePublicV2", + "Amount", + "AnswerAnnotationCitation", + "AnswerMarkerCitation", + "AnswerRequest", + "AnswerResponse", + "ArtifactDownloadUrlPublicV1", + "ArtifactDownloadUrlPublicV2", + "ArtifactListPublicV1", + "ArtifactListPublicV2", + "ArtifactPreviewPublicV1", + "ArtifactPreviewPublicV2", + "ArtifactPublicV1", + "ArtifactPublicV2", + "AutoScrollAction", + "AutoScrollActionAutoScroll", + "AutoScrollActionAutoScrollOneOf", + "AutoScrollActionAutoScrollOneOfRequired", + "AutoScrollActionAutoScrollOneOfSkip", + "AvgDurationSeconds", + "BatchGetResponse", + "BatchGetResponseTasksInner", + "BatchProgressResponse", + "BrowserAction", + "Citation", + "CitationConfig", + "Citations", + "ClickAction", + "ClickActionClick", + "ClickActionClickOneOf", + "CompanyEntity", + "CompanyFinancials", + "CompanyHeadquarters", + "CompanyWebTraffic", + "Content", + "CountryRank", + "CrawlApiResponse", + "CrawlApiResponseCompletedAt", + "CrawlApiResponseCrawlOptions", + "CrawlApiResponseCrawlOptionsCallback", + "CrawlApiResponseCrawlOptionsCallbackAnyOf", + "CrawlApiResponseCreatedAt", + "CrawlApiResponseTasksInner", + "CrawlByFiltersResponse", + "CrawlByFiltersResponsePagination", + "CrawlPayload", + "CrawlPayloadCallback", + "CrawlPayloadCallbackAnyOf", + "CrawlPayloadCallbackAnyOfAnyOf", + "CrawlPayloadExtractOptions", + "CrawlPayloadExtractOptionsBrowser", + "CrawlPayloadExtractOptionsBrowserAnyOf", + "CrawlPayloadExtractOptionsCookies", + "CrawlPayloadExtractOptionsCookiesAnyOfInner", + "CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires", + "CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge", + "CrawlPayloadExtractOptionsFileParsingOptions", + "CrawlPayloadExtractOptionsHeadersValue", + "CrawlPayloadExtractOptionsNetworkCaptureInner", + "CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType", + "CrawlPayloadExtractOptionsNetworkCaptureInnerUrl", + "CrawlPayloadExtractOptionsParser", + "CrawlPayloadExtractOptionsRender", + "CrawlPayloadExtractOptionsSession", + "CrawlPayloadExtractOptionsSkill", + "CreateExtractTemplateGenerationRequestPublicV2", + "CreateExtractTemplateMetadataPublicV2", + "CreateExtractTemplateRefinementRequestPublicV2", + "CreateJobRequestPublicV1", + "CreateJobRequestPublicV2", + "CreateTemplateGenerationRequestPublicV1", + "CreateTemplateMetadataPublicV1", + "CreateTemplateRefinementRequestPublicV1", + "Default", + "DeleteCrawl200Response", + "DriverResolutionResponse", + "Duration", + "Effort", + "EvalAction", + "EvalActionEval", + "EvalActionEvalOneOf", + "Extract200Response", + "Extract200ResponseData", + "Extract200ResponseDataBrowserActions", + "Extract200ResponseDataBrowserActionsResultsInner", + "Extract200ResponseDataNetworkCaptureInner", + "Extract200ResponseDataNetworkCaptureInnerFilter", + "Extract200ResponseDataNetworkCaptureInnerFilterResourceType", + "Extract200ResponseDataNetworkCaptureInnerFilterStatusCode", + "Extract200ResponseDataNetworkCaptureInnerFilterUrl", + "Extract200ResponseDataNetworkCaptureInnerResultsInner", + "Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest", + "Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse", + "Extract200ResponseDataParsing", + "Extract200ResponseDataRedirectsInner", + "Extract200ResponseDebug", + "Extract200ResponseMetadata", + "Extract200ResponsePagination", + "Extract200ResponsePaginationAnyOf", + "Extract200ResponsePaginationAnyOf1Inner", + "ExtractAsyncResponse", + "ExtractAsyncResponseTask", + "ExtractBatchPayload", + "ExtractBatchPayloadInputsInner", + "ExtractBatchPayloadInputsInnerAllOfRender", + "ExtractBatchPayloadSharedInputs", + "ExtractBatchResponse", + "ExtractBatchResponseTasksInner", + "ExtractPayload", + "ExtractTemplateFilterPublicV2", + "ExtractTemplateGenerationResponsePublicV2", + "ExtractTemplateResponsePublicV2", + "ExtractTemplateSamplePublicV2", + "ExtractTemplateVersionMetadataPublicV2", + "ExtractTemplateVersionResponsePublicV2", + "ExtractionTemplateBatchBody", + "ExtractionTemplateBatchBodyInputsInner", + "ExtractionTemplateBatchBodySharedInputs", + "ExtractionTemplateBody", + "FetchAction", + "FetchActionFetch", + "FetchActionFetchOneOf", + "FillAction", + "FillOptions", + "FillOptionsOneOf", + "FillOptionsOneOf1", + "Focus", + "FullTemplatePublicV1", + "FundingRound", + "FundingTotal", + "GatewayDef033cecba0ba3d1d3TextRunTrust", + "GatewayDef07f3b31eb3e5e2cbTrustConfidence", + "GatewayDef07f55f9a59071b48JsonClaimTrust", + "GatewayDef0ce4e48f62cadb20TaskRunProgressStatsEvent", + "GatewayDef1d511972aa34af3cSourceCategory", + "GatewayDef21e0e16cb4d7d291TaskRunTextOutput", + "GatewayDef2e37feaa5480a045TaskRunJsonOutput", + "GatewayDef30520b8ccd213fdcTextRunTrust", + "GatewayDef386b2024130bc052TaskRunSourceStats", + "GatewayDef3a5c7c6bfa027c89TaskRunOutputSource", + "GatewayDef3b1480fbbf8bec18TextClaimTrust", + "GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent", + "GatewayDef54179423f3a3b0a8JsonClaimTrust", + "GatewayDef6651fbad4f19182dTaskRunStatusValue", + "GatewayDef6d6a3bc063952be8TaskRunStateEvent", + "GatewayDef74786d0cba87c515TrustSource", + "GatewayDef7feddd7d853a299bTrustSourceType", + "GatewayDef936b662c6aa9dee9TaskRunStateEventRun", + "GatewayDef977107e4b1c6ce11TrustCitation", + "GatewayDefA7c1b2a8ffcc3b45JsonRunTrust", + "GatewayDefBc5dc0ea1fc57012TaskRunTextOutput", + "GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent", + "GatewayDefCe9019f9e67ae903TrustSource", + "GatewayDefD1833882d7d67018TaskRunStateEventRun", + "GatewayDefDc279d13fafb2038TaskRunJsonOutput", + "GatewayDefEb0114a225123d8dJsonRunTrust", + "GatewayDefF23bf5d9e6e07ed3TrustCitation", + "GatewayDefFb397fec4dcf2a13TextClaimTrust", + "GatewayDefFd08b460e1d38459TaskRunStateEvent", + "GetCookiesAction", + "GetCookiesActionGetCookies", + "GetCookiesActionGetCookiesOneOf", + "GetDomainKnowledgeDriver400Response", + "GotoAction", + "GotoActionGoto", + "GotoActionGotoOneOf", + "HTTPValidationError", + "InputData", + "JobContextPublicV1", + "JobContextPublicV2", + "JobDestinationPublicV1", + "JobDestinationPublicV2", + "JobInputsPublicV1", + "JobInputsPublicV2", + "JobListFilterPublicV2", + "JobListPublicV1", + "JobPublicV1", + "JobPublicV2", + "JobRunCancelResponsePublicV1", + "JobRunCancelResponsePublicV2", + "JobRunDetailPublicV1", + "JobRunDetailPublicV2", + "JobRunErrorPublicV1", + "JobRunErrorPublicV2", + "JobRunListFilterPublicV2", + "JobRunListPublicV1", + "JobRunPublicV1", + "JobRunPublicV2", + "JobRunSummaryPublicV1", + "JobRunSummaryPublicV2", + "JobSchedulePublicV1", + "JobSchedulePublicV2", + "JsonClaimTrust", + "JsonPatchOp", + "JsonRunTrust", + "ListResponseExtractTemplateResponsePublicV2", + "ListResponseExtractTemplateVersionResponsePublicV2", + "ListResponseJobPublicV2", + "ListResponseJobRunPublicV2", + "ListResponseTaskRunResponsePublicV1", + "ListResponseTaskRunResponsePublicV2", + "ListResponseWebSearchAgentResponsePublicV1", + "ListResponseWebSearchAgentResponsePublicV2", + "ListResponseWebSearchAgentTemplateResponsePublicV1", + "ListResponseWebSearchAgentTemplateResponsePublicV2", + "LocationInner", + "ManagedBy", + "MapPayload", + "MapResponse", + "MapResponseLinksInner", + "MediaAsyncPayload", + "MediaAsyncPayloadAllOfMediaExtractorOptions", + "MediaAsyncPayloadAllOfStorage", + "MediaAsyncResponse", + "MediaPayload", + "MediaPayloadMediaExtractorOptions", + "Metadata", + "MetadataFilterPublicV2", + "Output", + "Output1", + "Output2", + "Output3", + "ParsingErrorResult", + "ParsingSuccessResult", + "ParsingType", + "PressAction", + "PressActionPress", + "PressActionPressOneOf", + "PrivacyFilterPublicV1", + "PrivacyFilterPublicV2", + "PrivacyLevelPublicV2", + "Request", + "ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet", + "ResultModel", + "RevenueAnnual", + "RunExtractTemplate200Response", + "RunExtractTemplate200ResponseData", + "RunExtractTemplate200ResponseDataBrowserActions", + "RunExtractTemplate200ResponseDataBrowserActionsResultsInner", + "RunExtractTemplate200ResponseDataNetworkCaptureInner", + "RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter", + "RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl", + "RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner", + "RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest", + "RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse", + "RunExtractTemplate200ResponseDataRedirectsInner", + "RunExtractTemplate200ResponseDebug", + "RunExtractTemplate200ResponseMetadata", + "RunExtractTemplate200ResponsePagination", + "RunExtractTemplate404Response", + "RunExtractTemplateAsync200Response", + "RunExtractTemplateAsyncRequest", + "RunStatsPublicV2", + "SERPMetadata", + "SafeSearch", + "ScreenshotAction", + "ScreenshotActionScreenshot", + "ScreenshotActionScreenshotOneOf", + "ScrollAction", + "ScrollActionScroll", + "ScrollActionScrollOneOf", + "SdkStringVariant7a06ddd6b0fd", + "SearchDepth", + "SearchRequest", + "SearchResponse", + "Selector", + "SerpAsyncResponse", + "SerpBatchPayload", + "SerpBatchPayloadInputsInner", + "SerpBatchPayloadSharedInputs", + "SerpBatchResponse", + "SerpPayload", + "StreamAgentRunEvents200Response", + "SubmitAsyncExtractRequest", + "SubmitAsyncSerpRequest", + "TaskErrorResponse", + "TaskFailedResponse", + "TaskFailedResponseTask", + "TaskListResponse", + "TaskListResponsePagination", + "TaskNotFoundErrorResponse", + "TaskPendingResponse", + "TaskProgress", + "TaskResponseSchema", + "TaskResponseSchemaTask", + "TaskRunErrorPublicV1", + "TaskRunErrorPublicV2", + "TaskRunFailedResultPublicV1", + "TaskRunFailedResultPublicV2", + "TaskRunJsonOutputPublicV1", + "TaskRunJsonOutputPublicV2", + "TaskRunResponsePublicV1", + "TaskRunResponsePublicV2", + "TaskRunResultPublicV1", + "TaskRunResultPublicV2", + "TaskRunTextOutputPublicV1", + "TaskRunTextOutputPublicV2", + "TemplateFeatureFlagsPublicV1", + "TemplateGenerationResponsePublicV1", + "TemplateInputPropertyPublicV1", + "TemplatePublicV1", + "TemplateSamplePublicV1", + "TemplateVersionMetadataPublicV1", + "TemplateVersionResponsePublicV1", + "TextClaimTrust", + "TextRunTrust", + "TimeRange", + "TriggerJobRunRequestPublicV1", + "TriggerJobRunRequestPublicV2", + "TrustCitation", + "TrustMode", + "TrustSource", + "UpdateJobRequestPublicV1", + "UpdateJobRequestPublicV2", + "UsageCatalogConfigurationPublicV2", + "UsageCatalogProductPublicV2", + "UsageCatalogPublicV2", + "UsageCatalogServicePublicV2", + "UsageConfigurationNamePublicV2", + "UsageDimensionsPublicV2", + "UsageMetaPublicV2", + "UsageMetricsPublicV2", + "UsageNamePublicV2", + "UsageResponsePublicV2", + "UsageRowPublicV2", + "ValidationError", + "Visits", + "VisitsMonthly", + "WSAMetadata", + "WaitAction", + "WaitActionWait", + "WaitActionWaitOneOf", + "WaitForElementAction", + "WaitForElementActionWaitForElement", + "WaitForElementActionWaitForElementOneOf", + "WaitForNavigationAction", + "WaitForNavigationActionWaitForNavigation", + "WaitForNavigationActionWaitForNavigationOneOf", + "WebSearchAgentCreateRequestPublicV1", + "WebSearchAgentCreateRequestPublicV2", + "WebSearchAgentGoalResponsePublicV1", + "WebSearchAgentGoalResponsePublicV2", + "WebSearchAgentResponsePublicV1", + "WebSearchAgentResponsePublicV2", + "WebSearchAgentRunCreateRequestPublicV1", + "WebSearchAgentRunCreateRequestPublicV2", + "WebSearchAgentRunMemoryConfigPublicV2", + "WebSearchAgentSourceCreateRequestPublicV1", + "WebSearchAgentSourceCreateRequestPublicV2", + "WebSearchAgentSourceResponsePublicV1", + "WebSearchAgentSourceResponsePublicV2", + "WebSearchAgentSuggestedQuestionResponsePublicV1", + "WebSearchAgentSuggestedQuestionResponsePublicV2", + "WebSearchAgentTemplateResponsePublicV1", + "WebSearchAgentTemplateResponsePublicV2", + "WebSearchAgentUseCase", + "WebTrafficMonth", + "WorkforceTotal", +] + +# import apis into sdk package +from nimble_client.api.batches_api import BatchesApi as BatchesApi +from nimble_client.api.crawl_api import CrawlApi as CrawlApi +from nimble_client.api.domain_knowledge_api import DomainKnowledgeApi as DomainKnowledgeApi +from nimble_client.api.extract_api import ExtractApi as ExtractApi +from nimble_client.api.extract_templates_public_api import ExtractTemplatesPublicApi as ExtractTemplatesPublicApi +from nimble_client.api.extraction_templates_api import ExtractionTemplatesApi as ExtractionTemplatesApi +from nimble_client.api.jobs_public_v2_api import JobsPublicV2Api as JobsPublicV2Api +from nimble_client.api.map_api import MapApi as MapApi +from nimble_client.api.media_api import MediaApi as MediaApi +from nimble_client.api.public_api_api import PublicAPIApi as PublicAPIApi +from nimble_client.api.serp_api import SERPApi as SERPApi +from nimble_client.api.search_api import SearchApi as SearchApi +from nimble_client.api.tasks_api import TasksApi as TasksApi + +# import ApiClient +from nimble_client.api_response import ApiResponse as ApiResponse +from nimble_client.api_client import ApiClient as ApiClient +from nimble_client.configuration import Configuration as Configuration +from nimble_client.exceptions import OpenApiException as OpenApiException +from nimble_client.exceptions import ApiTypeError as ApiTypeError +from nimble_client.exceptions import ApiValueError as ApiValueError +from nimble_client.exceptions import ApiKeyError as ApiKeyError +from nimble_client.exceptions import ApiAttributeError as ApiAttributeError +from nimble_client.exceptions import ApiException as ApiException + +# import models into sdk package +from nimble_client.models.agent_batch_body import AgentBatchBody as AgentBatchBody +from nimble_client.models.agent_batch_body_inputs_inner import AgentBatchBodyInputsInner as AgentBatchBodyInputsInner +from nimble_client.models.agent_batch_body_shared_inputs import AgentBatchBodySharedInputs as AgentBatchBodySharedInputs +from nimble_client.models.agent_body import AgentBody as AgentBody +from nimble_client.models.agent_sources_public_v1 import AgentSourcesPublicV1 as AgentSourcesPublicV1 +from nimble_client.models.agent_sources_public_v2 import AgentSourcesPublicV2 as AgentSourcesPublicV2 +from nimble_client.models.agent_sources_response_public_v1 import AgentSourcesResponsePublicV1 as AgentSourcesResponsePublicV1 +from nimble_client.models.agent_sources_response_public_v2 import AgentSourcesResponsePublicV2 as AgentSourcesResponsePublicV2 +from nimble_client.models.amount import Amount as Amount +from nimble_client.models.answer_annotation_citation import AnswerAnnotationCitation as AnswerAnnotationCitation +from nimble_client.models.answer_marker_citation import AnswerMarkerCitation as AnswerMarkerCitation +from nimble_client.models.answer_request import AnswerRequest as AnswerRequest +from nimble_client.models.answer_response import AnswerResponse as AnswerResponse +from nimble_client.models.artifact_download_url_public_v1 import ArtifactDownloadUrlPublicV1 as ArtifactDownloadUrlPublicV1 +from nimble_client.models.artifact_download_url_public_v2 import ArtifactDownloadUrlPublicV2 as ArtifactDownloadUrlPublicV2 +from nimble_client.models.artifact_list_public_v1 import ArtifactListPublicV1 as ArtifactListPublicV1 +from nimble_client.models.artifact_list_public_v2 import ArtifactListPublicV2 as ArtifactListPublicV2 +from nimble_client.models.artifact_preview_public_v1 import ArtifactPreviewPublicV1 as ArtifactPreviewPublicV1 +from nimble_client.models.artifact_preview_public_v2 import ArtifactPreviewPublicV2 as ArtifactPreviewPublicV2 +from nimble_client.models.artifact_public_v1 import ArtifactPublicV1 as ArtifactPublicV1 +from nimble_client.models.artifact_public_v2 import ArtifactPublicV2 as ArtifactPublicV2 +from nimble_client.models.auto_scroll_action import AutoScrollAction as AutoScrollAction +from nimble_client.models.auto_scroll_action_auto_scroll import AutoScrollActionAutoScroll as AutoScrollActionAutoScroll +from nimble_client.models.auto_scroll_action_auto_scroll_one_of import AutoScrollActionAutoScrollOneOf as AutoScrollActionAutoScrollOneOf +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired as AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip as AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.avg_duration_seconds import AvgDurationSeconds as AvgDurationSeconds +from nimble_client.models.batch_get_response import BatchGetResponse as BatchGetResponse +from nimble_client.models.batch_get_response_tasks_inner import BatchGetResponseTasksInner as BatchGetResponseTasksInner +from nimble_client.models.batch_progress_response import BatchProgressResponse as BatchProgressResponse +from nimble_client.models.browser_action import BrowserAction as BrowserAction +from nimble_client.models.citation import Citation as Citation +from nimble_client.models.citation_config import CitationConfig as CitationConfig +from nimble_client.models.citations import Citations as Citations +from nimble_client.models.click_action import ClickAction as ClickAction +from nimble_client.models.click_action_click import ClickActionClick as ClickActionClick +from nimble_client.models.click_action_click_one_of import ClickActionClickOneOf as ClickActionClickOneOf +from nimble_client.models.company_entity import CompanyEntity as CompanyEntity +from nimble_client.models.company_financials import CompanyFinancials as CompanyFinancials +from nimble_client.models.company_headquarters import CompanyHeadquarters as CompanyHeadquarters +from nimble_client.models.company_web_traffic import CompanyWebTraffic as CompanyWebTraffic +from nimble_client.models.content import Content as Content +from nimble_client.models.country_rank import CountryRank as CountryRank +from nimble_client.models.crawl_api_response import CrawlApiResponse as CrawlApiResponse +from nimble_client.models.crawl_api_response_completed_at import CrawlApiResponseCompletedAt as CrawlApiResponseCompletedAt +from nimble_client.models.crawl_api_response_crawl_options import CrawlApiResponseCrawlOptions as CrawlApiResponseCrawlOptions +from nimble_client.models.crawl_api_response_crawl_options_callback import CrawlApiResponseCrawlOptionsCallback as CrawlApiResponseCrawlOptionsCallback +from nimble_client.models.crawl_api_response_crawl_options_callback_any_of import CrawlApiResponseCrawlOptionsCallbackAnyOf as CrawlApiResponseCrawlOptionsCallbackAnyOf +from nimble_client.models.crawl_api_response_created_at import CrawlApiResponseCreatedAt as CrawlApiResponseCreatedAt +from nimble_client.models.crawl_api_response_tasks_inner import CrawlApiResponseTasksInner as CrawlApiResponseTasksInner +from nimble_client.models.crawl_by_filters_response import CrawlByFiltersResponse as CrawlByFiltersResponse +from nimble_client.models.crawl_by_filters_response_pagination import CrawlByFiltersResponsePagination as CrawlByFiltersResponsePagination +from nimble_client.models.crawl_payload import CrawlPayload as CrawlPayload +from nimble_client.models.crawl_payload_callback import CrawlPayloadCallback as CrawlPayloadCallback +from nimble_client.models.crawl_payload_callback_any_of import CrawlPayloadCallbackAnyOf as CrawlPayloadCallbackAnyOf +from nimble_client.models.crawl_payload_callback_any_of_any_of import CrawlPayloadCallbackAnyOfAnyOf as CrawlPayloadCallbackAnyOfAnyOf +from nimble_client.models.crawl_payload_extract_options import CrawlPayloadExtractOptions as CrawlPayloadExtractOptions +from nimble_client.models.crawl_payload_extract_options_browser import CrawlPayloadExtractOptionsBrowser as CrawlPayloadExtractOptionsBrowser +from nimble_client.models.crawl_payload_extract_options_browser_any_of import CrawlPayloadExtractOptionsBrowserAnyOf as CrawlPayloadExtractOptionsBrowserAnyOf +from nimble_client.models.crawl_payload_extract_options_cookies import CrawlPayloadExtractOptionsCookies as CrawlPayloadExtractOptionsCookies +from nimble_client.models.crawl_payload_extract_options_cookies_any_of_inner import CrawlPayloadExtractOptionsCookiesAnyOfInner as CrawlPayloadExtractOptionsCookiesAnyOfInner +from nimble_client.models.crawl_payload_extract_options_cookies_any_of_inner_expires import CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires as CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires +from nimble_client.models.crawl_payload_extract_options_cookies_any_of_inner_max_age import CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge as CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge +from nimble_client.models.crawl_payload_extract_options_file_parsing_options import CrawlPayloadExtractOptionsFileParsingOptions as CrawlPayloadExtractOptionsFileParsingOptions +from nimble_client.models.crawl_payload_extract_options_headers_value import CrawlPayloadExtractOptionsHeadersValue as CrawlPayloadExtractOptionsHeadersValue +from nimble_client.models.crawl_payload_extract_options_network_capture_inner import CrawlPayloadExtractOptionsNetworkCaptureInner as CrawlPayloadExtractOptionsNetworkCaptureInner +from nimble_client.models.crawl_payload_extract_options_network_capture_inner_resource_type import CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType as CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType +from nimble_client.models.crawl_payload_extract_options_network_capture_inner_url import CrawlPayloadExtractOptionsNetworkCaptureInnerUrl as CrawlPayloadExtractOptionsNetworkCaptureInnerUrl +from nimble_client.models.crawl_payload_extract_options_parser import CrawlPayloadExtractOptionsParser as CrawlPayloadExtractOptionsParser +from nimble_client.models.crawl_payload_extract_options_render import CrawlPayloadExtractOptionsRender as CrawlPayloadExtractOptionsRender +from nimble_client.models.crawl_payload_extract_options_session import CrawlPayloadExtractOptionsSession as CrawlPayloadExtractOptionsSession +from nimble_client.models.crawl_payload_extract_options_skill import CrawlPayloadExtractOptionsSkill as CrawlPayloadExtractOptionsSkill +from nimble_client.models.create_extract_template_generation_request_public_v2 import CreateExtractTemplateGenerationRequestPublicV2 as CreateExtractTemplateGenerationRequestPublicV2 +from nimble_client.models.create_extract_template_metadata_public_v2 import CreateExtractTemplateMetadataPublicV2 as CreateExtractTemplateMetadataPublicV2 +from nimble_client.models.create_extract_template_refinement_request_public_v2 import CreateExtractTemplateRefinementRequestPublicV2 as CreateExtractTemplateRefinementRequestPublicV2 +from nimble_client.models.create_job_request_public_v1 import CreateJobRequestPublicV1 as CreateJobRequestPublicV1 +from nimble_client.models.create_job_request_public_v2 import CreateJobRequestPublicV2 as CreateJobRequestPublicV2 +from nimble_client.models.create_template_generation_request_public_v1 import CreateTemplateGenerationRequestPublicV1 as CreateTemplateGenerationRequestPublicV1 +from nimble_client.models.create_template_metadata_public_v1 import CreateTemplateMetadataPublicV1 as CreateTemplateMetadataPublicV1 +from nimble_client.models.create_template_refinement_request_public_v1 import CreateTemplateRefinementRequestPublicV1 as CreateTemplateRefinementRequestPublicV1 +from nimble_client.models.default import Default as Default +from nimble_client.models.delete_crawl200_response import DeleteCrawl200Response as DeleteCrawl200Response +from nimble_client.models.driver_resolution_response import DriverResolutionResponse as DriverResolutionResponse +from nimble_client.models.duration import Duration as Duration +from nimble_client.models.effort import Effort as Effort +from nimble_client.models.eval_action import EvalAction as EvalAction +from nimble_client.models.eval_action_eval import EvalActionEval as EvalActionEval +from nimble_client.models.eval_action_eval_one_of import EvalActionEvalOneOf as EvalActionEvalOneOf +from nimble_client.models.extract200_response import Extract200Response as Extract200Response +from nimble_client.models.extract200_response_data import Extract200ResponseData as Extract200ResponseData +from nimble_client.models.extract200_response_data_browser_actions import Extract200ResponseDataBrowserActions as Extract200ResponseDataBrowserActions +from nimble_client.models.extract200_response_data_browser_actions_results_inner import Extract200ResponseDataBrowserActionsResultsInner as Extract200ResponseDataBrowserActionsResultsInner +from nimble_client.models.extract200_response_data_network_capture_inner import Extract200ResponseDataNetworkCaptureInner as Extract200ResponseDataNetworkCaptureInner +from nimble_client.models.extract200_response_data_network_capture_inner_filter import Extract200ResponseDataNetworkCaptureInnerFilter as Extract200ResponseDataNetworkCaptureInnerFilter +from nimble_client.models.extract200_response_data_network_capture_inner_filter_resource_type import Extract200ResponseDataNetworkCaptureInnerFilterResourceType as Extract200ResponseDataNetworkCaptureInnerFilterResourceType +from nimble_client.models.extract200_response_data_network_capture_inner_filter_status_code import Extract200ResponseDataNetworkCaptureInnerFilterStatusCode as Extract200ResponseDataNetworkCaptureInnerFilterStatusCode +from nimble_client.models.extract200_response_data_network_capture_inner_filter_url import Extract200ResponseDataNetworkCaptureInnerFilterUrl as Extract200ResponseDataNetworkCaptureInnerFilterUrl +from nimble_client.models.extract200_response_data_network_capture_inner_results_inner import Extract200ResponseDataNetworkCaptureInnerResultsInner as Extract200ResponseDataNetworkCaptureInnerResultsInner +from nimble_client.models.extract200_response_data_network_capture_inner_results_inner_request import Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest as Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest +from nimble_client.models.extract200_response_data_network_capture_inner_results_inner_response import Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse as Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse +from nimble_client.models.extract200_response_data_parsing import Extract200ResponseDataParsing as Extract200ResponseDataParsing +from nimble_client.models.extract200_response_data_redirects_inner import Extract200ResponseDataRedirectsInner as Extract200ResponseDataRedirectsInner +from nimble_client.models.extract200_response_debug import Extract200ResponseDebug as Extract200ResponseDebug +from nimble_client.models.extract200_response_metadata import Extract200ResponseMetadata as Extract200ResponseMetadata +from nimble_client.models.extract200_response_pagination import Extract200ResponsePagination as Extract200ResponsePagination +from nimble_client.models.extract200_response_pagination_any_of import Extract200ResponsePaginationAnyOf as Extract200ResponsePaginationAnyOf +from nimble_client.models.extract200_response_pagination_any_of1_inner import Extract200ResponsePaginationAnyOf1Inner as Extract200ResponsePaginationAnyOf1Inner +from nimble_client.models.extract_async_response import ExtractAsyncResponse as ExtractAsyncResponse +from nimble_client.models.extract_async_response_task import ExtractAsyncResponseTask as ExtractAsyncResponseTask +from nimble_client.models.extract_batch_payload import ExtractBatchPayload as ExtractBatchPayload +from nimble_client.models.extract_batch_payload_inputs_inner import ExtractBatchPayloadInputsInner as ExtractBatchPayloadInputsInner +from nimble_client.models.extract_batch_payload_inputs_inner_all_of_render import ExtractBatchPayloadInputsInnerAllOfRender as ExtractBatchPayloadInputsInnerAllOfRender +from nimble_client.models.extract_batch_payload_shared_inputs import ExtractBatchPayloadSharedInputs as ExtractBatchPayloadSharedInputs +from nimble_client.models.extract_batch_response import ExtractBatchResponse as ExtractBatchResponse +from nimble_client.models.extract_batch_response_tasks_inner import ExtractBatchResponseTasksInner as ExtractBatchResponseTasksInner +from nimble_client.models.extract_payload import ExtractPayload as ExtractPayload +from nimble_client.models.extract_template_filter_public_v2 import ExtractTemplateFilterPublicV2 as ExtractTemplateFilterPublicV2 +from nimble_client.models.extract_template_generation_response_public_v2 import ExtractTemplateGenerationResponsePublicV2 as ExtractTemplateGenerationResponsePublicV2 +from nimble_client.models.extract_template_response_public_v2 import ExtractTemplateResponsePublicV2 as ExtractTemplateResponsePublicV2 +from nimble_client.models.extract_template_sample_public_v2 import ExtractTemplateSamplePublicV2 as ExtractTemplateSamplePublicV2 +from nimble_client.models.extract_template_version_metadata_public_v2 import ExtractTemplateVersionMetadataPublicV2 as ExtractTemplateVersionMetadataPublicV2 +from nimble_client.models.extract_template_version_response_public_v2 import ExtractTemplateVersionResponsePublicV2 as ExtractTemplateVersionResponsePublicV2 +from nimble_client.models.extraction_template_batch_body import ExtractionTemplateBatchBody as ExtractionTemplateBatchBody +from nimble_client.models.extraction_template_batch_body_inputs_inner import ExtractionTemplateBatchBodyInputsInner as ExtractionTemplateBatchBodyInputsInner +from nimble_client.models.extraction_template_batch_body_shared_inputs import ExtractionTemplateBatchBodySharedInputs as ExtractionTemplateBatchBodySharedInputs +from nimble_client.models.extraction_template_body import ExtractionTemplateBody as ExtractionTemplateBody +from nimble_client.models.fetch_action import FetchAction as FetchAction +from nimble_client.models.fetch_action_fetch import FetchActionFetch as FetchActionFetch +from nimble_client.models.fetch_action_fetch_one_of import FetchActionFetchOneOf as FetchActionFetchOneOf +from nimble_client.models.fill_action import FillAction as FillAction +from nimble_client.models.fill_options import FillOptions as FillOptions +from nimble_client.models.fill_options_one_of import FillOptionsOneOf as FillOptionsOneOf +from nimble_client.models.fill_options_one_of1 import FillOptionsOneOf1 as FillOptionsOneOf1 +from nimble_client.models.focus import Focus as Focus +from nimble_client.models.full_template_public_v1 import FullTemplatePublicV1 as FullTemplatePublicV1 +from nimble_client.models.funding_round import FundingRound as FundingRound +from nimble_client.models.funding_total import FundingTotal as FundingTotal +from nimble_client.models.gateway_def033cecba0ba3d1d3_text_run_trust import GatewayDef033cecba0ba3d1d3TextRunTrust as GatewayDef033cecba0ba3d1d3TextRunTrust +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence as GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def07f55f9a59071b48_json_claim_trust import GatewayDef07f55f9a59071b48JsonClaimTrust as GatewayDef07f55f9a59071b48JsonClaimTrust +from nimble_client.models.gateway_def0ce4e48f62cadb20_task_run_progress_stats_event import GatewayDef0ce4e48f62cadb20TaskRunProgressStatsEvent as GatewayDef0ce4e48f62cadb20TaskRunProgressStatsEvent +from nimble_client.models.gateway_def1d511972aa34af3c_source_category import GatewayDef1d511972aa34af3cSourceCategory as GatewayDef1d511972aa34af3cSourceCategory +from nimble_client.models.gateway_def21e0e16cb4d7d291_task_run_text_output import GatewayDef21e0e16cb4d7d291TaskRunTextOutput as GatewayDef21e0e16cb4d7d291TaskRunTextOutput +from nimble_client.models.gateway_def2e37feaa5480a045_task_run_json_output import GatewayDef2e37feaa5480a045TaskRunJsonOutput as GatewayDef2e37feaa5480a045TaskRunJsonOutput +from nimble_client.models.gateway_def30520b8ccd213fdc_text_run_trust import GatewayDef30520b8ccd213fdcTextRunTrust as GatewayDef30520b8ccd213fdcTextRunTrust +from nimble_client.models.gateway_def386b2024130bc052_task_run_source_stats import GatewayDef386b2024130bc052TaskRunSourceStats as GatewayDef386b2024130bc052TaskRunSourceStats +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource as GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from nimble_client.models.gateway_def3b1480fbbf8bec18_text_claim_trust import GatewayDef3b1480fbbf8bec18TextClaimTrust as GatewayDef3b1480fbbf8bec18TextClaimTrust +from nimble_client.models.gateway_def4f3b7ab2bb4e1911_task_run_progress_msg_event import GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent as GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent +from nimble_client.models.gateway_def54179423f3a3b0a8_json_claim_trust import GatewayDef54179423f3a3b0a8JsonClaimTrust as GatewayDef54179423f3a3b0a8JsonClaimTrust +from nimble_client.models.gateway_def6651fbad4f19182d_task_run_status_value import GatewayDef6651fbad4f19182dTaskRunStatusValue as GatewayDef6651fbad4f19182dTaskRunStatusValue +from nimble_client.models.gateway_def6d6a3bc063952be8_task_run_state_event import GatewayDef6d6a3bc063952be8TaskRunStateEvent as GatewayDef6d6a3bc063952be8TaskRunStateEvent +from nimble_client.models.gateway_def74786d0cba87c515_trust_source import GatewayDef74786d0cba87c515TrustSource as GatewayDef74786d0cba87c515TrustSource +from nimble_client.models.gateway_def7feddd7d853a299b_trust_source_type import GatewayDef7feddd7d853a299bTrustSourceType as GatewayDef7feddd7d853a299bTrustSourceType +from nimble_client.models.gateway_def936b662c6aa9dee9_task_run_state_event_run import GatewayDef936b662c6aa9dee9TaskRunStateEventRun as GatewayDef936b662c6aa9dee9TaskRunStateEventRun +from nimble_client.models.gateway_def977107e4b1c6ce11_trust_citation import GatewayDef977107e4b1c6ce11TrustCitation as GatewayDef977107e4b1c6ce11TrustCitation +from nimble_client.models.gateway_def_a7c1b2a8ffcc3b45_json_run_trust import GatewayDefA7c1b2a8ffcc3b45JsonRunTrust as GatewayDefA7c1b2a8ffcc3b45JsonRunTrust +from nimble_client.models.gateway_def_bc5dc0ea1fc57012_task_run_text_output import GatewayDefBc5dc0ea1fc57012TaskRunTextOutput as GatewayDefBc5dc0ea1fc57012TaskRunTextOutput +from nimble_client.models.gateway_def_c0fe0f39c374a83b_task_run_progress_stats_event import GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent as GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent +from nimble_client.models.gateway_def_ce9019f9e67ae903_trust_source import GatewayDefCe9019f9e67ae903TrustSource as GatewayDefCe9019f9e67ae903TrustSource +from nimble_client.models.gateway_def_d1833882d7d67018_task_run_state_event_run import GatewayDefD1833882d7d67018TaskRunStateEventRun as GatewayDefD1833882d7d67018TaskRunStateEventRun +from nimble_client.models.gateway_def_dc279d13fafb2038_task_run_json_output import GatewayDefDc279d13fafb2038TaskRunJsonOutput as GatewayDefDc279d13fafb2038TaskRunJsonOutput +from nimble_client.models.gateway_def_eb0114a225123d8d_json_run_trust import GatewayDefEb0114a225123d8dJsonRunTrust as GatewayDefEb0114a225123d8dJsonRunTrust +from nimble_client.models.gateway_def_f23bf5d9e6e07ed3_trust_citation import GatewayDefF23bf5d9e6e07ed3TrustCitation as GatewayDefF23bf5d9e6e07ed3TrustCitation +from nimble_client.models.gateway_def_fb397fec4dcf2a13_text_claim_trust import GatewayDefFb397fec4dcf2a13TextClaimTrust as GatewayDefFb397fec4dcf2a13TextClaimTrust +from nimble_client.models.gateway_def_fd08b460e1d38459_task_run_state_event import GatewayDefFd08b460e1d38459TaskRunStateEvent as GatewayDefFd08b460e1d38459TaskRunStateEvent +from nimble_client.models.get_cookies_action import GetCookiesAction as GetCookiesAction +from nimble_client.models.get_cookies_action_get_cookies import GetCookiesActionGetCookies as GetCookiesActionGetCookies +from nimble_client.models.get_cookies_action_get_cookies_one_of import GetCookiesActionGetCookiesOneOf as GetCookiesActionGetCookiesOneOf +from nimble_client.models.get_domain_knowledge_driver400_response import GetDomainKnowledgeDriver400Response as GetDomainKnowledgeDriver400Response +from nimble_client.models.goto_action import GotoAction as GotoAction +from nimble_client.models.goto_action_goto import GotoActionGoto as GotoActionGoto +from nimble_client.models.goto_action_goto_one_of import GotoActionGotoOneOf as GotoActionGotoOneOf +from nimble_client.models.http_validation_error import HTTPValidationError as HTTPValidationError +from nimble_client.models.input_data import InputData as InputData +from nimble_client.models.job_context_public_v1 import JobContextPublicV1 as JobContextPublicV1 +from nimble_client.models.job_context_public_v2 import JobContextPublicV2 as JobContextPublicV2 +from nimble_client.models.job_destination_public_v1 import JobDestinationPublicV1 as JobDestinationPublicV1 +from nimble_client.models.job_destination_public_v2 import JobDestinationPublicV2 as JobDestinationPublicV2 +from nimble_client.models.job_inputs_public_v1 import JobInputsPublicV1 as JobInputsPublicV1 +from nimble_client.models.job_inputs_public_v2 import JobInputsPublicV2 as JobInputsPublicV2 +from nimble_client.models.job_list_filter_public_v2 import JobListFilterPublicV2 as JobListFilterPublicV2 +from nimble_client.models.job_list_public_v1 import JobListPublicV1 as JobListPublicV1 +from nimble_client.models.job_public_v1 import JobPublicV1 as JobPublicV1 +from nimble_client.models.job_public_v2 import JobPublicV2 as JobPublicV2 +from nimble_client.models.job_run_cancel_response_public_v1 import JobRunCancelResponsePublicV1 as JobRunCancelResponsePublicV1 +from nimble_client.models.job_run_cancel_response_public_v2 import JobRunCancelResponsePublicV2 as JobRunCancelResponsePublicV2 +from nimble_client.models.job_run_detail_public_v1 import JobRunDetailPublicV1 as JobRunDetailPublicV1 +from nimble_client.models.job_run_detail_public_v2 import JobRunDetailPublicV2 as JobRunDetailPublicV2 +from nimble_client.models.job_run_error_public_v1 import JobRunErrorPublicV1 as JobRunErrorPublicV1 +from nimble_client.models.job_run_error_public_v2 import JobRunErrorPublicV2 as JobRunErrorPublicV2 +from nimble_client.models.job_run_list_filter_public_v2 import JobRunListFilterPublicV2 as JobRunListFilterPublicV2 +from nimble_client.models.job_run_list_public_v1 import JobRunListPublicV1 as JobRunListPublicV1 +from nimble_client.models.job_run_public_v1 import JobRunPublicV1 as JobRunPublicV1 +from nimble_client.models.job_run_public_v2 import JobRunPublicV2 as JobRunPublicV2 +from nimble_client.models.job_run_summary_public_v1 import JobRunSummaryPublicV1 as JobRunSummaryPublicV1 +from nimble_client.models.job_run_summary_public_v2 import JobRunSummaryPublicV2 as JobRunSummaryPublicV2 +from nimble_client.models.job_schedule_public_v1 import JobSchedulePublicV1 as JobSchedulePublicV1 +from nimble_client.models.job_schedule_public_v2 import JobSchedulePublicV2 as JobSchedulePublicV2 +from nimble_client.models.json_claim_trust import JsonClaimTrust as JsonClaimTrust +from nimble_client.models.json_patch_op import JsonPatchOp as JsonPatchOp +from nimble_client.models.json_run_trust import JsonRunTrust as JsonRunTrust +from nimble_client.models.list_response_extract_template_response_public_v2 import ListResponseExtractTemplateResponsePublicV2 as ListResponseExtractTemplateResponsePublicV2 +from nimble_client.models.list_response_extract_template_version_response_public_v2 import ListResponseExtractTemplateVersionResponsePublicV2 as ListResponseExtractTemplateVersionResponsePublicV2 +from nimble_client.models.list_response_job_public_v2 import ListResponseJobPublicV2 as ListResponseJobPublicV2 +from nimble_client.models.list_response_job_run_public_v2 import ListResponseJobRunPublicV2 as ListResponseJobRunPublicV2 +from nimble_client.models.list_response_task_run_response_public_v1 import ListResponseTaskRunResponsePublicV1 as ListResponseTaskRunResponsePublicV1 +from nimble_client.models.list_response_task_run_response_public_v2 import ListResponseTaskRunResponsePublicV2 as ListResponseTaskRunResponsePublicV2 +from nimble_client.models.list_response_web_search_agent_response_public_v1 import ListResponseWebSearchAgentResponsePublicV1 as ListResponseWebSearchAgentResponsePublicV1 +from nimble_client.models.list_response_web_search_agent_response_public_v2 import ListResponseWebSearchAgentResponsePublicV2 as ListResponseWebSearchAgentResponsePublicV2 +from nimble_client.models.list_response_web_search_agent_template_response_public_v1 import ListResponseWebSearchAgentTemplateResponsePublicV1 as ListResponseWebSearchAgentTemplateResponsePublicV1 +from nimble_client.models.list_response_web_search_agent_template_response_public_v2 import ListResponseWebSearchAgentTemplateResponsePublicV2 as ListResponseWebSearchAgentTemplateResponsePublicV2 +from nimble_client.models.location_inner import LocationInner as LocationInner +from nimble_client.models.managed_by import ManagedBy as ManagedBy +from nimble_client.models.map_payload import MapPayload as MapPayload +from nimble_client.models.map_response import MapResponse as MapResponse +from nimble_client.models.map_response_links_inner import MapResponseLinksInner as MapResponseLinksInner +from nimble_client.models.media_async_payload import MediaAsyncPayload as MediaAsyncPayload +from nimble_client.models.media_async_payload_all_of_media_extractor_options import MediaAsyncPayloadAllOfMediaExtractorOptions as MediaAsyncPayloadAllOfMediaExtractorOptions +from nimble_client.models.media_async_payload_all_of_storage import MediaAsyncPayloadAllOfStorage as MediaAsyncPayloadAllOfStorage +from nimble_client.models.media_async_response import MediaAsyncResponse as MediaAsyncResponse +from nimble_client.models.media_payload import MediaPayload as MediaPayload +from nimble_client.models.media_payload_media_extractor_options import MediaPayloadMediaExtractorOptions as MediaPayloadMediaExtractorOptions +from nimble_client.models.metadata import Metadata as Metadata +from nimble_client.models.metadata_filter_public_v2 import MetadataFilterPublicV2 as MetadataFilterPublicV2 +from nimble_client.models.output import Output as Output +from nimble_client.models.output1 import Output1 as Output1 +from nimble_client.models.output2 import Output2 as Output2 +from nimble_client.models.output3 import Output3 as Output3 +from nimble_client.models.parsing_error_result import ParsingErrorResult as ParsingErrorResult +from nimble_client.models.parsing_success_result import ParsingSuccessResult as ParsingSuccessResult +from nimble_client.models.parsing_type import ParsingType as ParsingType +from nimble_client.models.press_action import PressAction as PressAction +from nimble_client.models.press_action_press import PressActionPress as PressActionPress +from nimble_client.models.press_action_press_one_of import PressActionPressOneOf as PressActionPressOneOf +from nimble_client.models.privacy_filter_public_v1 import PrivacyFilterPublicV1 as PrivacyFilterPublicV1 +from nimble_client.models.privacy_filter_public_v2 import PrivacyFilterPublicV2 as PrivacyFilterPublicV2 +from nimble_client.models.privacy_level_public_v2 import PrivacyLevelPublicV2 as PrivacyLevelPublicV2 +from nimble_client.models.request import Request as Request +from nimble_client.models.response_get_run_result_public_v2_api_v2_public_web_search_agents_agent_id_runs_run_id_result_get import ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet as ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet +from nimble_client.models.result_model import ResultModel as ResultModel +from nimble_client.models.revenue_annual import RevenueAnnual as RevenueAnnual +from nimble_client.models.run_extract_template200_response import RunExtractTemplate200Response as RunExtractTemplate200Response +from nimble_client.models.run_extract_template200_response_data import RunExtractTemplate200ResponseData as RunExtractTemplate200ResponseData +from nimble_client.models.run_extract_template200_response_data_browser_actions import RunExtractTemplate200ResponseDataBrowserActions as RunExtractTemplate200ResponseDataBrowserActions +from nimble_client.models.run_extract_template200_response_data_browser_actions_results_inner import RunExtractTemplate200ResponseDataBrowserActionsResultsInner as RunExtractTemplate200ResponseDataBrowserActionsResultsInner +from nimble_client.models.run_extract_template200_response_data_network_capture_inner import RunExtractTemplate200ResponseDataNetworkCaptureInner as RunExtractTemplate200ResponseDataNetworkCaptureInner +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_filter import RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter as RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_filter_url import RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl as RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_results_inner import RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner as RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_results_inner_request import RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest as RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_results_inner_response import RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse as RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse +from nimble_client.models.run_extract_template200_response_data_redirects_inner import RunExtractTemplate200ResponseDataRedirectsInner as RunExtractTemplate200ResponseDataRedirectsInner +from nimble_client.models.run_extract_template200_response_debug import RunExtractTemplate200ResponseDebug as RunExtractTemplate200ResponseDebug +from nimble_client.models.run_extract_template200_response_metadata import RunExtractTemplate200ResponseMetadata as RunExtractTemplate200ResponseMetadata +from nimble_client.models.run_extract_template200_response_pagination import RunExtractTemplate200ResponsePagination as RunExtractTemplate200ResponsePagination +from nimble_client.models.run_extract_template404_response import RunExtractTemplate404Response as RunExtractTemplate404Response +from nimble_client.models.run_extract_template_async200_response import RunExtractTemplateAsync200Response as RunExtractTemplateAsync200Response +from nimble_client.models.run_extract_template_async_request import RunExtractTemplateAsyncRequest as RunExtractTemplateAsyncRequest +from nimble_client.models.run_stats_public_v2 import RunStatsPublicV2 as RunStatsPublicV2 +from nimble_client.models.serp_metadata import SERPMetadata as SERPMetadata +from nimble_client.models.safe_search import SafeSearch as SafeSearch +from nimble_client.models.screenshot_action import ScreenshotAction as ScreenshotAction +from nimble_client.models.screenshot_action_screenshot import ScreenshotActionScreenshot as ScreenshotActionScreenshot +from nimble_client.models.screenshot_action_screenshot_one_of import ScreenshotActionScreenshotOneOf as ScreenshotActionScreenshotOneOf +from nimble_client.models.scroll_action import ScrollAction as ScrollAction +from nimble_client.models.scroll_action_scroll import ScrollActionScroll as ScrollActionScroll +from nimble_client.models.scroll_action_scroll_one_of import ScrollActionScrollOneOf as ScrollActionScrollOneOf +from nimble_client.models.sdk_string_variant7a06ddd6b0fd import SdkStringVariant7a06ddd6b0fd as SdkStringVariant7a06ddd6b0fd +from nimble_client.models.search_depth import SearchDepth as SearchDepth +from nimble_client.models.search_request import SearchRequest as SearchRequest +from nimble_client.models.search_response import SearchResponse as SearchResponse +from nimble_client.models.selector import Selector as Selector +from nimble_client.models.serp_async_response import SerpAsyncResponse as SerpAsyncResponse +from nimble_client.models.serp_batch_payload import SerpBatchPayload as SerpBatchPayload +from nimble_client.models.serp_batch_payload_inputs_inner import SerpBatchPayloadInputsInner as SerpBatchPayloadInputsInner +from nimble_client.models.serp_batch_payload_shared_inputs import SerpBatchPayloadSharedInputs as SerpBatchPayloadSharedInputs +from nimble_client.models.serp_batch_response import SerpBatchResponse as SerpBatchResponse +from nimble_client.models.serp_payload import SerpPayload as SerpPayload +from nimble_client.models.stream_agent_run_events200_response import StreamAgentRunEvents200Response as StreamAgentRunEvents200Response +from nimble_client.models.submit_async_extract_request import SubmitAsyncExtractRequest as SubmitAsyncExtractRequest +from nimble_client.models.submit_async_serp_request import SubmitAsyncSerpRequest as SubmitAsyncSerpRequest +from nimble_client.models.task_error_response import TaskErrorResponse as TaskErrorResponse +from nimble_client.models.task_failed_response import TaskFailedResponse as TaskFailedResponse +from nimble_client.models.task_failed_response_task import TaskFailedResponseTask as TaskFailedResponseTask +from nimble_client.models.task_list_response import TaskListResponse as TaskListResponse +from nimble_client.models.task_list_response_pagination import TaskListResponsePagination as TaskListResponsePagination +from nimble_client.models.task_not_found_error_response import TaskNotFoundErrorResponse as TaskNotFoundErrorResponse +from nimble_client.models.task_pending_response import TaskPendingResponse as TaskPendingResponse +from nimble_client.models.task_progress import TaskProgress as TaskProgress +from nimble_client.models.task_response_schema import TaskResponseSchema as TaskResponseSchema +from nimble_client.models.task_response_schema_task import TaskResponseSchemaTask as TaskResponseSchemaTask +from nimble_client.models.task_run_error_public_v1 import TaskRunErrorPublicV1 as TaskRunErrorPublicV1 +from nimble_client.models.task_run_error_public_v2 import TaskRunErrorPublicV2 as TaskRunErrorPublicV2 +from nimble_client.models.task_run_failed_result_public_v1 import TaskRunFailedResultPublicV1 as TaskRunFailedResultPublicV1 +from nimble_client.models.task_run_failed_result_public_v2 import TaskRunFailedResultPublicV2 as TaskRunFailedResultPublicV2 +from nimble_client.models.task_run_json_output_public_v1 import TaskRunJsonOutputPublicV1 as TaskRunJsonOutputPublicV1 +from nimble_client.models.task_run_json_output_public_v2 import TaskRunJsonOutputPublicV2 as TaskRunJsonOutputPublicV2 +from nimble_client.models.task_run_response_public_v1 import TaskRunResponsePublicV1 as TaskRunResponsePublicV1 +from nimble_client.models.task_run_response_public_v2 import TaskRunResponsePublicV2 as TaskRunResponsePublicV2 +from nimble_client.models.task_run_result_public_v1 import TaskRunResultPublicV1 as TaskRunResultPublicV1 +from nimble_client.models.task_run_result_public_v2 import TaskRunResultPublicV2 as TaskRunResultPublicV2 +from nimble_client.models.task_run_text_output_public_v1 import TaskRunTextOutputPublicV1 as TaskRunTextOutputPublicV1 +from nimble_client.models.task_run_text_output_public_v2 import TaskRunTextOutputPublicV2 as TaskRunTextOutputPublicV2 +from nimble_client.models.template_feature_flags_public_v1 import TemplateFeatureFlagsPublicV1 as TemplateFeatureFlagsPublicV1 +from nimble_client.models.template_generation_response_public_v1 import TemplateGenerationResponsePublicV1 as TemplateGenerationResponsePublicV1 +from nimble_client.models.template_input_property_public_v1 import TemplateInputPropertyPublicV1 as TemplateInputPropertyPublicV1 +from nimble_client.models.template_public_v1 import TemplatePublicV1 as TemplatePublicV1 +from nimble_client.models.template_sample_public_v1 import TemplateSamplePublicV1 as TemplateSamplePublicV1 +from nimble_client.models.template_version_metadata_public_v1 import TemplateVersionMetadataPublicV1 as TemplateVersionMetadataPublicV1 +from nimble_client.models.template_version_response_public_v1 import TemplateVersionResponsePublicV1 as TemplateVersionResponsePublicV1 +from nimble_client.models.text_claim_trust import TextClaimTrust as TextClaimTrust +from nimble_client.models.text_run_trust import TextRunTrust as TextRunTrust +from nimble_client.models.time_range import TimeRange as TimeRange +from nimble_client.models.trigger_job_run_request_public_v1 import TriggerJobRunRequestPublicV1 as TriggerJobRunRequestPublicV1 +from nimble_client.models.trigger_job_run_request_public_v2 import TriggerJobRunRequestPublicV2 as TriggerJobRunRequestPublicV2 +from nimble_client.models.trust_citation import TrustCitation as TrustCitation +from nimble_client.models.trust_mode import TrustMode as TrustMode +from nimble_client.models.trust_source import TrustSource as TrustSource +from nimble_client.models.update_job_request_public_v1 import UpdateJobRequestPublicV1 as UpdateJobRequestPublicV1 +from nimble_client.models.update_job_request_public_v2 import UpdateJobRequestPublicV2 as UpdateJobRequestPublicV2 +from nimble_client.models.usage_catalog_configuration_public_v2 import UsageCatalogConfigurationPublicV2 as UsageCatalogConfigurationPublicV2 +from nimble_client.models.usage_catalog_product_public_v2 import UsageCatalogProductPublicV2 as UsageCatalogProductPublicV2 +from nimble_client.models.usage_catalog_public_v2 import UsageCatalogPublicV2 as UsageCatalogPublicV2 +from nimble_client.models.usage_catalog_service_public_v2 import UsageCatalogServicePublicV2 as UsageCatalogServicePublicV2 +from nimble_client.models.usage_configuration_name_public_v2 import UsageConfigurationNamePublicV2 as UsageConfigurationNamePublicV2 +from nimble_client.models.usage_dimensions_public_v2 import UsageDimensionsPublicV2 as UsageDimensionsPublicV2 +from nimble_client.models.usage_meta_public_v2 import UsageMetaPublicV2 as UsageMetaPublicV2 +from nimble_client.models.usage_metrics_public_v2 import UsageMetricsPublicV2 as UsageMetricsPublicV2 +from nimble_client.models.usage_name_public_v2 import UsageNamePublicV2 as UsageNamePublicV2 +from nimble_client.models.usage_response_public_v2 import UsageResponsePublicV2 as UsageResponsePublicV2 +from nimble_client.models.usage_row_public_v2 import UsageRowPublicV2 as UsageRowPublicV2 +from nimble_client.models.validation_error import ValidationError as ValidationError +from nimble_client.models.visits import Visits as Visits +from nimble_client.models.visits_monthly import VisitsMonthly as VisitsMonthly +from nimble_client.models.wsa_metadata import WSAMetadata as WSAMetadata +from nimble_client.models.wait_action import WaitAction as WaitAction +from nimble_client.models.wait_action_wait import WaitActionWait as WaitActionWait +from nimble_client.models.wait_action_wait_one_of import WaitActionWaitOneOf as WaitActionWaitOneOf +from nimble_client.models.wait_for_element_action import WaitForElementAction as WaitForElementAction +from nimble_client.models.wait_for_element_action_wait_for_element import WaitForElementActionWaitForElement as WaitForElementActionWaitForElement +from nimble_client.models.wait_for_element_action_wait_for_element_one_of import WaitForElementActionWaitForElementOneOf as WaitForElementActionWaitForElementOneOf +from nimble_client.models.wait_for_navigation_action import WaitForNavigationAction as WaitForNavigationAction +from nimble_client.models.wait_for_navigation_action_wait_for_navigation import WaitForNavigationActionWaitForNavigation as WaitForNavigationActionWaitForNavigation +from nimble_client.models.wait_for_navigation_action_wait_for_navigation_one_of import WaitForNavigationActionWaitForNavigationOneOf as WaitForNavigationActionWaitForNavigationOneOf +from nimble_client.models.web_search_agent_create_request_public_v1 import WebSearchAgentCreateRequestPublicV1 as WebSearchAgentCreateRequestPublicV1 +from nimble_client.models.web_search_agent_create_request_public_v2 import WebSearchAgentCreateRequestPublicV2 as WebSearchAgentCreateRequestPublicV2 +from nimble_client.models.web_search_agent_goal_response_public_v1 import WebSearchAgentGoalResponsePublicV1 as WebSearchAgentGoalResponsePublicV1 +from nimble_client.models.web_search_agent_goal_response_public_v2 import WebSearchAgentGoalResponsePublicV2 as WebSearchAgentGoalResponsePublicV2 +from nimble_client.models.web_search_agent_response_public_v1 import WebSearchAgentResponsePublicV1 as WebSearchAgentResponsePublicV1 +from nimble_client.models.web_search_agent_response_public_v2 import WebSearchAgentResponsePublicV2 as WebSearchAgentResponsePublicV2 +from nimble_client.models.web_search_agent_run_create_request_public_v1 import WebSearchAgentRunCreateRequestPublicV1 as WebSearchAgentRunCreateRequestPublicV1 +from nimble_client.models.web_search_agent_run_create_request_public_v2 import WebSearchAgentRunCreateRequestPublicV2 as WebSearchAgentRunCreateRequestPublicV2 +from nimble_client.models.web_search_agent_run_memory_config_public_v2 import WebSearchAgentRunMemoryConfigPublicV2 as WebSearchAgentRunMemoryConfigPublicV2 +from nimble_client.models.web_search_agent_source_create_request_public_v1 import WebSearchAgentSourceCreateRequestPublicV1 as WebSearchAgentSourceCreateRequestPublicV1 +from nimble_client.models.web_search_agent_source_create_request_public_v2 import WebSearchAgentSourceCreateRequestPublicV2 as WebSearchAgentSourceCreateRequestPublicV2 +from nimble_client.models.web_search_agent_source_response_public_v1 import WebSearchAgentSourceResponsePublicV1 as WebSearchAgentSourceResponsePublicV1 +from nimble_client.models.web_search_agent_source_response_public_v2 import WebSearchAgentSourceResponsePublicV2 as WebSearchAgentSourceResponsePublicV2 +from nimble_client.models.web_search_agent_suggested_question_response_public_v1 import WebSearchAgentSuggestedQuestionResponsePublicV1 as WebSearchAgentSuggestedQuestionResponsePublicV1 +from nimble_client.models.web_search_agent_suggested_question_response_public_v2 import WebSearchAgentSuggestedQuestionResponsePublicV2 as WebSearchAgentSuggestedQuestionResponsePublicV2 +from nimble_client.models.web_search_agent_template_response_public_v1 import WebSearchAgentTemplateResponsePublicV1 as WebSearchAgentTemplateResponsePublicV1 +from nimble_client.models.web_search_agent_template_response_public_v2 import WebSearchAgentTemplateResponsePublicV2 as WebSearchAgentTemplateResponsePublicV2 +from nimble_client.models.web_search_agent_use_case import WebSearchAgentUseCase as WebSearchAgentUseCase +from nimble_client.models.web_traffic_month import WebTrafficMonth as WebTrafficMonth +from nimble_client.models.workforce_total import WorkforceTotal as WorkforceTotal + diff --git a/candidate/generated/nimble_client/api/__init__.py b/candidate/generated/nimble_client/api/__init__.py new file mode 100644 index 0000000..45430f5 --- /dev/null +++ b/candidate/generated/nimble_client/api/__init__.py @@ -0,0 +1,17 @@ +# flake8: noqa + +# import apis into api package +from nimble_client.api.batches_api import BatchesApi +from nimble_client.api.crawl_api import CrawlApi +from nimble_client.api.domain_knowledge_api import DomainKnowledgeApi +from nimble_client.api.extract_api import ExtractApi +from nimble_client.api.extract_templates_public_api import ExtractTemplatesPublicApi +from nimble_client.api.extraction_templates_api import ExtractionTemplatesApi +from nimble_client.api.jobs_public_v2_api import JobsPublicV2Api +from nimble_client.api.map_api import MapApi +from nimble_client.api.media_api import MediaApi +from nimble_client.api.public_api_api import PublicAPIApi +from nimble_client.api.serp_api import SERPApi +from nimble_client.api.search_api import SearchApi +from nimble_client.api.tasks_api import TasksApi + diff --git a/candidate/generated/nimble_client/api/batches_api.py b/candidate/generated/nimble_client/api/batches_api.py new file mode 100644 index 0000000..bff9c8f --- /dev/null +++ b/candidate/generated/nimble_client/api/batches_api.py @@ -0,0 +1,805 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from nimble_client.models.batch_get_response import BatchGetResponse +from nimble_client.models.batch_progress_response import BatchProgressResponse + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class BatchesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_batch( + self, + batch_id: Annotated[StrictStr, Field(description="The unique identifier of the batch.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BatchGetResponse: + """Get batch details + + Retrieve the details of a batch including all its tasks and completion status. + + :param batch_id: The unique identifier of the batch. (required) + :type batch_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_batch_serialize( + batch_id=batch_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BatchGetResponse", + '404': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_batch_with_http_info( + self, + batch_id: Annotated[StrictStr, Field(description="The unique identifier of the batch.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BatchGetResponse]: + """Get batch details + + Retrieve the details of a batch including all its tasks and completion status. + + :param batch_id: The unique identifier of the batch. (required) + :type batch_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_batch_serialize( + batch_id=batch_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BatchGetResponse", + '404': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_batch_without_preload_content( + self, + batch_id: Annotated[StrictStr, Field(description="The unique identifier of the batch.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get batch details + + Retrieve the details of a batch including all its tasks and completion status. + + :param batch_id: The unique identifier of the batch. (required) + :type batch_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_batch_serialize( + batch_id=batch_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BatchGetResponse", + '404': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_batch_serialize( + self, + batch_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if batch_id is not None: + _path_params['batch_id'] = batch_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/batches/{batch_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_batch_progress( + self, + batch_id: Annotated[StrictStr, Field(description="The unique identifier of the batch.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BatchProgressResponse: + """Get batch progress + + Retrieve lightweight progress information for a batch without fetching all task details. + + :param batch_id: The unique identifier of the batch. (required) + :type batch_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_batch_progress_serialize( + batch_id=batch_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BatchProgressResponse", + '404': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_batch_progress_with_http_info( + self, + batch_id: Annotated[StrictStr, Field(description="The unique identifier of the batch.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BatchProgressResponse]: + """Get batch progress + + Retrieve lightweight progress information for a batch without fetching all task details. + + :param batch_id: The unique identifier of the batch. (required) + :type batch_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_batch_progress_serialize( + batch_id=batch_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BatchProgressResponse", + '404': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_batch_progress_without_preload_content( + self, + batch_id: Annotated[StrictStr, Field(description="The unique identifier of the batch.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get batch progress + + Retrieve lightweight progress information for a batch without fetching all task details. + + :param batch_id: The unique identifier of the batch. (required) + :type batch_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_batch_progress_serialize( + batch_id=batch_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BatchProgressResponse", + '404': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_batch_progress_serialize( + self, + batch_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if batch_id is not None: + _path_params['batch_id'] = batch_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/batches/{batch_id}/progress', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_batches( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """List batches + + Retrieve a paginated list of batches for the authenticated account. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_batches_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_batches_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """List batches + + Retrieve a paginated list of batches for the authenticated account. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_batches_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_batches_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List batches + + Retrieve a paginated list of batches for the authenticated account. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_batches_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_batches_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/batches', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/crawl_api.py b/candidate/generated/nimble_client/api/crawl_api.py new file mode 100644 index 0000000..81010fa --- /dev/null +++ b/candidate/generated/nimble_client/api/crawl_api.py @@ -0,0 +1,1126 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from uuid import UUID +from nimble_client.models.crawl_api_response import CrawlApiResponse +from nimble_client.models.crawl_by_filters_response import CrawlByFiltersResponse +from nimble_client.models.crawl_payload import CrawlPayload +from nimble_client.models.delete_crawl200_response import DeleteCrawl200Response + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class CrawlApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_crawl( + self, + crawl_payload: Optional[CrawlPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CrawlApiResponse: + """Create crawl task + + + :param crawl_payload: + :type crawl_payload: CrawlPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_crawl_serialize( + crawl_payload=crawl_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CrawlApiResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_crawl_with_http_info( + self, + crawl_payload: Optional[CrawlPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CrawlApiResponse]: + """Create crawl task + + + :param crawl_payload: + :type crawl_payload: CrawlPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_crawl_serialize( + crawl_payload=crawl_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CrawlApiResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_crawl_without_preload_content( + self, + crawl_payload: Optional[CrawlPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create crawl task + + + :param crawl_payload: + :type crawl_payload: CrawlPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_crawl_serialize( + crawl_payload=crawl_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CrawlApiResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_crawl_serialize( + self, + crawl_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if crawl_payload is not None: + _body_params = crawl_payload + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/crawl', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_crawl( + self, + id: Annotated[UUID, Field(description="The unique identifier of the crawl task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeleteCrawl200Response: + """Cancel Crawl + + + :param id: The unique identifier of the crawl task. (required) + :type id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_crawl_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeleteCrawl200Response", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_crawl_with_http_info( + self, + id: Annotated[UUID, Field(description="The unique identifier of the crawl task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DeleteCrawl200Response]: + """Cancel Crawl + + + :param id: The unique identifier of the crawl task. (required) + :type id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_crawl_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeleteCrawl200Response", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_crawl_without_preload_content( + self, + id: Annotated[UUID, Field(description="The unique identifier of the crawl task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Cancel Crawl + + + :param id: The unique identifier of the crawl task. (required) + :type id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_crawl_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeleteCrawl200Response", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_crawl_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/crawl/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_crawl( + self, + id: Annotated[UUID, Field(description="The unique identifier of the crawl task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CrawlApiResponse: + """Get crawl data + + + :param id: The unique identifier of the crawl task. (required) + :type id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_crawl_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CrawlApiResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_crawl_with_http_info( + self, + id: Annotated[UUID, Field(description="The unique identifier of the crawl task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CrawlApiResponse]: + """Get crawl data + + + :param id: The unique identifier of the crawl task. (required) + :type id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_crawl_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CrawlApiResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_crawl_without_preload_content( + self, + id: Annotated[UUID, Field(description="The unique identifier of the crawl task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get crawl data + + + :param id: The unique identifier of the crawl task. (required) + :type id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_crawl_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CrawlApiResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_crawl_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/crawl/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_crawls( + self, + status: Annotated[Optional[StrictStr], Field(description="Filter crawls by their status.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="Cursor for pagination.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]], Field(description="Number of crawls to return per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CrawlByFiltersResponse: + """Crawl by Filter + + + :param status: Filter crawls by their status. + :type status: str + :param cursor: Cursor for pagination. + :type cursor: str + :param limit: Number of crawls to return per page. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_crawls_serialize( + status=status, + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CrawlByFiltersResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_crawls_with_http_info( + self, + status: Annotated[Optional[StrictStr], Field(description="Filter crawls by their status.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="Cursor for pagination.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]], Field(description="Number of crawls to return per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CrawlByFiltersResponse]: + """Crawl by Filter + + + :param status: Filter crawls by their status. + :type status: str + :param cursor: Cursor for pagination. + :type cursor: str + :param limit: Number of crawls to return per page. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_crawls_serialize( + status=status, + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CrawlByFiltersResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_crawls_without_preload_content( + self, + status: Annotated[Optional[StrictStr], Field(description="Filter crawls by their status.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="Cursor for pagination.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]], Field(description="Number of crawls to return per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Crawl by Filter + + + :param status: Filter crawls by their status. + :type status: str + :param cursor: Cursor for pagination. + :type cursor: str + :param limit: Number of crawls to return per page. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_crawls_serialize( + status=status, + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CrawlByFiltersResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_crawls_serialize( + self, + status, + cursor, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if status is not None: + + _query_params.append(('status', status)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/crawl', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/domain_knowledge_api.py b/candidate/generated/nimble_client/api/domain_knowledge_api.py new file mode 100644 index 0000000..e5eb5fd --- /dev/null +++ b/candidate/generated/nimble_client/api/domain_knowledge_api.py @@ -0,0 +1,324 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from nimble_client.models.driver_resolution_response import DriverResolutionResponse + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class DomainKnowledgeApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_domain_knowledge_driver( + self, + url: Annotated[Optional[StrictStr], Field(description="Target domain to resolve driver for (e.g. amazon.com).")] = None, + agent: Annotated[Optional[StrictStr], Field(description="Agent name to resolve driver for (e.g. nimble-ecommerce).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DriverResolutionResponse: + """Get Driver + + Resolves the suggested driver for a given URL or agent name. Exactly one of `url` or `agent` must be provided. + + :param url: Target domain to resolve driver for (e.g. amazon.com). + :type url: str + :param agent: Agent name to resolve driver for (e.g. nimble-ecommerce). + :type agent: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_domain_knowledge_driver_serialize( + url=url, + agent=agent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DriverResolutionResponse", + '400': "GetDomainKnowledgeDriver400Response", + '404': "GetDomainKnowledgeDriver400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_domain_knowledge_driver_with_http_info( + self, + url: Annotated[Optional[StrictStr], Field(description="Target domain to resolve driver for (e.g. amazon.com).")] = None, + agent: Annotated[Optional[StrictStr], Field(description="Agent name to resolve driver for (e.g. nimble-ecommerce).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DriverResolutionResponse]: + """Get Driver + + Resolves the suggested driver for a given URL or agent name. Exactly one of `url` or `agent` must be provided. + + :param url: Target domain to resolve driver for (e.g. amazon.com). + :type url: str + :param agent: Agent name to resolve driver for (e.g. nimble-ecommerce). + :type agent: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_domain_knowledge_driver_serialize( + url=url, + agent=agent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DriverResolutionResponse", + '400': "GetDomainKnowledgeDriver400Response", + '404': "GetDomainKnowledgeDriver400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_domain_knowledge_driver_without_preload_content( + self, + url: Annotated[Optional[StrictStr], Field(description="Target domain to resolve driver for (e.g. amazon.com).")] = None, + agent: Annotated[Optional[StrictStr], Field(description="Agent name to resolve driver for (e.g. nimble-ecommerce).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Driver + + Resolves the suggested driver for a given URL or agent name. Exactly one of `url` or `agent` must be provided. + + :param url: Target domain to resolve driver for (e.g. amazon.com). + :type url: str + :param agent: Agent name to resolve driver for (e.g. nimble-ecommerce). + :type agent: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_domain_knowledge_driver_serialize( + url=url, + agent=agent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DriverResolutionResponse", + '400': "GetDomainKnowledgeDriver400Response", + '404': "GetDomainKnowledgeDriver400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_domain_knowledge_driver_serialize( + self, + url, + agent, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if url is not None: + + _query_params.append(('url', url)) + + if agent is not None: + + _query_params.append(('agent', agent)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/domain-knowledge/driver', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/extract_api.py b/candidate/generated/nimble_client/api/extract_api.py new file mode 100644 index 0000000..e8821e3 --- /dev/null +++ b/candidate/generated/nimble_client/api/extract_api.py @@ -0,0 +1,854 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from typing import Optional +from nimble_client.models.extract200_response import Extract200Response +from nimble_client.models.extract_async_response import ExtractAsyncResponse +from nimble_client.models.extract_batch_payload import ExtractBatchPayload +from nimble_client.models.extract_batch_response import ExtractBatchResponse +from nimble_client.models.extract_payload import ExtractPayload +from nimble_client.models.submit_async_extract_request import SubmitAsyncExtractRequest + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class ExtractApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def extract( + self, + extract_payload: Optional[ExtractPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Extract200Response: + """Extract + + + :param extract_payload: + :type extract_payload: ExtractPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._extract_serialize( + extract_payload=extract_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Extract200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def extract_with_http_info( + self, + extract_payload: Optional[ExtractPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Extract200Response]: + """Extract + + + :param extract_payload: + :type extract_payload: ExtractPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._extract_serialize( + extract_payload=extract_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Extract200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def extract_without_preload_content( + self, + extract_payload: Optional[ExtractPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Extract + + + :param extract_payload: + :type extract_payload: ExtractPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._extract_serialize( + extract_payload=extract_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Extract200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _extract_serialize( + self, + extract_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if extract_payload is not None: + _body_params = extract_payload + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/extract', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def submit_async_extract( + self, + submit_async_extract_request: Optional[SubmitAsyncExtractRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExtractAsyncResponse: + """Extract Async Endpoint + + + :param submit_async_extract_request: + :type submit_async_extract_request: SubmitAsyncExtractRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_async_extract_serialize( + submit_async_extract_request=submit_async_extract_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractAsyncResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def submit_async_extract_with_http_info( + self, + submit_async_extract_request: Optional[SubmitAsyncExtractRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExtractAsyncResponse]: + """Extract Async Endpoint + + + :param submit_async_extract_request: + :type submit_async_extract_request: SubmitAsyncExtractRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_async_extract_serialize( + submit_async_extract_request=submit_async_extract_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractAsyncResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def submit_async_extract_without_preload_content( + self, + submit_async_extract_request: Optional[SubmitAsyncExtractRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Extract Async Endpoint + + + :param submit_async_extract_request: + :type submit_async_extract_request: SubmitAsyncExtractRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_async_extract_serialize( + submit_async_extract_request=submit_async_extract_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractAsyncResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _submit_async_extract_serialize( + self, + submit_async_extract_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if submit_async_extract_request is not None: + _body_params = submit_async_extract_request + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/extract/async', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def submit_batch_extract( + self, + extract_batch_payload: Optional[ExtractBatchPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExtractBatchResponse: + """Extract Batch Endpoint + + + :param extract_batch_payload: + :type extract_batch_payload: ExtractBatchPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_batch_extract_serialize( + extract_batch_payload=extract_batch_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractBatchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def submit_batch_extract_with_http_info( + self, + extract_batch_payload: Optional[ExtractBatchPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExtractBatchResponse]: + """Extract Batch Endpoint + + + :param extract_batch_payload: + :type extract_batch_payload: ExtractBatchPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_batch_extract_serialize( + extract_batch_payload=extract_batch_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractBatchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def submit_batch_extract_without_preload_content( + self, + extract_batch_payload: Optional[ExtractBatchPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Extract Batch Endpoint + + + :param extract_batch_payload: + :type extract_batch_payload: ExtractBatchPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_batch_extract_serialize( + extract_batch_payload=extract_batch_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractBatchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _submit_batch_extract_serialize( + self, + extract_batch_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if extract_batch_payload is not None: + _body_params = extract_batch_payload + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/extract/batch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/extract_templates_public_api.py b/candidate/generated/nimble_client/api/extract_templates_public_api.py new file mode 100644 index 0000000..459b4f6 --- /dev/null +++ b/candidate/generated/nimble_client/api/extract_templates_public_api.py @@ -0,0 +1,2334 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Any, List, Optional +from typing_extensions import Annotated +from uuid import UUID +from nimble_client.models.extract_template_generation_response_public_v2 import ExtractTemplateGenerationResponsePublicV2 +from nimble_client.models.extract_template_response_public_v2 import ExtractTemplateResponsePublicV2 +from nimble_client.models.extract_template_version_response_public_v2 import ExtractTemplateVersionResponsePublicV2 +from nimble_client.models.json_patch_op import JsonPatchOp +from nimble_client.models.list_response_extract_template_response_public_v2 import ListResponseExtractTemplateResponsePublicV2 +from nimble_client.models.list_response_extract_template_version_response_public_v2 import ListResponseExtractTemplateVersionResponsePublicV2 +from nimble_client.models.request import Request + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class ExtractTemplatesPublicApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_extract_template_generation( + self, + request: Request, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExtractTemplateGenerationResponsePublicV2: + """Create Extract Template Generation Public V2 + + + :param request: (required) + :type request: Request + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_extract_template_generation_serialize( + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ExtractTemplateGenerationResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_extract_template_generation_with_http_info( + self, + request: Request, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExtractTemplateGenerationResponsePublicV2]: + """Create Extract Template Generation Public V2 + + + :param request: (required) + :type request: Request + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_extract_template_generation_serialize( + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ExtractTemplateGenerationResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_extract_template_generation_without_preload_content( + self, + request: Request, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Extract Template Generation Public V2 + + + :param request: (required) + :type request: Request + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_extract_template_generation_serialize( + request=request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ExtractTemplateGenerationResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_extract_template_generation_serialize( + self, + request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if request is not None: + _body_params = request + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/extract/templates/generations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_extract_template( + self, + extract_template_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Extract Template Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_extract_template_serialize( + extract_template_name=extract_template_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_extract_template_with_http_info( + self, + extract_template_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Extract Template Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_extract_template_serialize( + extract_template_name=extract_template_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_extract_template_without_preload_content( + self, + extract_template_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Extract Template Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_extract_template_serialize( + extract_template_name=extract_template_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_extract_template_serialize( + self, + extract_template_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if extract_template_name is not None: + _path_params['extract_template_name'] = extract_template_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/extract/templates/{extract_template_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_extract_template( + self, + extract_template_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExtractTemplateResponsePublicV2: + """Get Extract Template Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_extract_template_serialize( + extract_template_name=extract_template_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_extract_template_with_http_info( + self, + extract_template_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExtractTemplateResponsePublicV2]: + """Get Extract Template Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_extract_template_serialize( + extract_template_name=extract_template_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_extract_template_without_preload_content( + self, + extract_template_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Extract Template Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_extract_template_serialize( + extract_template_name=extract_template_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_extract_template_serialize( + self, + extract_template_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if extract_template_name is not None: + _path_params['extract_template_name'] = extract_template_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/extract/templates/{extract_template_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_extract_template_generation( + self, + generation_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExtractTemplateGenerationResponsePublicV2: + """Get Extract Template Generation Public V2 + + + :param generation_id: (required) + :type generation_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_extract_template_generation_serialize( + generation_id=generation_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateGenerationResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_extract_template_generation_with_http_info( + self, + generation_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExtractTemplateGenerationResponsePublicV2]: + """Get Extract Template Generation Public V2 + + + :param generation_id: (required) + :type generation_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_extract_template_generation_serialize( + generation_id=generation_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateGenerationResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_extract_template_generation_without_preload_content( + self, + generation_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Extract Template Generation Public V2 + + + :param generation_id: (required) + :type generation_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_extract_template_generation_serialize( + generation_id=generation_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateGenerationResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_extract_template_generation_serialize( + self, + generation_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if generation_id is not None: + _path_params['generation_id'] = generation_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/extract/templates/generations/{generation_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_extract_template_version( + self, + extract_template_name: StrictStr, + version_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExtractTemplateVersionResponsePublicV2: + """Get Extract Template Version Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param version_id: (required) + :type version_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_extract_template_version_serialize( + extract_template_name=extract_template_name, + version_id=version_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateVersionResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_extract_template_version_with_http_info( + self, + extract_template_name: StrictStr, + version_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExtractTemplateVersionResponsePublicV2]: + """Get Extract Template Version Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param version_id: (required) + :type version_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_extract_template_version_serialize( + extract_template_name=extract_template_name, + version_id=version_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateVersionResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_extract_template_version_without_preload_content( + self, + extract_template_name: StrictStr, + version_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Extract Template Version Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param version_id: (required) + :type version_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_extract_template_version_serialize( + extract_template_name=extract_template_name, + version_id=version_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateVersionResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_extract_template_version_serialize( + self, + extract_template_name, + version_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if extract_template_name is not None: + _path_params['extract_template_name'] = extract_template_name + if version_id is not None: + _path_params['version_id'] = version_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/extract/templates/{extract_template_name}/versions/{version_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_extract_template_versions( + self, + extract_template_name: StrictStr, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListResponseExtractTemplateVersionResponsePublicV2: + """List Extract Template Versions Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_extract_template_versions_serialize( + extract_template_name=extract_template_name, + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseExtractTemplateVersionResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_extract_template_versions_with_http_info( + self, + extract_template_name: StrictStr, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListResponseExtractTemplateVersionResponsePublicV2]: + """List Extract Template Versions Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_extract_template_versions_serialize( + extract_template_name=extract_template_name, + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseExtractTemplateVersionResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_extract_template_versions_without_preload_content( + self, + extract_template_name: StrictStr, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Extract Template Versions Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_extract_template_versions_serialize( + extract_template_name=extract_template_name, + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseExtractTemplateVersionResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_extract_template_versions_serialize( + self, + extract_template_name, + offset, + limit, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if extract_template_name is not None: + _path_params['extract_template_name'] = extract_template_name + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/extract/templates/{extract_template_name}/versions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_extract_templates( + self, + privacy: Annotated[Optional[Any], Field(description="Which templates to list: the account's own, the shared public catalog, or both.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Case-insensitive keyword match on name, display name, description, domain, and tags.")] = None, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListResponseExtractTemplateResponsePublicV2: + """List Extract Templates Public V2 + + + :param privacy: Which templates to list: the account's own, the shared public catalog, or both. + :type privacy: PrivacyFilterPublicV2 + :param search: Case-insensitive keyword match on name, display name, description, domain, and tags. + :type search: str + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_extract_templates_serialize( + privacy=privacy, + search=search, + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseExtractTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_extract_templates_with_http_info( + self, + privacy: Annotated[Optional[Any], Field(description="Which templates to list: the account's own, the shared public catalog, or both.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Case-insensitive keyword match on name, display name, description, domain, and tags.")] = None, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListResponseExtractTemplateResponsePublicV2]: + """List Extract Templates Public V2 + + + :param privacy: Which templates to list: the account's own, the shared public catalog, or both. + :type privacy: PrivacyFilterPublicV2 + :param search: Case-insensitive keyword match on name, display name, description, domain, and tags. + :type search: str + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_extract_templates_serialize( + privacy=privacy, + search=search, + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseExtractTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_extract_templates_without_preload_content( + self, + privacy: Annotated[Optional[Any], Field(description="Which templates to list: the account's own, the shared public catalog, or both.")] = None, + search: Annotated[Optional[StrictStr], Field(description="Case-insensitive keyword match on name, display name, description, domain, and tags.")] = None, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Extract Templates Public V2 + + + :param privacy: Which templates to list: the account's own, the shared public catalog, or both. + :type privacy: PrivacyFilterPublicV2 + :param search: Case-insensitive keyword match on name, display name, description, domain, and tags. + :type search: str + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_extract_templates_serialize( + privacy=privacy, + search=search, + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseExtractTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_extract_templates_serialize( + self, + privacy, + search, + offset, + limit, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if privacy is not None: + + _query_params.append(('privacy', privacy.value)) + + if search is not None: + + _query_params.append(('search', search)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/extract/templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_extract_template( + self, + extract_template_name: StrictStr, + json_patch_op: List[JsonPatchOp], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExtractTemplateResponsePublicV2: + """Patch Extract Template Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param json_patch_op: (required) + :type json_patch_op: List[JsonPatchOp] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_extract_template_serialize( + extract_template_name=extract_template_name, + json_patch_op=json_patch_op, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_extract_template_with_http_info( + self, + extract_template_name: StrictStr, + json_patch_op: List[JsonPatchOp], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExtractTemplateResponsePublicV2]: + """Patch Extract Template Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param json_patch_op: (required) + :type json_patch_op: List[JsonPatchOp] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_extract_template_serialize( + extract_template_name=extract_template_name, + json_patch_op=json_patch_op, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_extract_template_without_preload_content( + self, + extract_template_name: StrictStr, + json_patch_op: List[JsonPatchOp], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Patch Extract Template Public V2 + + + :param extract_template_name: (required) + :type extract_template_name: str + :param json_patch_op: (required) + :type json_patch_op: List[JsonPatchOp] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_extract_template_serialize( + extract_template_name=extract_template_name, + json_patch_op=json_patch_op, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_extract_template_serialize( + self, + extract_template_name, + json_patch_op, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'JsonPatchOp': '', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if extract_template_name is not None: + _path_params['extract_template_name'] = extract_template_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if json_patch_op is not None: + _body_params = json_patch_op + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/json-patch+json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v2/extract/templates/{extract_template_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/extraction_templates_api.py b/candidate/generated/nimble_client/api/extraction_templates_api.py new file mode 100644 index 0000000..35e9ba0 --- /dev/null +++ b/candidate/generated/nimble_client/api/extraction_templates_api.py @@ -0,0 +1,866 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from typing import Optional +from nimble_client.models.extract_batch_response import ExtractBatchResponse +from nimble_client.models.extraction_template_batch_body import ExtractionTemplateBatchBody +from nimble_client.models.extraction_template_body import ExtractionTemplateBody +from nimble_client.models.run_extract_template200_response import RunExtractTemplate200Response +from nimble_client.models.run_extract_template_async200_response import RunExtractTemplateAsync200Response +from nimble_client.models.run_extract_template_async_request import RunExtractTemplateAsyncRequest + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class ExtractionTemplatesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def run_extract_template( + self, + extraction_template_body: Optional[ExtractionTemplateBody] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunExtractTemplate200Response: + """run_extract_template + + Execute Extraction Template Realtime Endpoint + + :param extraction_template_body: + :type extraction_template_body: ExtractionTemplateBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_extract_template_serialize( + extraction_template_body=extraction_template_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + '404': "RunExtractTemplate404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def run_extract_template_with_http_info( + self, + extraction_template_body: Optional[ExtractionTemplateBody] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunExtractTemplate200Response]: + """run_extract_template + + Execute Extraction Template Realtime Endpoint + + :param extraction_template_body: + :type extraction_template_body: ExtractionTemplateBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_extract_template_serialize( + extraction_template_body=extraction_template_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + '404': "RunExtractTemplate404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def run_extract_template_without_preload_content( + self, + extraction_template_body: Optional[ExtractionTemplateBody] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """run_extract_template + + Execute Extraction Template Realtime Endpoint + + :param extraction_template_body: + :type extraction_template_body: ExtractionTemplateBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_extract_template_serialize( + extraction_template_body=extraction_template_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + '404': "RunExtractTemplate404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _run_extract_template_serialize( + self, + extraction_template_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if extraction_template_body is not None: + _body_params = extraction_template_body + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/extract/templates/run', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def run_extract_template_async( + self, + run_extract_template_async_request: Optional[RunExtractTemplateAsyncRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunExtractTemplateAsync200Response: + """run_extract_template_async + + Execute Extraction Template Async Endpoint + + :param run_extract_template_async_request: + :type run_extract_template_async_request: RunExtractTemplateAsyncRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_extract_template_async_serialize( + run_extract_template_async_request=run_extract_template_async_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplateAsync200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def run_extract_template_async_with_http_info( + self, + run_extract_template_async_request: Optional[RunExtractTemplateAsyncRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunExtractTemplateAsync200Response]: + """run_extract_template_async + + Execute Extraction Template Async Endpoint + + :param run_extract_template_async_request: + :type run_extract_template_async_request: RunExtractTemplateAsyncRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_extract_template_async_serialize( + run_extract_template_async_request=run_extract_template_async_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplateAsync200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def run_extract_template_async_without_preload_content( + self, + run_extract_template_async_request: Optional[RunExtractTemplateAsyncRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """run_extract_template_async + + Execute Extraction Template Async Endpoint + + :param run_extract_template_async_request: + :type run_extract_template_async_request: RunExtractTemplateAsyncRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_extract_template_async_serialize( + run_extract_template_async_request=run_extract_template_async_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplateAsync200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _run_extract_template_async_serialize( + self, + run_extract_template_async_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if run_extract_template_async_request is not None: + _body_params = run_extract_template_async_request + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/extract/templates/async', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def run_extract_template_batch( + self, + extraction_template_batch_body: Optional[ExtractionTemplateBatchBody] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ExtractBatchResponse: + """run_extract_template_batch + + Execute Extraction Template Batch Endpoint + + :param extraction_template_batch_body: + :type extraction_template_batch_body: ExtractionTemplateBatchBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_extract_template_batch_serialize( + extraction_template_batch_body=extraction_template_batch_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractBatchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def run_extract_template_batch_with_http_info( + self, + extraction_template_batch_body: Optional[ExtractionTemplateBatchBody] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ExtractBatchResponse]: + """run_extract_template_batch + + Execute Extraction Template Batch Endpoint + + :param extraction_template_batch_body: + :type extraction_template_batch_body: ExtractionTemplateBatchBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_extract_template_batch_serialize( + extraction_template_batch_body=extraction_template_batch_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractBatchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def run_extract_template_batch_without_preload_content( + self, + extraction_template_batch_body: Optional[ExtractionTemplateBatchBody] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """run_extract_template_batch + + Execute Extraction Template Batch Endpoint + + :param extraction_template_batch_body: + :type extraction_template_batch_body: ExtractionTemplateBatchBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._run_extract_template_batch_serialize( + extraction_template_batch_body=extraction_template_batch_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ExtractBatchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _run_extract_template_batch_serialize( + self, + extraction_template_batch_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if extraction_template_batch_body is not None: + _body_params = extraction_template_batch_body + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/extract/templates/batch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/jobs_public_v2_api.py b/candidate/generated/nimble_client/api/jobs_public_v2_api.py new file mode 100644 index 0000000..6c31646 --- /dev/null +++ b/candidate/generated/nimble_client/api/jobs_public_v2_api.py @@ -0,0 +1,3679 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from nimble_client.models.artifact_download_url_public_v2 import ArtifactDownloadUrlPublicV2 +from nimble_client.models.artifact_list_public_v2 import ArtifactListPublicV2 +from nimble_client.models.artifact_preview_public_v2 import ArtifactPreviewPublicV2 +from nimble_client.models.artifact_public_v2 import ArtifactPublicV2 +from nimble_client.models.create_job_request_public_v2 import CreateJobRequestPublicV2 +from nimble_client.models.job_public_v2 import JobPublicV2 +from nimble_client.models.job_run_cancel_response_public_v2 import JobRunCancelResponsePublicV2 +from nimble_client.models.job_run_detail_public_v2 import JobRunDetailPublicV2 +from nimble_client.models.job_run_public_v2 import JobRunPublicV2 +from nimble_client.models.list_response_job_public_v2 import ListResponseJobPublicV2 +from nimble_client.models.list_response_job_run_public_v2 import ListResponseJobRunPublicV2 +from nimble_client.models.trigger_job_run_request_public_v2 import TriggerJobRunRequestPublicV2 +from nimble_client.models.update_job_request_public_v2 import UpdateJobRequestPublicV2 + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class JobsPublicV2Api: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def cancel_job_run( + self, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JobRunCancelResponsePublicV2: + """Cancel Run Public V2 + + + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_job_run_serialize( + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobRunCancelResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def cancel_job_run_with_http_info( + self, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JobRunCancelResponsePublicV2]: + """Cancel Run Public V2 + + + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_job_run_serialize( + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobRunCancelResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def cancel_job_run_without_preload_content( + self, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Cancel Run Public V2 + + + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_job_run_serialize( + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobRunCancelResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _cancel_job_run_serialize( + self, + run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if run_id is not None: + _path_params['run_id'] = run_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/jobs/runs/{run_id}/cancel', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_job( + self, + create_job_request_public_v2: CreateJobRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JobPublicV2: + """Create Job Public V2 + + + :param create_job_request_public_v2: (required) + :type create_job_request_public_v2: CreateJobRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_job_serialize( + create_job_request_public_v2=create_job_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "JobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_job_with_http_info( + self, + create_job_request_public_v2: CreateJobRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JobPublicV2]: + """Create Job Public V2 + + + :param create_job_request_public_v2: (required) + :type create_job_request_public_v2: CreateJobRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_job_serialize( + create_job_request_public_v2=create_job_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "JobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_job_without_preload_content( + self, + create_job_request_public_v2: CreateJobRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Job Public V2 + + + :param create_job_request_public_v2: (required) + :type create_job_request_public_v2: CreateJobRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_job_serialize( + create_job_request_public_v2=create_job_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "JobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_job_serialize( + self, + create_job_request_public_v2, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_job_request_public_v2 is not None: + _body_params = create_job_request_public_v2 + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/jobs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_job( + self, + job_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Job Public V2 + + + :param job_id: (required) + :type job_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_job_serialize( + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_job_with_http_info( + self, + job_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Job Public V2 + + + :param job_id: (required) + :type job_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_job_serialize( + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_job_without_preload_content( + self, + job_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Job Public V2 + + + :param job_id: (required) + :type job_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_job_serialize( + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_job_serialize( + self, + job_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job_id is not None: + _path_params['job_id'] = job_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/jobs/{job_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_job( + self, + job_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JobPublicV2: + """Get Job Public V2 + + + :param job_id: (required) + :type job_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_serialize( + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_job_with_http_info( + self, + job_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JobPublicV2]: + """Get Job Public V2 + + + :param job_id: (required) + :type job_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_serialize( + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_job_without_preload_content( + self, + job_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Job Public V2 + + + :param job_id: (required) + :type job_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_serialize( + job_id=job_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_job_serialize( + self, + job_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job_id is not None: + _path_params['job_id'] = job_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/jobs/{job_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_job_run( + self, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JobRunDetailPublicV2: + """Get Run Public V2 + + + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_run_serialize( + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobRunDetailPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_job_run_with_http_info( + self, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JobRunDetailPublicV2]: + """Get Run Public V2 + + + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_run_serialize( + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobRunDetailPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_job_run_without_preload_content( + self, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Run Public V2 + + + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_run_serialize( + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobRunDetailPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_job_run_serialize( + self, + run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if run_id is not None: + _path_params['run_id'] = run_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/jobs/runs/{run_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_job_run_artifact( + self, + run_id: StrictStr, + artifact_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ArtifactPublicV2: + """Get Run Artifact Public V2 + + + :param run_id: (required) + :type run_id: str + :param artifact_id: (required) + :type artifact_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_run_artifact_serialize( + run_id=run_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_job_run_artifact_with_http_info( + self, + run_id: StrictStr, + artifact_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ArtifactPublicV2]: + """Get Run Artifact Public V2 + + + :param run_id: (required) + :type run_id: str + :param artifact_id: (required) + :type artifact_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_run_artifact_serialize( + run_id=run_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_job_run_artifact_without_preload_content( + self, + run_id: StrictStr, + artifact_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Run Artifact Public V2 + + + :param run_id: (required) + :type run_id: str + :param artifact_id: (required) + :type artifact_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_run_artifact_serialize( + run_id=run_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_job_run_artifact_serialize( + self, + run_id, + artifact_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if run_id is not None: + _path_params['run_id'] = run_id + if artifact_id is not None: + _path_params['artifact_id'] = artifact_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/jobs/runs/{run_id}/artifacts/{artifact_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_job_run_artifact_download_url( + self, + run_id: StrictStr, + artifact_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ArtifactDownloadUrlPublicV2: + """Get Run Artifact Download Url Public V2 + + + :param run_id: (required) + :type run_id: str + :param artifact_id: (required) + :type artifact_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_run_artifact_download_url_serialize( + run_id=run_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactDownloadUrlPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_job_run_artifact_download_url_with_http_info( + self, + run_id: StrictStr, + artifact_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ArtifactDownloadUrlPublicV2]: + """Get Run Artifact Download Url Public V2 + + + :param run_id: (required) + :type run_id: str + :param artifact_id: (required) + :type artifact_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_run_artifact_download_url_serialize( + run_id=run_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactDownloadUrlPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_job_run_artifact_download_url_without_preload_content( + self, + run_id: StrictStr, + artifact_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Run Artifact Download Url Public V2 + + + :param run_id: (required) + :type run_id: str + :param artifact_id: (required) + :type artifact_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_job_run_artifact_download_url_serialize( + run_id=run_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactDownloadUrlPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_job_run_artifact_download_url_serialize( + self, + run_id, + artifact_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if run_id is not None: + _path_params['run_id'] = run_id + if artifact_id is not None: + _path_params['artifact_id'] = artifact_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/jobs/runs/{run_id}/artifacts/{artifact_id}/download-url', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_job_run_artifacts( + self, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ArtifactListPublicV2: + """List Run Artifacts Public V2 + + + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_job_run_artifacts_serialize( + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactListPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_job_run_artifacts_with_http_info( + self, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ArtifactListPublicV2]: + """List Run Artifacts Public V2 + + + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_job_run_artifacts_serialize( + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactListPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_job_run_artifacts_without_preload_content( + self, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Run Artifacts Public V2 + + + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_job_run_artifacts_serialize( + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactListPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_job_run_artifacts_serialize( + self, + run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if run_id is not None: + _path_params['run_id'] = run_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/jobs/runs/{run_id}/artifacts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_job_runs( + self, + job_id: StrictStr, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListResponseJobRunPublicV2: + """List Job Runs Public V2 + + + :param job_id: (required) + :type job_id: str + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_job_runs_serialize( + job_id=job_id, + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseJobRunPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_job_runs_with_http_info( + self, + job_id: StrictStr, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListResponseJobRunPublicV2]: + """List Job Runs Public V2 + + + :param job_id: (required) + :type job_id: str + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_job_runs_serialize( + job_id=job_id, + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseJobRunPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_job_runs_without_preload_content( + self, + job_id: StrictStr, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Job Runs Public V2 + + + :param job_id: (required) + :type job_id: str + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_job_runs_serialize( + job_id=job_id, + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseJobRunPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_job_runs_serialize( + self, + job_id, + offset, + limit, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job_id is not None: + _path_params['job_id'] = job_id + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/jobs/{job_id}/runs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_jobs( + self, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListResponseJobPublicV2: + """List Jobs Public V2 + + + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_jobs_serialize( + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseJobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_jobs_with_http_info( + self, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListResponseJobPublicV2]: + """List Jobs Public V2 + + + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_jobs_serialize( + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseJobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_jobs_without_preload_content( + self, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + body: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Jobs Public V2 + + + :param offset: + :type offset: int + :param limit: + :type limit: int + :param body: + :type body: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_jobs_serialize( + offset=offset, + limit=limit, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseJobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_jobs_serialize( + self, + offset, + limit, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/jobs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def preview_job_run_artifact( + self, + run_id: StrictStr, + artifact_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ArtifactPreviewPublicV2: + """Preview Run Artifact Public V2 + + + :param run_id: (required) + :type run_id: str + :param artifact_id: (required) + :type artifact_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._preview_job_run_artifact_serialize( + run_id=run_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactPreviewPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def preview_job_run_artifact_with_http_info( + self, + run_id: StrictStr, + artifact_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ArtifactPreviewPublicV2]: + """Preview Run Artifact Public V2 + + + :param run_id: (required) + :type run_id: str + :param artifact_id: (required) + :type artifact_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._preview_job_run_artifact_serialize( + run_id=run_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactPreviewPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def preview_job_run_artifact_without_preload_content( + self, + run_id: StrictStr, + artifact_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Preview Run Artifact Public V2 + + + :param run_id: (required) + :type run_id: str + :param artifact_id: (required) + :type artifact_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._preview_job_run_artifact_serialize( + run_id=run_id, + artifact_id=artifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ArtifactPreviewPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _preview_job_run_artifact_serialize( + self, + run_id, + artifact_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if run_id is not None: + _path_params['run_id'] = run_id + if artifact_id is not None: + _path_params['artifact_id'] = artifact_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/jobs/runs/{run_id}/artifacts/{artifact_id}/preview', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def trigger_job_run( + self, + job_id: StrictStr, + trigger_job_run_request_public_v2: Optional[TriggerJobRunRequestPublicV2] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JobRunPublicV2: + """Trigger Job Run Public V2 + + + :param job_id: (required) + :type job_id: str + :param trigger_job_run_request_public_v2: + :type trigger_job_run_request_public_v2: TriggerJobRunRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._trigger_job_run_serialize( + job_id=job_id, + trigger_job_run_request_public_v2=trigger_job_run_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "JobRunPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def trigger_job_run_with_http_info( + self, + job_id: StrictStr, + trigger_job_run_request_public_v2: Optional[TriggerJobRunRequestPublicV2] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JobRunPublicV2]: + """Trigger Job Run Public V2 + + + :param job_id: (required) + :type job_id: str + :param trigger_job_run_request_public_v2: + :type trigger_job_run_request_public_v2: TriggerJobRunRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._trigger_job_run_serialize( + job_id=job_id, + trigger_job_run_request_public_v2=trigger_job_run_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "JobRunPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def trigger_job_run_without_preload_content( + self, + job_id: StrictStr, + trigger_job_run_request_public_v2: Optional[TriggerJobRunRequestPublicV2] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Trigger Job Run Public V2 + + + :param job_id: (required) + :type job_id: str + :param trigger_job_run_request_public_v2: + :type trigger_job_run_request_public_v2: TriggerJobRunRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._trigger_job_run_serialize( + job_id=job_id, + trigger_job_run_request_public_v2=trigger_job_run_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "JobRunPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _trigger_job_run_serialize( + self, + job_id, + trigger_job_run_request_public_v2, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job_id is not None: + _path_params['job_id'] = job_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if trigger_job_run_request_public_v2 is not None: + _body_params = trigger_job_run_request_public_v2 + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/jobs/{job_id}/runs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_job( + self, + job_id: StrictStr, + update_job_request_public_v2: UpdateJobRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JobPublicV2: + """Update Job Public V2 + + + :param job_id: (required) + :type job_id: str + :param update_job_request_public_v2: (required) + :type update_job_request_public_v2: UpdateJobRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_job_serialize( + job_id=job_id, + update_job_request_public_v2=update_job_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_job_with_http_info( + self, + job_id: StrictStr, + update_job_request_public_v2: UpdateJobRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JobPublicV2]: + """Update Job Public V2 + + + :param job_id: (required) + :type job_id: str + :param update_job_request_public_v2: (required) + :type update_job_request_public_v2: UpdateJobRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_job_serialize( + job_id=job_id, + update_job_request_public_v2=update_job_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_job_without_preload_content( + self, + job_id: StrictStr, + update_job_request_public_v2: UpdateJobRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Job Public V2 + + + :param job_id: (required) + :type job_id: str + :param update_job_request_public_v2: (required) + :type update_job_request_public_v2: UpdateJobRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_job_serialize( + job_id=job_id, + update_job_request_public_v2=update_job_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JobPublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_job_serialize( + self, + job_id, + update_job_request_public_v2, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job_id is not None: + _path_params['job_id'] = job_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_job_request_public_v2 is not None: + _body_params = update_job_request_public_v2 + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v2/jobs/{job_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/map_api.py b/candidate/generated/nimble_client/api/map_api.py new file mode 100644 index 0000000..38c95c7 --- /dev/null +++ b/candidate/generated/nimble_client/api/map_api.py @@ -0,0 +1,308 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from typing import Optional +from nimble_client.models.map_payload import MapPayload +from nimble_client.models.map_response import MapResponse + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class MapApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def map_urls( + self, + map_payload: Optional[MapPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MapResponse: + """Create map task + + + :param map_payload: + :type map_payload: MapPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._map_urls_serialize( + map_payload=map_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MapResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def map_urls_with_http_info( + self, + map_payload: Optional[MapPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MapResponse]: + """Create map task + + + :param map_payload: + :type map_payload: MapPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._map_urls_serialize( + map_payload=map_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MapResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def map_urls_without_preload_content( + self, + map_payload: Optional[MapPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create map task + + + :param map_payload: + :type map_payload: MapPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._map_urls_serialize( + map_payload=map_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MapResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _map_urls_serialize( + self, + map_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if map_payload is not None: + _body_params = map_payload + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/map', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/media_api.py b/candidate/generated/nimble_client/api/media_api.py new file mode 100644 index 0000000..c9f5d76 --- /dev/null +++ b/candidate/generated/nimble_client/api/media_api.py @@ -0,0 +1,587 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from typing import Optional +from nimble_client.models.media_async_payload import MediaAsyncPayload +from nimble_client.models.media_async_response import MediaAsyncResponse +from nimble_client.models.media_payload import MediaPayload +from nimble_client.models.run_extract_template200_response import RunExtractTemplate200Response + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class MediaApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def capture_media( + self, + media_payload: Optional[MediaPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunExtractTemplate200Response: + """Download Media + + Download media from a URL. Waits for the result before responding. + + :param media_payload: + :type media_payload: MediaPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._capture_media_serialize( + media_payload=media_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def capture_media_with_http_info( + self, + media_payload: Optional[MediaPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunExtractTemplate200Response]: + """Download Media + + Download media from a URL. Waits for the result before responding. + + :param media_payload: + :type media_payload: MediaPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._capture_media_serialize( + media_payload=media_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def capture_media_without_preload_content( + self, + media_payload: Optional[MediaPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download Media + + Download media from a URL. Waits for the result before responding. + + :param media_payload: + :type media_payload: MediaPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._capture_media_serialize( + media_payload=media_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _capture_media_serialize( + self, + media_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if media_payload is not None: + _body_params = media_payload + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/media', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def capture_media_async( + self, + media_async_payload: Optional[MediaAsyncPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MediaAsyncResponse: + """Download Media Async + + Download media from a URL asynchronously. Returns a task ID immediately. + + :param media_async_payload: + :type media_async_payload: MediaAsyncPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._capture_media_async_serialize( + media_async_payload=media_async_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MediaAsyncResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def capture_media_async_with_http_info( + self, + media_async_payload: Optional[MediaAsyncPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MediaAsyncResponse]: + """Download Media Async + + Download media from a URL asynchronously. Returns a task ID immediately. + + :param media_async_payload: + :type media_async_payload: MediaAsyncPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._capture_media_async_serialize( + media_async_payload=media_async_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MediaAsyncResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def capture_media_async_without_preload_content( + self, + media_async_payload: Optional[MediaAsyncPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download Media Async + + Download media from a URL asynchronously. Returns a task ID immediately. + + :param media_async_payload: + :type media_async_payload: MediaAsyncPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._capture_media_async_serialize( + media_async_payload=media_async_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MediaAsyncResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _capture_media_async_serialize( + self, + media_async_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if media_async_payload is not None: + _body_params = media_async_payload + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/media/async', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/public_api_api.py b/candidate/generated/nimble_client/api/public_api_api.py new file mode 100644 index 0000000..0161056 --- /dev/null +++ b/candidate/generated/nimble_client/api/public_api_api.py @@ -0,0 +1,3682 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from uuid import UUID +from nimble_client.models.json_patch_op import JsonPatchOp +from nimble_client.models.list_response_task_run_response_public_v2 import ListResponseTaskRunResponsePublicV2 +from nimble_client.models.list_response_web_search_agent_response_public_v2 import ListResponseWebSearchAgentResponsePublicV2 +from nimble_client.models.list_response_web_search_agent_template_response_public_v2 import ListResponseWebSearchAgentTemplateResponsePublicV2 +from nimble_client.models.response_get_run_result_public_v2_api_v2_public_web_search_agents_agent_id_runs_run_id_result_get import ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet +from nimble_client.models.stream_agent_run_events200_response import StreamAgentRunEvents200Response +from nimble_client.models.task_run_response_public_v2 import TaskRunResponsePublicV2 +from nimble_client.models.web_search_agent_create_request_public_v2 import WebSearchAgentCreateRequestPublicV2 +from nimble_client.models.web_search_agent_response_public_v2 import WebSearchAgentResponsePublicV2 +from nimble_client.models.web_search_agent_run_create_request_public_v2 import WebSearchAgentRunCreateRequestPublicV2 +from nimble_client.models.web_search_agent_template_response_public_v2 import WebSearchAgentTemplateResponsePublicV2 + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class PublicAPIApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_agent( + self, + web_search_agent_create_request_public_v2: WebSearchAgentCreateRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebSearchAgentResponsePublicV2: + """Create Agent + + Create a Web Search Agent. Either pass `template` to materialize a pre-built template (its fields, goals, sources, and suggested questions are copied), or define the agent from scratch with `display_name`, `goals`, `sources`, and an optional `output_schema` for structured results. + + :param web_search_agent_create_request_public_v2: (required) + :type web_search_agent_create_request_public_v2: WebSearchAgentCreateRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_serialize( + web_search_agent_create_request_public_v2=web_search_agent_create_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_agent_with_http_info( + self, + web_search_agent_create_request_public_v2: WebSearchAgentCreateRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebSearchAgentResponsePublicV2]: + """Create Agent + + Create a Web Search Agent. Either pass `template` to materialize a pre-built template (its fields, goals, sources, and suggested questions are copied), or define the agent from scratch with `display_name`, `goals`, `sources`, and an optional `output_schema` for structured results. + + :param web_search_agent_create_request_public_v2: (required) + :type web_search_agent_create_request_public_v2: WebSearchAgentCreateRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_serialize( + web_search_agent_create_request_public_v2=web_search_agent_create_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_agent_without_preload_content( + self, + web_search_agent_create_request_public_v2: WebSearchAgentCreateRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Agent + + Create a Web Search Agent. Either pass `template` to materialize a pre-built template (its fields, goals, sources, and suggested questions are copied), or define the agent from scratch with `display_name`, `goals`, `sources`, and an optional `output_schema` for structured results. + + :param web_search_agent_create_request_public_v2: (required) + :type web_search_agent_create_request_public_v2: WebSearchAgentCreateRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_serialize( + web_search_agent_create_request_public_v2=web_search_agent_create_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_serialize( + self, + web_search_agent_create_request_public_v2, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if web_search_agent_create_request_public_v2 is not None: + _body_params = web_search_agent_create_request_public_v2 + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/agents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_agent_run( + self, + agent_id: UUID, + web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskRunResponsePublicV2: + """Create Agent Run + + Start an agent run. The run executes asynchronously: the response returns immediately with status `queued`, then poll `GET .../runs/{run_id}` until `completed` and fetch the output from `GET .../runs/{run_id}/result` — or set `enable_events: true` and follow `GET .../runs/{run_id}/events` for live progress. To enrich existing records instead of researching from scratch, pass them in `input_data`; this requires an `output_schema` (on the request or the agent). + + :param agent_id: (required) + :type agent_id: UUID + :param web_search_agent_run_create_request_public_v2: (required) + :type web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_run_serialize( + agent_id=agent_id, + web_search_agent_run_create_request_public_v2=web_search_agent_run_create_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_agent_run_with_http_info( + self, + agent_id: UUID, + web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskRunResponsePublicV2]: + """Create Agent Run + + Start an agent run. The run executes asynchronously: the response returns immediately with status `queued`, then poll `GET .../runs/{run_id}` until `completed` and fetch the output from `GET .../runs/{run_id}/result` — or set `enable_events: true` and follow `GET .../runs/{run_id}/events` for live progress. To enrich existing records instead of researching from scratch, pass them in `input_data`; this requires an `output_schema` (on the request or the agent). + + :param agent_id: (required) + :type agent_id: UUID + :param web_search_agent_run_create_request_public_v2: (required) + :type web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_run_serialize( + agent_id=agent_id, + web_search_agent_run_create_request_public_v2=web_search_agent_run_create_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_agent_run_without_preload_content( + self, + agent_id: UUID, + web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Agent Run + + Start an agent run. The run executes asynchronously: the response returns immediately with status `queued`, then poll `GET .../runs/{run_id}` until `completed` and fetch the output from `GET .../runs/{run_id}/result` — or set `enable_events: true` and follow `GET .../runs/{run_id}/events` for live progress. To enrich existing records instead of researching from scratch, pass them in `input_data`; this requires an `output_schema` (on the request or the agent). + + :param agent_id: (required) + :type agent_id: UUID + :param web_search_agent_run_create_request_public_v2: (required) + :type web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_agent_run_serialize( + agent_id=agent_id, + web_search_agent_run_create_request_public_v2=web_search_agent_run_create_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_agent_run_serialize( + self, + agent_id, + web_search_agent_run_create_request_public_v2, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agent_id'] = agent_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if web_search_agent_run_create_request_public_v2 is not None: + _body_params = web_search_agent_run_create_request_public_v2 + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/agents/{agent_id}/runs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_generated_agent_run( + self, + web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskRunResponsePublicV2: + """Create Run With Generated Agent + + Creates a minimal persistent Web Search Agent and starts a run for it. The response includes `web_search_agent_id` for later agent and run queries. + + :param web_search_agent_run_create_request_public_v2: (required) + :type web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_generated_agent_run_serialize( + web_search_agent_run_create_request_public_v2=web_search_agent_run_create_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_generated_agent_run_with_http_info( + self, + web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskRunResponsePublicV2]: + """Create Run With Generated Agent + + Creates a minimal persistent Web Search Agent and starts a run for it. The response includes `web_search_agent_id` for later agent and run queries. + + :param web_search_agent_run_create_request_public_v2: (required) + :type web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_generated_agent_run_serialize( + web_search_agent_run_create_request_public_v2=web_search_agent_run_create_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_generated_agent_run_without_preload_content( + self, + web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Run With Generated Agent + + Creates a minimal persistent Web Search Agent and starts a run for it. The response includes `web_search_agent_id` for later agent and run queries. + + :param web_search_agent_run_create_request_public_v2: (required) + :type web_search_agent_run_create_request_public_v2: WebSearchAgentRunCreateRequestPublicV2 + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_generated_agent_run_serialize( + web_search_agent_run_create_request_public_v2=web_search_agent_run_create_request_public_v2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "TaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_generated_agent_run_serialize( + self, + web_search_agent_run_create_request_public_v2, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if web_search_agent_run_create_request_public_v2 is not None: + _body_params = web_search_agent_run_create_request_public_v2 + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/agents/runs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def deactivate_agent( + self, + agent_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Deactivate Agent + + Deactivate an agent. This is a soft delete: the agent can no longer start new runs, but its existing runs and their results remain retrievable. + + :param agent_id: (required) + :type agent_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._deactivate_agent_serialize( + agent_id=agent_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def deactivate_agent_with_http_info( + self, + agent_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Deactivate Agent + + Deactivate an agent. This is a soft delete: the agent can no longer start new runs, but its existing runs and their results remain retrievable. + + :param agent_id: (required) + :type agent_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._deactivate_agent_serialize( + agent_id=agent_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def deactivate_agent_without_preload_content( + self, + agent_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Deactivate Agent + + Deactivate an agent. This is a soft delete: the agent can no longer start new runs, but its existing runs and their results remain retrievable. + + :param agent_id: (required) + :type agent_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._deactivate_agent_serialize( + agent_id=agent_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _deactivate_agent_serialize( + self, + agent_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agent_id'] = agent_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v2/agents/{agent_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent( + self, + agent_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebSearchAgentResponsePublicV2: + """Get Agent + + Retrieve a single Web Search Agent by ID. + + :param agent_id: (required) + :type agent_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_serialize( + agent_id=agent_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_agent_with_http_info( + self, + agent_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebSearchAgentResponsePublicV2]: + """Get Agent + + Retrieve a single Web Search Agent by ID. + + :param agent_id: (required) + :type agent_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_serialize( + agent_id=agent_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_agent_without_preload_content( + self, + agent_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Agent + + Retrieve a single Web Search Agent by ID. + + :param agent_id: (required) + :type agent_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_serialize( + agent_id=agent_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_serialize( + self, + agent_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agent_id'] = agent_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/agents/{agent_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_run( + self, + agent_id: UUID, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskRunResponsePublicV2: + """Get Agent Run + + Retrieve a run's current state. Poll this endpoint after creating a run: the run is finished once `status` is `completed`, `failed`, or `cancelled`. + + :param agent_id: (required) + :type agent_id: UUID + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_run_serialize( + agent_id=agent_id, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_agent_run_with_http_info( + self, + agent_id: UUID, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskRunResponsePublicV2]: + """Get Agent Run + + Retrieve a run's current state. Poll this endpoint after creating a run: the run is finished once `status` is `completed`, `failed`, or `cancelled`. + + :param agent_id: (required) + :type agent_id: UUID + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_run_serialize( + agent_id=agent_id, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_agent_run_without_preload_content( + self, + agent_id: UUID, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Agent Run + + Retrieve a run's current state. Poll this endpoint after creating a run: the run is finished once `status` is `completed`, `failed`, or `cancelled`. + + :param agent_id: (required) + :type agent_id: UUID + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_run_serialize( + agent_id=agent_id, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_run_serialize( + self, + agent_id, + run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agent_id'] = agent_id + if run_id is not None: + _path_params['run_id'] = run_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/agents/{agent_id}/runs/{run_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_run_result( + self, + agent_id: UUID, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet: + """Get Agent Run Result + + Fetch the output of a completed run. The `output` is `type: \"text\"` (a prose answer) or `type: \"json\"` (structured data matching the output schema), plus `trust` metadata with per-claim citations for the answer. While the run is still `queued` or `running` this endpoint returns `409`; if the run `failed` or was `cancelled` it returns `422` with the run and error details. + + :param agent_id: (required) + :type agent_id: UUID + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_run_result_serialize( + agent_id=agent_id, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_agent_run_result_with_http_info( + self, + agent_id: UUID, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet]: + """Get Agent Run Result + + Fetch the output of a completed run. The `output` is `type: \"text\"` (a prose answer) or `type: \"json\"` (structured data matching the output schema), plus `trust` metadata with per-claim citations for the answer. While the run is still `queued` or `running` this endpoint returns `409`; if the run `failed` or was `cancelled` it returns `422` with the run and error details. + + :param agent_id: (required) + :type agent_id: UUID + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_run_result_serialize( + agent_id=agent_id, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_agent_run_result_without_preload_content( + self, + agent_id: UUID, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Agent Run Result + + Fetch the output of a completed run. The `output` is `type: \"text\"` (a prose answer) or `type: \"json\"` (structured data matching the output schema), plus `trust` metadata with per-claim citations for the answer. While the run is still `queued` or `running` this endpoint returns `409`; if the run `failed` or was `cancelled` it returns `422` with the run and error details. + + :param agent_id: (required) + :type agent_id: UUID + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_run_result_serialize( + agent_id=agent_id, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_run_result_serialize( + self, + agent_id, + run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agent_id'] = agent_id + if run_id is not None: + _path_params['run_id'] = run_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/agents/{agent_id}/runs/{run_id}/result', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_agent_template( + self, + template_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebSearchAgentTemplateResponsePublicV2: + """Get Agent Template + + Retrieve a single agent template by its stable `template_name`. + + :param template_name: (required) + :type template_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_template_serialize( + template_name=template_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebSearchAgentTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_agent_template_with_http_info( + self, + template_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebSearchAgentTemplateResponsePublicV2]: + """Get Agent Template + + Retrieve a single agent template by its stable `template_name`. + + :param template_name: (required) + :type template_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_template_serialize( + template_name=template_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebSearchAgentTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_agent_template_without_preload_content( + self, + template_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Agent Template + + Retrieve a single agent template by its stable `template_name`. + + :param template_name: (required) + :type template_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_agent_template_serialize( + template_name=template_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebSearchAgentTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_agent_template_serialize( + self, + template_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_name is not None: + _path_params['template_name'] = template_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/agents/templates/{template_name}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_agent_runs( + self, + agent_id: UUID, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListResponseTaskRunResponsePublicV2: + """List Agent Runs + + List the runs of an agent, newest first, paginated with `offset`/`limit`. + + :param agent_id: (required) + :type agent_id: UUID + :param offset: + :type offset: int + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_agent_runs_serialize( + agent_id=agent_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseTaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_agent_runs_with_http_info( + self, + agent_id: UUID, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListResponseTaskRunResponsePublicV2]: + """List Agent Runs + + List the runs of an agent, newest first, paginated with `offset`/`limit`. + + :param agent_id: (required) + :type agent_id: UUID + :param offset: + :type offset: int + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_agent_runs_serialize( + agent_id=agent_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseTaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_agent_runs_without_preload_content( + self, + agent_id: UUID, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Agent Runs + + List the runs of an agent, newest first, paginated with `offset`/`limit`. + + :param agent_id: (required) + :type agent_id: UUID + :param offset: + :type offset: int + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_agent_runs_serialize( + agent_id=agent_id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseTaskRunResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_agent_runs_serialize( + self, + agent_id, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agent_id'] = agent_id + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/agents/{agent_id}/runs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_agent_templates( + self, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListResponseWebSearchAgentTemplateResponsePublicV2: + """List Agent Templates + + List the pre-built agent templates available to your account. Use a template's `template_name` with `POST /v2/agents` to create an agent instance from it. + + :param offset: + :type offset: int + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_agent_templates_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseWebSearchAgentTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_agent_templates_with_http_info( + self, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListResponseWebSearchAgentTemplateResponsePublicV2]: + """List Agent Templates + + List the pre-built agent templates available to your account. Use a template's `template_name` with `POST /v2/agents` to create an agent instance from it. + + :param offset: + :type offset: int + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_agent_templates_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseWebSearchAgentTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_agent_templates_without_preload_content( + self, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Agent Templates + + List the pre-built agent templates available to your account. Use a template's `template_name` with `POST /v2/agents` to create an agent instance from it. + + :param offset: + :type offset: int + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_agent_templates_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseWebSearchAgentTemplateResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_agent_templates_serialize( + self, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/agents/templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_agents( + self, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListResponseWebSearchAgentResponsePublicV2: + """List Agents + + List the active Web Search Agents in your account. Results are scoped to the workspace resolved from your token (or the optional `workspace_id` query parameter) and paginated with `offset`/`limit`. + + :param offset: + :type offset: int + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_agents_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseWebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_agents_with_http_info( + self, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListResponseWebSearchAgentResponsePublicV2]: + """List Agents + + List the active Web Search Agents in your account. Results are scoped to the workspace resolved from your token (or the optional `workspace_id` query parameter) and paginated with `offset`/`limit`. + + :param offset: + :type offset: int + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_agents_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseWebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_agents_without_preload_content( + self, + offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, + limit: Optional[Annotated[int, Field(le=200, strict=True, ge=1)]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Agents + + List the active Web Search Agents in your account. Results are scoped to the workspace resolved from your token (or the optional `workspace_id` query parameter) and paginated with `offset`/`limit`. + + :param offset: + :type offset: int + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_agents_serialize( + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListResponseWebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_agents_serialize( + self, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer', + 'APIKeyCookie' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/agents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def stream_agent_run_events( + self, + agent_id: UUID, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StreamAgentRunEvents200Response: + """Stream Agent Run Events + + Stream a run's progress as [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) (`text/event-stream`). Create the run with `enable_events: true` to have events published. A keep-alive comment is sent every 15 seconds. + + :param agent_id: (required) + :type agent_id: UUID + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stream_agent_run_events_serialize( + agent_id=agent_id, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StreamAgentRunEvents200Response", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def stream_agent_run_events_with_http_info( + self, + agent_id: UUID, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StreamAgentRunEvents200Response]: + """Stream Agent Run Events + + Stream a run's progress as [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) (`text/event-stream`). Create the run with `enable_events: true` to have events published. A keep-alive comment is sent every 15 seconds. + + :param agent_id: (required) + :type agent_id: UUID + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stream_agent_run_events_serialize( + agent_id=agent_id, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StreamAgentRunEvents200Response", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def stream_agent_run_events_without_preload_content( + self, + agent_id: UUID, + run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Stream Agent Run Events + + Stream a run's progress as [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) (`text/event-stream`). Create the run with `enable_events: true` to have events published. A keep-alive comment is sent every 15 seconds. + + :param agent_id: (required) + :type agent_id: UUID + :param run_id: (required) + :type run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stream_agent_run_events_serialize( + agent_id=agent_id, + run_id=run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StreamAgentRunEvents200Response", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stream_agent_run_events_serialize( + self, + agent_id, + run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agent_id'] = agent_id + if run_id is not None: + _path_params['run_id'] = run_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/event-stream', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/agents/{agent_id}/runs/{run_id}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_agent( + self, + agent_id: UUID, + json_patch_op: List[JsonPatchOp], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebSearchAgentResponsePublicV2: + """Update Agent + + Update an agent with a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) document — an array of `{op, path, value}` operations applied to the agent, e.g. `[{\"op\": \"replace\", \"path\": \"/display_name\", \"value\": \"My agent\"}]`. Returns the updated agent. + + :param agent_id: (required) + :type agent_id: UUID + :param json_patch_op: (required) + :type json_patch_op: List[JsonPatchOp] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_serialize( + agent_id=agent_id, + json_patch_op=json_patch_op, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_agent_with_http_info( + self, + agent_id: UUID, + json_patch_op: List[JsonPatchOp], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebSearchAgentResponsePublicV2]: + """Update Agent + + Update an agent with a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) document — an array of `{op, path, value}` operations applied to the agent, e.g. `[{\"op\": \"replace\", \"path\": \"/display_name\", \"value\": \"My agent\"}]`. Returns the updated agent. + + :param agent_id: (required) + :type agent_id: UUID + :param json_patch_op: (required) + :type json_patch_op: List[JsonPatchOp] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_serialize( + agent_id=agent_id, + json_patch_op=json_patch_op, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_agent_without_preload_content( + self, + agent_id: UUID, + json_patch_op: List[JsonPatchOp], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Agent + + Update an agent with a [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902) document — an array of `{op, path, value}` operations applied to the agent, e.g. `[{\"op\": \"replace\", \"path\": \"/display_name\", \"value\": \"My agent\"}]`. Returns the updated agent. + + :param agent_id: (required) + :type agent_id: UUID + :param json_patch_op: (required) + :type json_patch_op: List[JsonPatchOp] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_agent_serialize( + agent_id=agent_id, + json_patch_op=json_patch_op, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebSearchAgentResponsePublicV2", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_agent_serialize( + self, + agent_id, + json_patch_op, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'JsonPatchOp': '', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agent_id'] = agent_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if json_patch_op is not None: + _body_params = json_patch_op + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/json-patch+json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v2/agents/{agent_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/search_api.py b/candidate/generated/nimble_client/api/search_api.py new file mode 100644 index 0000000..424ce16 --- /dev/null +++ b/candidate/generated/nimble_client/api/search_api.py @@ -0,0 +1,307 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from nimble_client.models.search_request import SearchRequest +from nimble_client.models.search_response import SearchResponse + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class SearchApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def perform_search( + self, + search_request: SearchRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SearchResponse: + """Search + + + :param search_request: (required) + :type search_request: SearchRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._perform_search_serialize( + search_request=search_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def perform_search_with_http_info( + self, + search_request: SearchRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SearchResponse]: + """Search + + + :param search_request: (required) + :type search_request: SearchRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._perform_search_serialize( + search_request=search_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def perform_search_without_preload_content( + self, + search_request: SearchRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Search + + + :param search_request: (required) + :type search_request: SearchRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._perform_search_serialize( + search_request=search_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SearchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _perform_search_serialize( + self, + search_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if search_request is not None: + _body_params = search_request + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/search', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/serp_api.py b/candidate/generated/nimble_client/api/serp_api.py new file mode 100644 index 0000000..83ebb91 --- /dev/null +++ b/candidate/generated/nimble_client/api/serp_api.py @@ -0,0 +1,1172 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from nimble_client.models.run_extract_template200_response import RunExtractTemplate200Response +from nimble_client.models.serp_async_response import SerpAsyncResponse +from nimble_client.models.serp_batch_payload import SerpBatchPayload +from nimble_client.models.serp_batch_response import SerpBatchResponse +from nimble_client.models.serp_payload import SerpPayload +from nimble_client.models.submit_async_serp_request import SubmitAsyncSerpRequest + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class SERPApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def fast_serp( + self, + serp_payload: Optional[SerpPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunExtractTemplate200Response: + """Fast SERP + + + :param serp_payload: + :type serp_payload: SerpPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fast_serp_serialize( + serp_payload=serp_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def fast_serp_with_http_info( + self, + serp_payload: Optional[SerpPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunExtractTemplate200Response]: + """Fast SERP + + + :param serp_payload: + :type serp_payload: SerpPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fast_serp_serialize( + serp_payload=serp_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def fast_serp_without_preload_content( + self, + serp_payload: Optional[SerpPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fast SERP + + + :param serp_payload: + :type serp_payload: SerpPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fast_serp_serialize( + serp_payload=serp_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fast_serp_serialize( + self, + serp_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if serp_payload is not None: + _body_params = serp_payload + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/fast-serp', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def serp( + self, + x_nimble_zdr: Annotated[Optional[StrictStr], Field(description="Enable retention protection before JSON body parsing.")] = None, + serp_payload: Optional[SerpPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunExtractTemplate200Response: + """SERP + + + :param x_nimble_zdr: Enable retention protection before JSON body parsing. + :type x_nimble_zdr: str + :param serp_payload: + :type serp_payload: SerpPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serp_serialize( + x_nimble_zdr=x_nimble_zdr, + serp_payload=serp_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def serp_with_http_info( + self, + x_nimble_zdr: Annotated[Optional[StrictStr], Field(description="Enable retention protection before JSON body parsing.")] = None, + serp_payload: Optional[SerpPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunExtractTemplate200Response]: + """SERP + + + :param x_nimble_zdr: Enable retention protection before JSON body parsing. + :type x_nimble_zdr: str + :param serp_payload: + :type serp_payload: SerpPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serp_serialize( + x_nimble_zdr=x_nimble_zdr, + serp_payload=serp_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def serp_without_preload_content( + self, + x_nimble_zdr: Annotated[Optional[StrictStr], Field(description="Enable retention protection before JSON body parsing.")] = None, + serp_payload: Optional[SerpPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """SERP + + + :param x_nimble_zdr: Enable retention protection before JSON body parsing. + :type x_nimble_zdr: str + :param serp_payload: + :type serp_payload: SerpPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serp_serialize( + x_nimble_zdr=x_nimble_zdr, + serp_payload=serp_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunExtractTemplate200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _serp_serialize( + self, + x_nimble_zdr, + serp_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_nimble_zdr is not None: + self.api_client._set_header(_header_params, 'x-nimble-zdr', x_nimble_zdr) + # process the form parameters + # process the body parameter + if serp_payload is not None: + _body_params = serp_payload + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/serp', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def submit_async_serp( + self, + x_nimble_zdr: Annotated[Optional[StrictStr], Field(description="Enable retention protection before JSON body parsing.")] = None, + submit_async_serp_request: Optional[SubmitAsyncSerpRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SerpAsyncResponse: + """SERP Async Endpoint + + + :param x_nimble_zdr: Enable retention protection before JSON body parsing. + :type x_nimble_zdr: str + :param submit_async_serp_request: + :type submit_async_serp_request: SubmitAsyncSerpRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_async_serp_serialize( + x_nimble_zdr=x_nimble_zdr, + submit_async_serp_request=submit_async_serp_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerpAsyncResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def submit_async_serp_with_http_info( + self, + x_nimble_zdr: Annotated[Optional[StrictStr], Field(description="Enable retention protection before JSON body parsing.")] = None, + submit_async_serp_request: Optional[SubmitAsyncSerpRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SerpAsyncResponse]: + """SERP Async Endpoint + + + :param x_nimble_zdr: Enable retention protection before JSON body parsing. + :type x_nimble_zdr: str + :param submit_async_serp_request: + :type submit_async_serp_request: SubmitAsyncSerpRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_async_serp_serialize( + x_nimble_zdr=x_nimble_zdr, + submit_async_serp_request=submit_async_serp_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerpAsyncResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def submit_async_serp_without_preload_content( + self, + x_nimble_zdr: Annotated[Optional[StrictStr], Field(description="Enable retention protection before JSON body parsing.")] = None, + submit_async_serp_request: Optional[SubmitAsyncSerpRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """SERP Async Endpoint + + + :param x_nimble_zdr: Enable retention protection before JSON body parsing. + :type x_nimble_zdr: str + :param submit_async_serp_request: + :type submit_async_serp_request: SubmitAsyncSerpRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_async_serp_serialize( + x_nimble_zdr=x_nimble_zdr, + submit_async_serp_request=submit_async_serp_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerpAsyncResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _submit_async_serp_serialize( + self, + x_nimble_zdr, + submit_async_serp_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_nimble_zdr is not None: + self.api_client._set_header(_header_params, 'x-nimble-zdr', x_nimble_zdr) + # process the form parameters + # process the body parameter + if submit_async_serp_request is not None: + _body_params = submit_async_serp_request + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/serp/async', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def submit_batch_serp( + self, + x_nimble_zdr: Annotated[Optional[StrictStr], Field(description="Enable retention protection before JSON body parsing.")] = None, + serp_batch_payload: Optional[SerpBatchPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SerpBatchResponse: + """SERP Batch Endpoint + + + :param x_nimble_zdr: Enable retention protection before JSON body parsing. + :type x_nimble_zdr: str + :param serp_batch_payload: + :type serp_batch_payload: SerpBatchPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_batch_serp_serialize( + x_nimble_zdr=x_nimble_zdr, + serp_batch_payload=serp_batch_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerpBatchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def submit_batch_serp_with_http_info( + self, + x_nimble_zdr: Annotated[Optional[StrictStr], Field(description="Enable retention protection before JSON body parsing.")] = None, + serp_batch_payload: Optional[SerpBatchPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SerpBatchResponse]: + """SERP Batch Endpoint + + + :param x_nimble_zdr: Enable retention protection before JSON body parsing. + :type x_nimble_zdr: str + :param serp_batch_payload: + :type serp_batch_payload: SerpBatchPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_batch_serp_serialize( + x_nimble_zdr=x_nimble_zdr, + serp_batch_payload=serp_batch_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerpBatchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def submit_batch_serp_without_preload_content( + self, + x_nimble_zdr: Annotated[Optional[StrictStr], Field(description="Enable retention protection before JSON body parsing.")] = None, + serp_batch_payload: Optional[SerpBatchPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """SERP Batch Endpoint + + + :param x_nimble_zdr: Enable retention protection before JSON body parsing. + :type x_nimble_zdr: str + :param serp_batch_payload: + :type serp_batch_payload: SerpBatchPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_batch_serp_serialize( + x_nimble_zdr=x_nimble_zdr, + serp_batch_payload=serp_batch_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerpBatchResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _submit_batch_serp_serialize( + self, + x_nimble_zdr, + serp_batch_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_nimble_zdr is not None: + self.api_client._set_header(_header_params, 'x-nimble-zdr', x_nimble_zdr) + # process the form parameters + # process the body parameter + if serp_batch_payload is not None: + _body_params = serp_batch_payload + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + self.api_client._set_header(_header_params, 'Content-Type', _content_type) + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + self.api_client._set_header(_header_params, 'Content-Type', _default_content_type) + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v2/serp/batch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api/tasks_api.py b/candidate/generated/nimble_client/api/tasks_api.py new file mode 100644 index 0000000..b000e3a --- /dev/null +++ b/candidate/generated/nimble_client/api/tasks_api.py @@ -0,0 +1,863 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Any, Dict, Optional +from typing_extensions import Annotated +from uuid import UUID +from nimble_client.models.task_list_response import TaskListResponse +from nimble_client.models.task_response_schema import TaskResponseSchema + +from nimble_client.api_client import ApiClient, RequestSerialized +from nimble_client.api_response import ApiResponse +from nimble_client.rest import RESTResponseType + + +class TasksApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_task( + self, + task_id: Annotated[StrictStr, Field(description="The unique identifier of the task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskResponseSchema: + """Get task details + + Retrieve the details of a specific task by its ID. + + :param task_id: The unique identifier of the task. (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_task_serialize( + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskResponseSchema", + '404': "TaskNotFoundErrorResponse", + '500': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_task_with_http_info( + self, + task_id: Annotated[StrictStr, Field(description="The unique identifier of the task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskResponseSchema]: + """Get task details + + Retrieve the details of a specific task by its ID. + + :param task_id: The unique identifier of the task. (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_task_serialize( + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskResponseSchema", + '404': "TaskNotFoundErrorResponse", + '500': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_task_without_preload_content( + self, + task_id: Annotated[StrictStr, Field(description="The unique identifier of the task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get task details + + Retrieve the details of a specific task by its ID. + + :param task_id: The unique identifier of the task. (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_task_serialize( + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskResponseSchema", + '404': "TaskNotFoundErrorResponse", + '500': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_task_serialize( + self, + task_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if task_id is not None: + _path_params['task_id'] = task_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/tasks/{task_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_task_results( + self, + task_id: Annotated[StrictStr, Field(description="The unique identifier of the task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, Optional[object]]: + """Get task results + + Retrieve the results of a completed task. + + :param task_id: The unique identifier of the task. (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_task_results_serialize( + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, Optional[object]]", + '202': "TaskPendingResponse", + '404': "TaskErrorResponse", + '500': "TaskFailedResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_task_results_with_http_info( + self, + task_id: Annotated[StrictStr, Field(description="The unique identifier of the task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, Optional[object]]]: + """Get task results + + Retrieve the results of a completed task. + + :param task_id: The unique identifier of the task. (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_task_results_serialize( + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, Optional[object]]", + '202': "TaskPendingResponse", + '404': "TaskErrorResponse", + '500': "TaskFailedResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_task_results_without_preload_content( + self, + task_id: Annotated[StrictStr, Field(description="The unique identifier of the task.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get task results + + Retrieve the results of a completed task. + + :param task_id: The unique identifier of the task. (required) + :type task_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_task_results_serialize( + task_id=task_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, Optional[object]]", + '202': "TaskPendingResponse", + '404': "TaskErrorResponse", + '500': "TaskFailedResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_task_results_serialize( + self, + task_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if task_id is not None: + _path_params['task_id'] = task_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/tasks/{task_id}/results', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_tasks( + self, + cursor: Annotated[Optional[UUID], Field(description="Cursor for pagination. Use the next_cursor from the previous response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]], Field(description="Number of tasks to return per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TaskListResponse: + """List tasks + + Retrieve a paginated list of tasks for the authenticated account. + + :param cursor: Cursor for pagination. Use the next_cursor from the previous response. + :type cursor: UUID + :param limit: Number of tasks to return per page. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_tasks_serialize( + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskListResponse", + '400': "TaskErrorResponse", + '500': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_tasks_with_http_info( + self, + cursor: Annotated[Optional[UUID], Field(description="Cursor for pagination. Use the next_cursor from the previous response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]], Field(description="Number of tasks to return per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TaskListResponse]: + """List tasks + + Retrieve a paginated list of tasks for the authenticated account. + + :param cursor: Cursor for pagination. Use the next_cursor from the previous response. + :type cursor: UUID + :param limit: Number of tasks to return per page. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_tasks_serialize( + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskListResponse", + '400': "TaskErrorResponse", + '500': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_tasks_without_preload_content( + self, + cursor: Annotated[Optional[UUID], Field(description="Cursor for pagination. Use the next_cursor from the previous response.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]], Field(description="Number of tasks to return per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List tasks + + Retrieve a paginated list of tasks for the authenticated account. + + :param cursor: Cursor for pagination. Use the next_cursor from the previous response. + :type cursor: UUID + :param limit: Number of tasks to return per page. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_tasks_serialize( + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TaskListResponse", + '400': "TaskErrorResponse", + '500': "TaskErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_tasks_serialize( + self, + cursor, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Any] = self.api_client._merge_headers(_headers) + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if not any(key.lower() == 'accept' for key in _header_params): + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v2/tasks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/candidate/generated/nimble_client/api_client.py b/candidate/generated/nimble_client/api_client.py new file mode 100644 index 0000000..3b4e525 --- /dev/null +++ b/candidate/generated/nimble_client/api_client.py @@ -0,0 +1,865 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile +import uuid + +from urllib.parse import quote +from typing import Any, Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from nimble_client.configuration import Configuration +from nimble_client.api_response import ApiResponse, T as ApiResponseT +import nimble_client.models +from nimble_client import rest +from nimble_client.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'UUID': uuid.UUID, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + for name, value in reversed(self.default_headers.items()): + if name.lower() == 'user-agent': + return value + raise KeyError('User-Agent') + + @user_agent.setter + def user_agent(self, value): + self._set_header(self.default_headers, 'User-Agent', value) + + def set_default_header(self, header_name, header_value): + self._set_header(self.default_headers, header_name, header_value) + + + @staticmethod + def _set_header(headers: Dict[str, Any], name: str, value: Any) -> None: + """Replace a header case-insensitively, retaining the winning spelling.""" + for key in list(headers): + if key.lower() == name.lower(): + del headers[key] + headers[name] = value + + @classmethod + def _merge_headers(cls, *sources: Optional[Dict[str, Any]]) -> Dict[str, Any]: + """Copy headers; later sources and later entries in each dict win.""" + headers: Dict[str, Any] = {} + for source in sources: + for name, value in (source or {}).items(): + cls._set_header(headers, name, value) + return headers + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = self._merge_headers(header_params, self.default_headers) + if self.cookie: + self._set_header(header_params, 'Cookie', self.cookie) + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it. + if response_type is None and str(response_data.status) not in response_types_map \ + and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \ + and 'default' in response_types_map: + response_type = response_types_map['default'] + + # deserialize response data + response_text = None + return_data = None + try: + if response_type in ("bytearray", "bytes"): + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.headers.get('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.headers, + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, uuid.UUID): + return str(obj) + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + elif isinstance(obj, dict): + return { + key: self.sanitize_for_serialization(val) + for key, val in obj.items() + } + + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return self.sanitize_for_serialization(obj_dict) + + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('Optional['): + m = re.match(r'Optional\[(.*)]', klass) + assert m is not None, "Malformed Optional type definition" + # data is not None here, so the optionality is already resolved + return self.__deserialize(data, m.group(1)) + + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(nimble_client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass is object: + return self.__deserialize_object(data) + elif klass is datetime.date: + return self.__deserialize_date(data) + elif klass is datetime.datetime: + return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend( + (k, str(value).lower() if isinstance(value, bool) else value) + for value in v + ) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join( + str(value).lower() if isinstance(value, bool) else str(value) + for value in v))) + else: + new_params.append((k, v)) + return new_params + + def explode_query_object(self, name, obj): + """form style, explode: one query parameter per entry, keyed by the property name; a list repeats the name, None is left out""" + obj = self.sanitize_for_serialization(obj) + if not isinstance(obj, dict): + obj = {name: obj} + return [(k, item) for k, v in obj.items() for item in (v if isinstance(v, (list, tuple)) else [v]) if item is not None] + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + # a collection format applies only to a list; an exploded entry may share a declared array parameter's name + if k in collection_formats and isinstance(v, (list, tuple)): + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend( + (quote(str(k)), quote(str(value).lower() if isinstance(value, bool) else str(value))) + for value in v + ) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (quote(str(k)), delimiter.join( + quote(str(value).lower() if isinstance(value, bool) else str(value)) + for value in v)) + ) + else: + # names are quoted too: an exploded object's names are runtime data + new_params.append((quote(str(k)), quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + for key in list(headers): + if key.lower() == 'cookie': + self._set_header(headers, 'Cookie', headers[key]) + break + if not headers.get('Cookie'): + headers['Cookie'] = "" + else: + headers['Cookie'] += "; " + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") + headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + self._set_header(headers, auth_setting['key'], auth_setting['value']) + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.headers.get("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/candidate/generated/nimble_client/api_response.py b/candidate/generated/nimble_client/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/candidate/generated/nimble_client/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/candidate/generated/nimble_client/configuration.py b/candidate/generated/nimble_client/configuration.py new file mode 100644 index 0000000..b505431 --- /dev/null +++ b/candidate/generated/nimble_client/configuration.py @@ -0,0 +1,691 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import http.client as httplib +import logging +from logging import FileHandler +import multiprocessing +import ssl +import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from urllib.parse import urlparse +from urllib.request import getproxies +from typing_extensions import NotRequired, Self + +import urllib3 + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "APIKeyCookie": APIKeyAuthSetting, + "BearerAuth": BearerAuthSetting, + "HTTPBearer": BearerAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: int | urllib3.util.retry.Retry - Retry configuration. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param cert_file: the path to a client certificate file, for mTLS. + :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param no_proxy: Comma-separated hosts that bypass the proxy. + :param proxy_headers: Proxy headers. + :param proxy_ssl_context: SSL context used only for the TLS handshake with the proxy itself, independent of the destination TLS settings. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = nimble_client.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[Union[int, urllib3.util.retry.Retry]] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + cert_file: Optional[str]=None, + key_file: Optional[str]=None, + verify_ssl: bool=True, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + no_proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + proxy_ssl_context: Optional[ssl.SSLContext]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + self._base_path = "https://sdk.nimbleway.com" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("nimble_client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = verify_ssl + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ + self.cert_file = cert_file + """client certificate file + """ + self.key_file = key_file + """client key file + """ + self.assert_hostname = assert_hostname + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = tls_server_name + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. None in the constructor is coerced to cpu_count * 5. + """ + + # urllib3 does not read proxy environment variables itself: + # https://github.com/urllib3/urllib3/issues/1785 + # A proxy taken from the environment is re-resolved when the host is + # assigned; see the host setter. + self._proxy_from_env = proxy is None + if proxy is None or no_proxy is None: + proxies = getproxies() + if proxy is None: + proxy = self._env_proxy(proxies, self.host) + if no_proxy is None: + no_proxy = proxies.get("no") + self._proxy = proxy + self.no_proxy = no_proxy + """Hosts that bypass the proxy + """ + self.proxy_headers = proxy_headers + """Proxy headers + """ + self.proxy_ssl_context = proxy_ssl_context + """SSL context used only for the TLS handshake with the proxy itself + (e.g. an HTTPS CONNECT tunnel), independent of the destination TLS + settings above. + """ + self.safe_chars_for_path_param = safe_chars_for_path_param + """Safe chars for path_param + """ + self.retries = retries + """Retry configuration + """ + # Enable client side validation + self.client_side_validation = client_side_validation + + self.socket_options = socket_options + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = datetime_format + """datetime format + """ + + self.date_format = date_format + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k == 'proxy_ssl_context': + # ssl.SSLContext holds unpicklable C state and can't be deepcopied. + setattr(result, k, v) + continue + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setter to re-create the file handler (excluded from __dict__ copy) + result.logger_file = self.logger_file + + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default + + @property + def logger_file(self) -> Optional[str]: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value: Optional[str]) -> None: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value: bool) -> None: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value: str) -> None: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get( + identifier, self.api_key_prefix.get(alias) if alias is not None else None) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + return None + + def get_basic_auth_token(self) -> Optional[str]: + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self)-> AuthSettings: + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth: AuthSettings = {} + if 'APIKeyCookie' in self.api_key: + auth['APIKeyCookie'] = { + 'type': 'api_key', + 'in': 'cookie', + 'key': 'token', + 'value': self.get_api_key_with_prefix( + 'APIKeyCookie', + ), + } + if self.access_token is not None: + auth['BearerAuth'] = { + 'type': 'bearer', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + if self.access_token is not None: + auth['HTTPBearer'] = { + 'type': 'bearer', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self) -> str: + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 2.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self) -> List[HostSetting]: + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://sdk.nimbleway.com", + 'description': "No description provided", + } + ] + + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and variable['enum_values'] \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None + if self._proxy_from_env: + # the scheme-specific proxy depends on the host, which is + # commonly assigned after construction + self._proxy = self._env_proxy(getproxies(), value) + + @staticmethod + def _env_proxy(proxies: Dict[str, str], host: str) -> Optional[str]: + """Pick the environment proxy that applies to `host`.""" + return proxies.get(urlparse(host).scheme) or proxies.get("all") + + @property + def proxy(self) -> Optional[str]: + """Proxy URL + """ + return self._proxy + + @proxy.setter + def proxy(self, value: Optional[str]) -> None: + self._proxy = value + self._proxy_from_env = False diff --git a/candidate/generated/nimble_client/exceptions.py b/candidate/generated/nimble_client/exceptions.py new file mode 100644 index 0000000..5279c94 --- /dev/null +++ b/candidate/generated/nimble_client/exceptions.py @@ -0,0 +1,218 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.headers + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/candidate/generated/nimble_client/models/__init__.py b/candidate/generated/nimble_client/models/__init__.py new file mode 100644 index 0000000..1f550d8 --- /dev/null +++ b/candidate/generated/nimble_client/models/__init__.py @@ -0,0 +1,381 @@ +# coding: utf-8 + +# flake8: noqa +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +# import models into model package +from nimble_client.models.agent_batch_body import AgentBatchBody +from nimble_client.models.agent_batch_body_inputs_inner import AgentBatchBodyInputsInner +from nimble_client.models.agent_batch_body_shared_inputs import AgentBatchBodySharedInputs +from nimble_client.models.agent_body import AgentBody +from nimble_client.models.agent_sources_public_v1 import AgentSourcesPublicV1 +from nimble_client.models.agent_sources_public_v2 import AgentSourcesPublicV2 +from nimble_client.models.agent_sources_response_public_v1 import AgentSourcesResponsePublicV1 +from nimble_client.models.agent_sources_response_public_v2 import AgentSourcesResponsePublicV2 +from nimble_client.models.amount import Amount +from nimble_client.models.answer_annotation_citation import AnswerAnnotationCitation +from nimble_client.models.answer_marker_citation import AnswerMarkerCitation +from nimble_client.models.answer_request import AnswerRequest +from nimble_client.models.answer_response import AnswerResponse +from nimble_client.models.artifact_download_url_public_v1 import ArtifactDownloadUrlPublicV1 +from nimble_client.models.artifact_download_url_public_v2 import ArtifactDownloadUrlPublicV2 +from nimble_client.models.artifact_list_public_v1 import ArtifactListPublicV1 +from nimble_client.models.artifact_list_public_v2 import ArtifactListPublicV2 +from nimble_client.models.artifact_preview_public_v1 import ArtifactPreviewPublicV1 +from nimble_client.models.artifact_preview_public_v2 import ArtifactPreviewPublicV2 +from nimble_client.models.artifact_public_v1 import ArtifactPublicV1 +from nimble_client.models.artifact_public_v2 import ArtifactPublicV2 +from nimble_client.models.auto_scroll_action import AutoScrollAction +from nimble_client.models.auto_scroll_action_auto_scroll import AutoScrollActionAutoScroll +from nimble_client.models.auto_scroll_action_auto_scroll_one_of import AutoScrollActionAutoScrollOneOf +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.avg_duration_seconds import AvgDurationSeconds +from nimble_client.models.batch_get_response import BatchGetResponse +from nimble_client.models.batch_get_response_tasks_inner import BatchGetResponseTasksInner +from nimble_client.models.batch_progress_response import BatchProgressResponse +from nimble_client.models.browser_action import BrowserAction +from nimble_client.models.citation import Citation +from nimble_client.models.citation_config import CitationConfig +from nimble_client.models.citations import Citations +from nimble_client.models.click_action import ClickAction +from nimble_client.models.click_action_click import ClickActionClick +from nimble_client.models.click_action_click_one_of import ClickActionClickOneOf +from nimble_client.models.company_entity import CompanyEntity +from nimble_client.models.company_financials import CompanyFinancials +from nimble_client.models.company_headquarters import CompanyHeadquarters +from nimble_client.models.company_web_traffic import CompanyWebTraffic +from nimble_client.models.content import Content +from nimble_client.models.country_rank import CountryRank +from nimble_client.models.crawl_api_response import CrawlApiResponse +from nimble_client.models.crawl_api_response_completed_at import CrawlApiResponseCompletedAt +from nimble_client.models.crawl_api_response_crawl_options import CrawlApiResponseCrawlOptions +from nimble_client.models.crawl_api_response_crawl_options_callback import CrawlApiResponseCrawlOptionsCallback +from nimble_client.models.crawl_api_response_crawl_options_callback_any_of import CrawlApiResponseCrawlOptionsCallbackAnyOf +from nimble_client.models.crawl_api_response_created_at import CrawlApiResponseCreatedAt +from nimble_client.models.crawl_api_response_tasks_inner import CrawlApiResponseTasksInner +from nimble_client.models.crawl_by_filters_response import CrawlByFiltersResponse +from nimble_client.models.crawl_by_filters_response_pagination import CrawlByFiltersResponsePagination +from nimble_client.models.crawl_payload import CrawlPayload +from nimble_client.models.crawl_payload_callback import CrawlPayloadCallback +from nimble_client.models.crawl_payload_callback_any_of import CrawlPayloadCallbackAnyOf +from nimble_client.models.crawl_payload_callback_any_of_any_of import CrawlPayloadCallbackAnyOfAnyOf +from nimble_client.models.crawl_payload_extract_options import CrawlPayloadExtractOptions +from nimble_client.models.crawl_payload_extract_options_browser import CrawlPayloadExtractOptionsBrowser +from nimble_client.models.crawl_payload_extract_options_browser_any_of import CrawlPayloadExtractOptionsBrowserAnyOf +from nimble_client.models.crawl_payload_extract_options_cookies import CrawlPayloadExtractOptionsCookies +from nimble_client.models.crawl_payload_extract_options_cookies_any_of_inner import CrawlPayloadExtractOptionsCookiesAnyOfInner +from nimble_client.models.crawl_payload_extract_options_cookies_any_of_inner_expires import CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires +from nimble_client.models.crawl_payload_extract_options_cookies_any_of_inner_max_age import CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge +from nimble_client.models.crawl_payload_extract_options_file_parsing_options import CrawlPayloadExtractOptionsFileParsingOptions +from nimble_client.models.crawl_payload_extract_options_headers_value import CrawlPayloadExtractOptionsHeadersValue +from nimble_client.models.crawl_payload_extract_options_network_capture_inner import CrawlPayloadExtractOptionsNetworkCaptureInner +from nimble_client.models.crawl_payload_extract_options_network_capture_inner_resource_type import CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType +from nimble_client.models.crawl_payload_extract_options_network_capture_inner_url import CrawlPayloadExtractOptionsNetworkCaptureInnerUrl +from nimble_client.models.crawl_payload_extract_options_parser import CrawlPayloadExtractOptionsParser +from nimble_client.models.crawl_payload_extract_options_render import CrawlPayloadExtractOptionsRender +from nimble_client.models.crawl_payload_extract_options_session import CrawlPayloadExtractOptionsSession +from nimble_client.models.crawl_payload_extract_options_skill import CrawlPayloadExtractOptionsSkill +from nimble_client.models.create_extract_template_generation_request_public_v2 import CreateExtractTemplateGenerationRequestPublicV2 +from nimble_client.models.create_extract_template_metadata_public_v2 import CreateExtractTemplateMetadataPublicV2 +from nimble_client.models.create_extract_template_refinement_request_public_v2 import CreateExtractTemplateRefinementRequestPublicV2 +from nimble_client.models.create_job_request_public_v1 import CreateJobRequestPublicV1 +from nimble_client.models.create_job_request_public_v2 import CreateJobRequestPublicV2 +from nimble_client.models.create_template_generation_request_public_v1 import CreateTemplateGenerationRequestPublicV1 +from nimble_client.models.create_template_metadata_public_v1 import CreateTemplateMetadataPublicV1 +from nimble_client.models.create_template_refinement_request_public_v1 import CreateTemplateRefinementRequestPublicV1 +from nimble_client.models.default import Default +from nimble_client.models.delete_crawl200_response import DeleteCrawl200Response +from nimble_client.models.driver_resolution_response import DriverResolutionResponse +from nimble_client.models.duration import Duration +from nimble_client.models.effort import Effort +from nimble_client.models.eval_action import EvalAction +from nimble_client.models.eval_action_eval import EvalActionEval +from nimble_client.models.eval_action_eval_one_of import EvalActionEvalOneOf +from nimble_client.models.extract200_response import Extract200Response +from nimble_client.models.extract200_response_data import Extract200ResponseData +from nimble_client.models.extract200_response_data_browser_actions import Extract200ResponseDataBrowserActions +from nimble_client.models.extract200_response_data_browser_actions_results_inner import Extract200ResponseDataBrowserActionsResultsInner +from nimble_client.models.extract200_response_data_network_capture_inner import Extract200ResponseDataNetworkCaptureInner +from nimble_client.models.extract200_response_data_network_capture_inner_filter import Extract200ResponseDataNetworkCaptureInnerFilter +from nimble_client.models.extract200_response_data_network_capture_inner_filter_resource_type import Extract200ResponseDataNetworkCaptureInnerFilterResourceType +from nimble_client.models.extract200_response_data_network_capture_inner_filter_status_code import Extract200ResponseDataNetworkCaptureInnerFilterStatusCode +from nimble_client.models.extract200_response_data_network_capture_inner_filter_url import Extract200ResponseDataNetworkCaptureInnerFilterUrl +from nimble_client.models.extract200_response_data_network_capture_inner_results_inner import Extract200ResponseDataNetworkCaptureInnerResultsInner +from nimble_client.models.extract200_response_data_network_capture_inner_results_inner_request import Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest +from nimble_client.models.extract200_response_data_network_capture_inner_results_inner_response import Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse +from nimble_client.models.extract200_response_data_parsing import Extract200ResponseDataParsing +from nimble_client.models.extract200_response_data_redirects_inner import Extract200ResponseDataRedirectsInner +from nimble_client.models.extract200_response_debug import Extract200ResponseDebug +from nimble_client.models.extract200_response_metadata import Extract200ResponseMetadata +from nimble_client.models.extract200_response_pagination import Extract200ResponsePagination +from nimble_client.models.extract200_response_pagination_any_of import Extract200ResponsePaginationAnyOf +from nimble_client.models.extract200_response_pagination_any_of1_inner import Extract200ResponsePaginationAnyOf1Inner +from nimble_client.models.extract_async_response import ExtractAsyncResponse +from nimble_client.models.extract_async_response_task import ExtractAsyncResponseTask +from nimble_client.models.extract_batch_payload import ExtractBatchPayload +from nimble_client.models.extract_batch_payload_inputs_inner import ExtractBatchPayloadInputsInner +from nimble_client.models.extract_batch_payload_inputs_inner_all_of_render import ExtractBatchPayloadInputsInnerAllOfRender +from nimble_client.models.extract_batch_payload_shared_inputs import ExtractBatchPayloadSharedInputs +from nimble_client.models.extract_batch_response import ExtractBatchResponse +from nimble_client.models.extract_batch_response_tasks_inner import ExtractBatchResponseTasksInner +from nimble_client.models.extract_payload import ExtractPayload +from nimble_client.models.extract_template_filter_public_v2 import ExtractTemplateFilterPublicV2 +from nimble_client.models.extract_template_generation_response_public_v2 import ExtractTemplateGenerationResponsePublicV2 +from nimble_client.models.extract_template_response_public_v2 import ExtractTemplateResponsePublicV2 +from nimble_client.models.extract_template_sample_public_v2 import ExtractTemplateSamplePublicV2 +from nimble_client.models.extract_template_version_metadata_public_v2 import ExtractTemplateVersionMetadataPublicV2 +from nimble_client.models.extract_template_version_response_public_v2 import ExtractTemplateVersionResponsePublicV2 +from nimble_client.models.extraction_template_batch_body import ExtractionTemplateBatchBody +from nimble_client.models.extraction_template_batch_body_inputs_inner import ExtractionTemplateBatchBodyInputsInner +from nimble_client.models.extraction_template_batch_body_shared_inputs import ExtractionTemplateBatchBodySharedInputs +from nimble_client.models.extraction_template_body import ExtractionTemplateBody +from nimble_client.models.fetch_action import FetchAction +from nimble_client.models.fetch_action_fetch import FetchActionFetch +from nimble_client.models.fetch_action_fetch_one_of import FetchActionFetchOneOf +from nimble_client.models.fill_action import FillAction +from nimble_client.models.fill_options import FillOptions +from nimble_client.models.fill_options_one_of import FillOptionsOneOf +from nimble_client.models.fill_options_one_of1 import FillOptionsOneOf1 +from nimble_client.models.focus import Focus +from nimble_client.models.full_template_public_v1 import FullTemplatePublicV1 +from nimble_client.models.funding_round import FundingRound +from nimble_client.models.funding_total import FundingTotal +from nimble_client.models.gateway_def033cecba0ba3d1d3_text_run_trust import GatewayDef033cecba0ba3d1d3TextRunTrust +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def07f55f9a59071b48_json_claim_trust import GatewayDef07f55f9a59071b48JsonClaimTrust +from nimble_client.models.gateway_def0ce4e48f62cadb20_task_run_progress_stats_event import GatewayDef0ce4e48f62cadb20TaskRunProgressStatsEvent +from nimble_client.models.gateway_def1d511972aa34af3c_source_category import GatewayDef1d511972aa34af3cSourceCategory +from nimble_client.models.gateway_def21e0e16cb4d7d291_task_run_text_output import GatewayDef21e0e16cb4d7d291TaskRunTextOutput +from nimble_client.models.gateway_def2e37feaa5480a045_task_run_json_output import GatewayDef2e37feaa5480a045TaskRunJsonOutput +from nimble_client.models.gateway_def30520b8ccd213fdc_text_run_trust import GatewayDef30520b8ccd213fdcTextRunTrust +from nimble_client.models.gateway_def386b2024130bc052_task_run_source_stats import GatewayDef386b2024130bc052TaskRunSourceStats +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from nimble_client.models.gateway_def3b1480fbbf8bec18_text_claim_trust import GatewayDef3b1480fbbf8bec18TextClaimTrust +from nimble_client.models.gateway_def4f3b7ab2bb4e1911_task_run_progress_msg_event import GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent +from nimble_client.models.gateway_def54179423f3a3b0a8_json_claim_trust import GatewayDef54179423f3a3b0a8JsonClaimTrust +from nimble_client.models.gateway_def6651fbad4f19182d_task_run_status_value import GatewayDef6651fbad4f19182dTaskRunStatusValue +from nimble_client.models.gateway_def6d6a3bc063952be8_task_run_state_event import GatewayDef6d6a3bc063952be8TaskRunStateEvent +from nimble_client.models.gateway_def74786d0cba87c515_trust_source import GatewayDef74786d0cba87c515TrustSource +from nimble_client.models.gateway_def7feddd7d853a299b_trust_source_type import GatewayDef7feddd7d853a299bTrustSourceType +from nimble_client.models.gateway_def936b662c6aa9dee9_task_run_state_event_run import GatewayDef936b662c6aa9dee9TaskRunStateEventRun +from nimble_client.models.gateway_def977107e4b1c6ce11_trust_citation import GatewayDef977107e4b1c6ce11TrustCitation +from nimble_client.models.gateway_def_a7c1b2a8ffcc3b45_json_run_trust import GatewayDefA7c1b2a8ffcc3b45JsonRunTrust +from nimble_client.models.gateway_def_bc5dc0ea1fc57012_task_run_text_output import GatewayDefBc5dc0ea1fc57012TaskRunTextOutput +from nimble_client.models.gateway_def_c0fe0f39c374a83b_task_run_progress_stats_event import GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent +from nimble_client.models.gateway_def_ce9019f9e67ae903_trust_source import GatewayDefCe9019f9e67ae903TrustSource +from nimble_client.models.gateway_def_d1833882d7d67018_task_run_state_event_run import GatewayDefD1833882d7d67018TaskRunStateEventRun +from nimble_client.models.gateway_def_dc279d13fafb2038_task_run_json_output import GatewayDefDc279d13fafb2038TaskRunJsonOutput +from nimble_client.models.gateway_def_eb0114a225123d8d_json_run_trust import GatewayDefEb0114a225123d8dJsonRunTrust +from nimble_client.models.gateway_def_f23bf5d9e6e07ed3_trust_citation import GatewayDefF23bf5d9e6e07ed3TrustCitation +from nimble_client.models.gateway_def_fb397fec4dcf2a13_text_claim_trust import GatewayDefFb397fec4dcf2a13TextClaimTrust +from nimble_client.models.gateway_def_fd08b460e1d38459_task_run_state_event import GatewayDefFd08b460e1d38459TaskRunStateEvent +from nimble_client.models.get_cookies_action import GetCookiesAction +from nimble_client.models.get_cookies_action_get_cookies import GetCookiesActionGetCookies +from nimble_client.models.get_cookies_action_get_cookies_one_of import GetCookiesActionGetCookiesOneOf +from nimble_client.models.get_domain_knowledge_driver400_response import GetDomainKnowledgeDriver400Response +from nimble_client.models.goto_action import GotoAction +from nimble_client.models.goto_action_goto import GotoActionGoto +from nimble_client.models.goto_action_goto_one_of import GotoActionGotoOneOf +from nimble_client.models.http_validation_error import HTTPValidationError +from nimble_client.models.input_data import InputData +from nimble_client.models.job_context_public_v1 import JobContextPublicV1 +from nimble_client.models.job_context_public_v2 import JobContextPublicV2 +from nimble_client.models.job_destination_public_v1 import JobDestinationPublicV1 +from nimble_client.models.job_destination_public_v2 import JobDestinationPublicV2 +from nimble_client.models.job_inputs_public_v1 import JobInputsPublicV1 +from nimble_client.models.job_inputs_public_v2 import JobInputsPublicV2 +from nimble_client.models.job_list_filter_public_v2 import JobListFilterPublicV2 +from nimble_client.models.job_list_public_v1 import JobListPublicV1 +from nimble_client.models.job_public_v1 import JobPublicV1 +from nimble_client.models.job_public_v2 import JobPublicV2 +from nimble_client.models.job_run_cancel_response_public_v1 import JobRunCancelResponsePublicV1 +from nimble_client.models.job_run_cancel_response_public_v2 import JobRunCancelResponsePublicV2 +from nimble_client.models.job_run_detail_public_v1 import JobRunDetailPublicV1 +from nimble_client.models.job_run_detail_public_v2 import JobRunDetailPublicV2 +from nimble_client.models.job_run_error_public_v1 import JobRunErrorPublicV1 +from nimble_client.models.job_run_error_public_v2 import JobRunErrorPublicV2 +from nimble_client.models.job_run_list_filter_public_v2 import JobRunListFilterPublicV2 +from nimble_client.models.job_run_list_public_v1 import JobRunListPublicV1 +from nimble_client.models.job_run_public_v1 import JobRunPublicV1 +from nimble_client.models.job_run_public_v2 import JobRunPublicV2 +from nimble_client.models.job_run_summary_public_v1 import JobRunSummaryPublicV1 +from nimble_client.models.job_run_summary_public_v2 import JobRunSummaryPublicV2 +from nimble_client.models.job_schedule_public_v1 import JobSchedulePublicV1 +from nimble_client.models.job_schedule_public_v2 import JobSchedulePublicV2 +from nimble_client.models.json_claim_trust import JsonClaimTrust +from nimble_client.models.json_patch_op import JsonPatchOp +from nimble_client.models.json_run_trust import JsonRunTrust +from nimble_client.models.list_response_extract_template_response_public_v2 import ListResponseExtractTemplateResponsePublicV2 +from nimble_client.models.list_response_extract_template_version_response_public_v2 import ListResponseExtractTemplateVersionResponsePublicV2 +from nimble_client.models.list_response_job_public_v2 import ListResponseJobPublicV2 +from nimble_client.models.list_response_job_run_public_v2 import ListResponseJobRunPublicV2 +from nimble_client.models.list_response_task_run_response_public_v1 import ListResponseTaskRunResponsePublicV1 +from nimble_client.models.list_response_task_run_response_public_v2 import ListResponseTaskRunResponsePublicV2 +from nimble_client.models.list_response_web_search_agent_response_public_v1 import ListResponseWebSearchAgentResponsePublicV1 +from nimble_client.models.list_response_web_search_agent_response_public_v2 import ListResponseWebSearchAgentResponsePublicV2 +from nimble_client.models.list_response_web_search_agent_template_response_public_v1 import ListResponseWebSearchAgentTemplateResponsePublicV1 +from nimble_client.models.list_response_web_search_agent_template_response_public_v2 import ListResponseWebSearchAgentTemplateResponsePublicV2 +from nimble_client.models.location_inner import LocationInner +from nimble_client.models.managed_by import ManagedBy +from nimble_client.models.map_payload import MapPayload +from nimble_client.models.map_response import MapResponse +from nimble_client.models.map_response_links_inner import MapResponseLinksInner +from nimble_client.models.media_async_payload import MediaAsyncPayload +from nimble_client.models.media_async_payload_all_of_media_extractor_options import MediaAsyncPayloadAllOfMediaExtractorOptions +from nimble_client.models.media_async_payload_all_of_storage import MediaAsyncPayloadAllOfStorage +from nimble_client.models.media_async_response import MediaAsyncResponse +from nimble_client.models.media_payload import MediaPayload +from nimble_client.models.media_payload_media_extractor_options import MediaPayloadMediaExtractorOptions +from nimble_client.models.metadata import Metadata +from nimble_client.models.metadata_filter_public_v2 import MetadataFilterPublicV2 +from nimble_client.models.output import Output +from nimble_client.models.output1 import Output1 +from nimble_client.models.output2 import Output2 +from nimble_client.models.output3 import Output3 +from nimble_client.models.parsing_error_result import ParsingErrorResult +from nimble_client.models.parsing_success_result import ParsingSuccessResult +from nimble_client.models.parsing_type import ParsingType +from nimble_client.models.press_action import PressAction +from nimble_client.models.press_action_press import PressActionPress +from nimble_client.models.press_action_press_one_of import PressActionPressOneOf +from nimble_client.models.privacy_filter_public_v1 import PrivacyFilterPublicV1 +from nimble_client.models.privacy_filter_public_v2 import PrivacyFilterPublicV2 +from nimble_client.models.privacy_level_public_v2 import PrivacyLevelPublicV2 +from nimble_client.models.request import Request +from nimble_client.models.response_get_run_result_public_v2_api_v2_public_web_search_agents_agent_id_runs_run_id_result_get import ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet +from nimble_client.models.result_model import ResultModel +from nimble_client.models.revenue_annual import RevenueAnnual +from nimble_client.models.run_extract_template200_response import RunExtractTemplate200Response +from nimble_client.models.run_extract_template200_response_data import RunExtractTemplate200ResponseData +from nimble_client.models.run_extract_template200_response_data_browser_actions import RunExtractTemplate200ResponseDataBrowserActions +from nimble_client.models.run_extract_template200_response_data_browser_actions_results_inner import RunExtractTemplate200ResponseDataBrowserActionsResultsInner +from nimble_client.models.run_extract_template200_response_data_network_capture_inner import RunExtractTemplate200ResponseDataNetworkCaptureInner +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_filter import RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_filter_url import RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_results_inner import RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_results_inner_request import RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_results_inner_response import RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse +from nimble_client.models.run_extract_template200_response_data_redirects_inner import RunExtractTemplate200ResponseDataRedirectsInner +from nimble_client.models.run_extract_template200_response_debug import RunExtractTemplate200ResponseDebug +from nimble_client.models.run_extract_template200_response_metadata import RunExtractTemplate200ResponseMetadata +from nimble_client.models.run_extract_template200_response_pagination import RunExtractTemplate200ResponsePagination +from nimble_client.models.run_extract_template404_response import RunExtractTemplate404Response +from nimble_client.models.run_extract_template_async200_response import RunExtractTemplateAsync200Response +from nimble_client.models.run_extract_template_async_request import RunExtractTemplateAsyncRequest +from nimble_client.models.run_stats_public_v2 import RunStatsPublicV2 +from nimble_client.models.serp_metadata import SERPMetadata +from nimble_client.models.safe_search import SafeSearch +from nimble_client.models.screenshot_action import ScreenshotAction +from nimble_client.models.screenshot_action_screenshot import ScreenshotActionScreenshot +from nimble_client.models.screenshot_action_screenshot_one_of import ScreenshotActionScreenshotOneOf +from nimble_client.models.scroll_action import ScrollAction +from nimble_client.models.scroll_action_scroll import ScrollActionScroll +from nimble_client.models.scroll_action_scroll_one_of import ScrollActionScrollOneOf +from nimble_client.models.sdk_string_variant7a06ddd6b0fd import SdkStringVariant7a06ddd6b0fd +from nimble_client.models.search_depth import SearchDepth +from nimble_client.models.search_request import SearchRequest +from nimble_client.models.search_response import SearchResponse +from nimble_client.models.selector import Selector +from nimble_client.models.serp_async_response import SerpAsyncResponse +from nimble_client.models.serp_batch_payload import SerpBatchPayload +from nimble_client.models.serp_batch_payload_inputs_inner import SerpBatchPayloadInputsInner +from nimble_client.models.serp_batch_payload_shared_inputs import SerpBatchPayloadSharedInputs +from nimble_client.models.serp_batch_response import SerpBatchResponse +from nimble_client.models.serp_payload import SerpPayload +from nimble_client.models.stream_agent_run_events200_response import StreamAgentRunEvents200Response +from nimble_client.models.submit_async_extract_request import SubmitAsyncExtractRequest +from nimble_client.models.submit_async_serp_request import SubmitAsyncSerpRequest +from nimble_client.models.task_error_response import TaskErrorResponse +from nimble_client.models.task_failed_response import TaskFailedResponse +from nimble_client.models.task_failed_response_task import TaskFailedResponseTask +from nimble_client.models.task_list_response import TaskListResponse +from nimble_client.models.task_list_response_pagination import TaskListResponsePagination +from nimble_client.models.task_not_found_error_response import TaskNotFoundErrorResponse +from nimble_client.models.task_pending_response import TaskPendingResponse +from nimble_client.models.task_progress import TaskProgress +from nimble_client.models.task_response_schema import TaskResponseSchema +from nimble_client.models.task_response_schema_task import TaskResponseSchemaTask +from nimble_client.models.task_run_error_public_v1 import TaskRunErrorPublicV1 +from nimble_client.models.task_run_error_public_v2 import TaskRunErrorPublicV2 +from nimble_client.models.task_run_failed_result_public_v1 import TaskRunFailedResultPublicV1 +from nimble_client.models.task_run_failed_result_public_v2 import TaskRunFailedResultPublicV2 +from nimble_client.models.task_run_json_output_public_v1 import TaskRunJsonOutputPublicV1 +from nimble_client.models.task_run_json_output_public_v2 import TaskRunJsonOutputPublicV2 +from nimble_client.models.task_run_response_public_v1 import TaskRunResponsePublicV1 +from nimble_client.models.task_run_response_public_v2 import TaskRunResponsePublicV2 +from nimble_client.models.task_run_result_public_v1 import TaskRunResultPublicV1 +from nimble_client.models.task_run_result_public_v2 import TaskRunResultPublicV2 +from nimble_client.models.task_run_text_output_public_v1 import TaskRunTextOutputPublicV1 +from nimble_client.models.task_run_text_output_public_v2 import TaskRunTextOutputPublicV2 +from nimble_client.models.template_feature_flags_public_v1 import TemplateFeatureFlagsPublicV1 +from nimble_client.models.template_generation_response_public_v1 import TemplateGenerationResponsePublicV1 +from nimble_client.models.template_input_property_public_v1 import TemplateInputPropertyPublicV1 +from nimble_client.models.template_public_v1 import TemplatePublicV1 +from nimble_client.models.template_sample_public_v1 import TemplateSamplePublicV1 +from nimble_client.models.template_version_metadata_public_v1 import TemplateVersionMetadataPublicV1 +from nimble_client.models.template_version_response_public_v1 import TemplateVersionResponsePublicV1 +from nimble_client.models.text_claim_trust import TextClaimTrust +from nimble_client.models.text_run_trust import TextRunTrust +from nimble_client.models.time_range import TimeRange +from nimble_client.models.trigger_job_run_request_public_v1 import TriggerJobRunRequestPublicV1 +from nimble_client.models.trigger_job_run_request_public_v2 import TriggerJobRunRequestPublicV2 +from nimble_client.models.trust_citation import TrustCitation +from nimble_client.models.trust_mode import TrustMode +from nimble_client.models.trust_source import TrustSource +from nimble_client.models.update_job_request_public_v1 import UpdateJobRequestPublicV1 +from nimble_client.models.update_job_request_public_v2 import UpdateJobRequestPublicV2 +from nimble_client.models.usage_catalog_configuration_public_v2 import UsageCatalogConfigurationPublicV2 +from nimble_client.models.usage_catalog_product_public_v2 import UsageCatalogProductPublicV2 +from nimble_client.models.usage_catalog_public_v2 import UsageCatalogPublicV2 +from nimble_client.models.usage_catalog_service_public_v2 import UsageCatalogServicePublicV2 +from nimble_client.models.usage_configuration_name_public_v2 import UsageConfigurationNamePublicV2 +from nimble_client.models.usage_dimensions_public_v2 import UsageDimensionsPublicV2 +from nimble_client.models.usage_meta_public_v2 import UsageMetaPublicV2 +from nimble_client.models.usage_metrics_public_v2 import UsageMetricsPublicV2 +from nimble_client.models.usage_name_public_v2 import UsageNamePublicV2 +from nimble_client.models.usage_response_public_v2 import UsageResponsePublicV2 +from nimble_client.models.usage_row_public_v2 import UsageRowPublicV2 +from nimble_client.models.validation_error import ValidationError +from nimble_client.models.visits import Visits +from nimble_client.models.visits_monthly import VisitsMonthly +from nimble_client.models.wsa_metadata import WSAMetadata +from nimble_client.models.wait_action import WaitAction +from nimble_client.models.wait_action_wait import WaitActionWait +from nimble_client.models.wait_action_wait_one_of import WaitActionWaitOneOf +from nimble_client.models.wait_for_element_action import WaitForElementAction +from nimble_client.models.wait_for_element_action_wait_for_element import WaitForElementActionWaitForElement +from nimble_client.models.wait_for_element_action_wait_for_element_one_of import WaitForElementActionWaitForElementOneOf +from nimble_client.models.wait_for_navigation_action import WaitForNavigationAction +from nimble_client.models.wait_for_navigation_action_wait_for_navigation import WaitForNavigationActionWaitForNavigation +from nimble_client.models.wait_for_navigation_action_wait_for_navigation_one_of import WaitForNavigationActionWaitForNavigationOneOf +from nimble_client.models.web_search_agent_create_request_public_v1 import WebSearchAgentCreateRequestPublicV1 +from nimble_client.models.web_search_agent_create_request_public_v2 import WebSearchAgentCreateRequestPublicV2 +from nimble_client.models.web_search_agent_goal_response_public_v1 import WebSearchAgentGoalResponsePublicV1 +from nimble_client.models.web_search_agent_goal_response_public_v2 import WebSearchAgentGoalResponsePublicV2 +from nimble_client.models.web_search_agent_response_public_v1 import WebSearchAgentResponsePublicV1 +from nimble_client.models.web_search_agent_response_public_v2 import WebSearchAgentResponsePublicV2 +from nimble_client.models.web_search_agent_run_create_request_public_v1 import WebSearchAgentRunCreateRequestPublicV1 +from nimble_client.models.web_search_agent_run_create_request_public_v2 import WebSearchAgentRunCreateRequestPublicV2 +from nimble_client.models.web_search_agent_run_memory_config_public_v2 import WebSearchAgentRunMemoryConfigPublicV2 +from nimble_client.models.web_search_agent_source_create_request_public_v1 import WebSearchAgentSourceCreateRequestPublicV1 +from nimble_client.models.web_search_agent_source_create_request_public_v2 import WebSearchAgentSourceCreateRequestPublicV2 +from nimble_client.models.web_search_agent_source_response_public_v1 import WebSearchAgentSourceResponsePublicV1 +from nimble_client.models.web_search_agent_source_response_public_v2 import WebSearchAgentSourceResponsePublicV2 +from nimble_client.models.web_search_agent_suggested_question_response_public_v1 import WebSearchAgentSuggestedQuestionResponsePublicV1 +from nimble_client.models.web_search_agent_suggested_question_response_public_v2 import WebSearchAgentSuggestedQuestionResponsePublicV2 +from nimble_client.models.web_search_agent_template_response_public_v1 import WebSearchAgentTemplateResponsePublicV1 +from nimble_client.models.web_search_agent_template_response_public_v2 import WebSearchAgentTemplateResponsePublicV2 +from nimble_client.models.web_search_agent_use_case import WebSearchAgentUseCase +from nimble_client.models.web_traffic_month import WebTrafficMonth +from nimble_client.models.workforce_total import WorkforceTotal + diff --git a/candidate/generated/nimble_client/models/agent_batch_body.py b/candidate/generated/nimble_client/models/agent_batch_body.py new file mode 100644 index 0000000..e8067b2 --- /dev/null +++ b/candidate/generated/nimble_client/models/agent_batch_body.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from nimble_client.models.agent_batch_body_inputs_inner import AgentBatchBodyInputsInner +from nimble_client.models.agent_batch_body_shared_inputs import AgentBatchBodySharedInputs +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AgentBatchBody(BaseModel): + """ + Request body for executing a batch of agent requests + """ # noqa: E501 + inputs: Annotated[List[AgentBatchBodyInputsInner], Field(min_length=1)] + shared_inputs: AgentBatchBodySharedInputs + __properties: ClassVar[List[str]] = ["inputs", "shared_inputs"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentBatchBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in inputs (list) + _items = [] + if self.inputs: + for _item_inputs in self.inputs: + _items.append(_item_inputs.to_dict() if _item_inputs is not None else None) + _dict['inputs'] = _items + # override the default output from pydantic by calling `to_dict()` of shared_inputs + if self.shared_inputs: + _dict['shared_inputs'] = self.shared_inputs.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentBatchBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "inputs": [AgentBatchBodyInputsInner.from_dict(_item) for _item in obj["inputs"]] if obj.get("inputs") is not None else None, + "shared_inputs": AgentBatchBodySharedInputs.from_dict(obj["shared_inputs"]) if obj.get("shared_inputs") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/agent_batch_body_inputs_inner.py b/candidate/generated/nimble_client/models/agent_batch_body_inputs_inner.py new file mode 100644 index 0000000..6c326c3 --- /dev/null +++ b/candidate/generated/nimble_client/models/agent_batch_body_inputs_inner.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AgentBatchBodyInputsInner(BaseModel): + """ + AgentBatchBodyInputsInner + """ # noqa: E501 + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="Response formats to include. All disabled by default.") + localization: Optional[StrictBool] = None + params: Optional[Dict[str, Any]] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["formats", "localization", "params"] + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentBatchBodyInputsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentBatchBodyInputsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "formats": obj.get("formats"), + "localization": obj.get("localization"), + "params": obj.get("params") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/agent_batch_body_shared_inputs.py b/candidate/generated/nimble_client/models/agent_batch_body_shared_inputs.py new file mode 100644 index 0000000..be940e7 --- /dev/null +++ b/candidate/generated/nimble_client/models/agent_batch_body_shared_inputs.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AgentBatchBodySharedInputs(BaseModel): + """ + AgentBatchBodySharedInputs + """ # noqa: E501 + agent: Optional[StrictStr] = Field(description="Cursor for pagination.") + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="Response formats to include. All disabled by default.") + localization: Optional[StrictBool] = None + params: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["agent", "formats", "localization", "params"] + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentBatchBodySharedInputs from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if agent (nullable) is None + # and model_fields_set contains the field + if self.agent is None and "agent" in self.model_fields_set: + _dict['agent'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentBatchBodySharedInputs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent": obj.get("agent"), + "formats": obj.get("formats"), + "localization": obj.get("localization"), + "params": obj.get("params") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/agent_body.py b/candidate/generated/nimble_client/models/agent_body.py new file mode 100644 index 0000000..99617ee --- /dev/null +++ b/candidate/generated/nimble_client/models/agent_body.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AgentBody(BaseModel): + """ + Request body for executing a WSA + """ # noqa: E501 + agent: Optional[StrictStr] = Field(description="Cursor for pagination.") + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="Response formats to include. All disabled by default.") + localization: Optional[StrictBool] = False + params: Dict[str, Any] + __properties: ClassVar[List[str]] = ["agent", "formats", "localization", "params"] + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if agent (nullable) is None + # and model_fields_set contains the field + if self.agent is None and "agent" in self.model_fields_set: + _dict['agent'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent": obj.get("agent"), + "formats": obj.get("formats"), + "localization": obj.get("localization") if obj.get("localization") is not None else False, + "params": obj.get("params") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/agent_sources_public_v1.py b/candidate/generated/nimble_client/models/agent_sources_public_v1.py new file mode 100644 index 0000000..d44fc7d --- /dev/null +++ b/candidate/generated/nimble_client/models/agent_sources_public_v1.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.web_search_agent_source_create_request_public_v1 import WebSearchAgentSourceCreateRequestPublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AgentSourcesPublicV1(BaseModel): + """ + AgentSourcesPublicV1 + """ # noqa: E501 + allow: Optional[List[WebSearchAgentSourceCreateRequestPublicV1]] = Field(default=None, description="Source groups the agent is allowed to use.") + avoid: Optional[StrictStr] = Field(default=None, description="Free-text guidance describing sources or domains to avoid.") + block: Optional[List[WebSearchAgentSourceCreateRequestPublicV1]] = Field(default=None, description="Source groups the agent should not use.") + prioritize: Optional[StrictStr] = Field(default=None, description="Free-text guidance describing sources or domains to prioritize.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["allow", "avoid", "block", "prioritize"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentSourcesPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in allow (list) + _items = [] + if self.allow: + for _item_allow in self.allow: + _items.append(_item_allow.to_dict() if _item_allow is not None else None) + _dict['allow'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in block (list) + _items = [] + if self.block: + for _item_block in self.block: + _items.append(_item_block.to_dict() if _item_block is not None else None) + _dict['block'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if avoid (nullable) is None + # and model_fields_set contains the field + if self.avoid is None and "avoid" in self.model_fields_set: + _dict['avoid'] = None + + # set to None if prioritize (nullable) is None + # and model_fields_set contains the field + if self.prioritize is None and "prioritize" in self.model_fields_set: + _dict['prioritize'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentSourcesPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow": [WebSearchAgentSourceCreateRequestPublicV1.from_dict(_item) for _item in obj["allow"]] if obj.get("allow") is not None else None, + "avoid": obj.get("avoid"), + "block": [WebSearchAgentSourceCreateRequestPublicV1.from_dict(_item) for _item in obj["block"]] if obj.get("block") is not None else None, + "prioritize": obj.get("prioritize") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/agent_sources_public_v2.py b/candidate/generated/nimble_client/models/agent_sources_public_v2.py new file mode 100644 index 0000000..e84d101 --- /dev/null +++ b/candidate/generated/nimble_client/models/agent_sources_public_v2.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.web_search_agent_source_create_request_public_v2 import WebSearchAgentSourceCreateRequestPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AgentSourcesPublicV2(BaseModel): + """ + AgentSourcesPublicV2 + """ # noqa: E501 + allow: Optional[List[WebSearchAgentSourceCreateRequestPublicV2]] = Field(default=None, description="Source groups the agent is allowed to use.") + avoid: Optional[StrictStr] = Field(default=None, description="Free-text guidance describing sources or domains to avoid.") + block: Optional[List[WebSearchAgentSourceCreateRequestPublicV2]] = Field(default=None, description="Source groups the agent should not use.") + prioritize: Optional[StrictStr] = Field(default=None, description="Free-text guidance describing sources or domains to prioritize.") + __properties: ClassVar[List[str]] = ["allow", "avoid", "block", "prioritize"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentSourcesPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in allow (list) + _items = [] + if self.allow: + for _item_allow in self.allow: + _items.append(_item_allow.to_dict() if _item_allow is not None else None) + _dict['allow'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in block (list) + _items = [] + if self.block: + for _item_block in self.block: + _items.append(_item_block.to_dict() if _item_block is not None else None) + _dict['block'] = _items + # set to None if avoid (nullable) is None + # and model_fields_set contains the field + if self.avoid is None and "avoid" in self.model_fields_set: + _dict['avoid'] = None + + # set to None if prioritize (nullable) is None + # and model_fields_set contains the field + if self.prioritize is None and "prioritize" in self.model_fields_set: + _dict['prioritize'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentSourcesPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow": [WebSearchAgentSourceCreateRequestPublicV2.from_dict(_item) for _item in obj["allow"]] if obj.get("allow") is not None else None, + "avoid": obj.get("avoid"), + "block": [WebSearchAgentSourceCreateRequestPublicV2.from_dict(_item) for _item in obj["block"]] if obj.get("block") is not None else None, + "prioritize": obj.get("prioritize") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/agent_sources_response_public_v1.py b/candidate/generated/nimble_client/models/agent_sources_response_public_v1.py new file mode 100644 index 0000000..c4e1303 --- /dev/null +++ b/candidate/generated/nimble_client/models/agent_sources_response_public_v1.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.web_search_agent_source_response_public_v1 import WebSearchAgentSourceResponsePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AgentSourcesResponsePublicV1(BaseModel): + """ + AgentSourcesResponsePublicV1 + """ # noqa: E501 + allow: Optional[List[WebSearchAgentSourceResponsePublicV1]] = Field(default=None, description="Source groups the agent is allowed to use.") + avoid: Optional[StrictStr] = Field(default=None, description="Free-text guidance describing sources or domains to avoid.") + block: Optional[List[WebSearchAgentSourceResponsePublicV1]] = Field(default=None, description="Source groups the agent should not use.") + prioritize: Optional[StrictStr] = Field(default=None, description="Free-text guidance describing sources or domains to prioritize.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["allow", "avoid", "block", "prioritize"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentSourcesResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in allow (list) + _items = [] + if self.allow: + for _item_allow in self.allow: + _items.append(_item_allow.to_dict() if _item_allow is not None else None) + _dict['allow'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in block (list) + _items = [] + if self.block: + for _item_block in self.block: + _items.append(_item_block.to_dict() if _item_block is not None else None) + _dict['block'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if avoid (nullable) is None + # and model_fields_set contains the field + if self.avoid is None and "avoid" in self.model_fields_set: + _dict['avoid'] = None + + # set to None if prioritize (nullable) is None + # and model_fields_set contains the field + if self.prioritize is None and "prioritize" in self.model_fields_set: + _dict['prioritize'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentSourcesResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow": [WebSearchAgentSourceResponsePublicV1.from_dict(_item) for _item in obj["allow"]] if obj.get("allow") is not None else None, + "avoid": obj.get("avoid"), + "block": [WebSearchAgentSourceResponsePublicV1.from_dict(_item) for _item in obj["block"]] if obj.get("block") is not None else None, + "prioritize": obj.get("prioritize") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/agent_sources_response_public_v2.py b/candidate/generated/nimble_client/models/agent_sources_response_public_v2.py new file mode 100644 index 0000000..d7cd3b1 --- /dev/null +++ b/candidate/generated/nimble_client/models/agent_sources_response_public_v2.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.web_search_agent_source_response_public_v2 import WebSearchAgentSourceResponsePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AgentSourcesResponsePublicV2(BaseModel): + """ + AgentSourcesResponsePublicV2 + """ # noqa: E501 + allow: Optional[List[WebSearchAgentSourceResponsePublicV2]] = Field(default=None, description="Source groups the agent is allowed to use.") + avoid: Optional[StrictStr] = Field(default=None, description="Free-text guidance describing sources or domains to avoid.") + block: Optional[List[WebSearchAgentSourceResponsePublicV2]] = Field(default=None, description="Source groups the agent should not use.") + prioritize: Optional[StrictStr] = Field(default=None, description="Free-text guidance describing sources or domains to prioritize.") + __properties: ClassVar[List[str]] = ["allow", "avoid", "block", "prioritize"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentSourcesResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in allow (list) + _items = [] + if self.allow: + for _item_allow in self.allow: + _items.append(_item_allow.to_dict() if _item_allow is not None else None) + _dict['allow'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in block (list) + _items = [] + if self.block: + for _item_block in self.block: + _items.append(_item_block.to_dict() if _item_block is not None else None) + _dict['block'] = _items + # set to None if avoid (nullable) is None + # and model_fields_set contains the field + if self.avoid is None and "avoid" in self.model_fields_set: + _dict['avoid'] = None + + # set to None if prioritize (nullable) is None + # and model_fields_set contains the field + if self.prioritize is None and "prioritize" in self.model_fields_set: + _dict['prioritize'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentSourcesResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow": [WebSearchAgentSourceResponsePublicV2.from_dict(_item) for _item in obj["allow"]] if obj.get("allow") is not None else None, + "avoid": obj.get("avoid"), + "block": [WebSearchAgentSourceResponsePublicV2.from_dict(_item) for _item in obj["block"]] if obj.get("block") is not None else None, + "prioritize": obj.get("prioritize") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/amount.py b/candidate/generated/nimble_client/models/amount.py new file mode 100644 index 0000000..a70677b --- /dev/null +++ b/candidate/generated/nimble_client/models/amount.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +AMOUNT_ANY_OF_SCHEMAS = ["float", "int"] + +class Amount(BaseModel): + """ + USD + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: float + anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, int]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "float", "int" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = Amount.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Amount with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Amount with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/answer_annotation_citation.py b/candidate/generated/nimble_client/models/answer_annotation_citation.py new file mode 100644 index 0000000..f7787d7 --- /dev/null +++ b/candidate/generated/nimble_client/models/answer_annotation_citation.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AnswerAnnotationCitation(BaseModel): + """ + Annotation-style citation with character-range offsets into the answer text. + """ # noqa: E501 + description: Optional[StrictStr] = Field(default=None, description="Snippet/description from the search result") + end_index: StrictInt = Field(description="Exclusive end character offset of the inline link in the answer text") + start_index: StrictInt = Field(description="Inclusive start character offset of the inline link in the answer text") + title: StrictStr + type: Optional[StrictStr] = 'url_citation' + url: StrictStr + __properties: ClassVar[List[str]] = ["description", "end_index", "start_index", "title", "type", "url"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['url_citation']): + raise ValueError("must be one of enum values ('url_citation')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnswerAnnotationCitation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnswerAnnotationCitation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "end_index": obj.get("end_index"), + "start_index": obj.get("start_index"), + "title": obj.get("title"), + "type": obj.get("type") if obj.get("type") is not None else 'url_citation', + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/answer_marker_citation.py b/candidate/generated/nimble_client/models/answer_marker_citation.py new file mode 100644 index 0000000..2973b57 --- /dev/null +++ b/candidate/generated/nimble_client/models/answer_marker_citation.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AnswerMarkerCitation(BaseModel): + """ + Marker-style citation for the /answer endpoint ([N] references). + """ # noqa: E501 + description: Optional[StrictStr] = Field(default=None, description="Snippet/description from the search result") + index: StrictInt = Field(description="1-based citation index matching [N] markers in the answer text") + title: StrictStr + url: StrictStr + __properties: ClassVar[List[str]] = ["description", "index", "title", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnswerMarkerCitation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnswerMarkerCitation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "index": obj.get("index"), + "title": obj.get("title"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/answer_request.py b/candidate/generated/nimble_client/models/answer_request.py new file mode 100644 index 0000000..4944b57 --- /dev/null +++ b/candidate/generated/nimble_client/models/answer_request.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.citation_config import CitationConfig +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AnswerRequest(BaseModel): + """ + Request body model for the /answer endpoint. + """ # noqa: E501 + citations: Optional[CitationConfig] = Field(default=None, description="Citation configuration. Omit for default behavior (citations enabled, no description).") + query: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="Question to answer using web search results") + __properties: ClassVar[List[str]] = ["citations", "query"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnswerRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of citations + if self.citations: + _dict['citations'] = self.citations.to_dict() + # set to None if citations (nullable) is None + # and model_fields_set contains the field + if self.citations is None and "citations" in self.model_fields_set: + _dict['citations'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnswerRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "citations": CitationConfig.from_dict(obj["citations"]) if obj.get("citations") is not None else None, + "query": obj.get("query") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/answer_response.py b/candidate/generated/nimble_client/models/answer_response.py new file mode 100644 index 0000000..b33ab82 --- /dev/null +++ b/candidate/generated/nimble_client/models/answer_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.citations import Citations +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AnswerResponse(BaseModel): + """ + Response model for the /answer endpoint. + """ # noqa: E501 + answer: StrictStr = Field(description="LLM-generated answer to the query") + citations: Citations + request_id: StrictStr = Field(description="Unique identifier for this request (UUID)") + __properties: ClassVar[List[str]] = ["answer", "citations", "request_id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnswerResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of citations + if self.citations: + _dict['citations'] = self.citations.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnswerResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "answer": obj.get("answer"), + "citations": Citations.from_dict(obj["citations"]) if obj.get("citations") is not None else None, + "request_id": obj.get("request_id") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/artifact_download_url_public_v1.py b/candidate/generated/nimble_client/models/artifact_download_url_public_v1.py new file mode 100644 index 0000000..64ced7f --- /dev/null +++ b/candidate/generated/nimble_client/models/artifact_download_url_public_v1.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ArtifactDownloadUrlPublicV1(BaseModel): + """ + A pre-signed URL for downloading an artifact. + """ # noqa: E501 + expires_at: datetime = Field(description="When the download URL expires.") + url: StrictStr = Field(description="Pre-signed URL to download the artifact.") + __properties: ClassVar[List[str]] = ["expires_at", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactDownloadUrlPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactDownloadUrlPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "expires_at": obj.get("expires_at"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/artifact_download_url_public_v2.py b/candidate/generated/nimble_client/models/artifact_download_url_public_v2.py new file mode 100644 index 0000000..0680588 --- /dev/null +++ b/candidate/generated/nimble_client/models/artifact_download_url_public_v2.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ArtifactDownloadUrlPublicV2(BaseModel): + """ + A pre-signed URL for downloading an artifact. + """ # noqa: E501 + expires_at: datetime = Field(description="When the download URL expires.") + url: StrictStr = Field(description="Pre-signed URL to download the artifact.") + __properties: ClassVar[List[str]] = ["expires_at", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactDownloadUrlPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactDownloadUrlPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "expires_at": obj.get("expires_at"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/artifact_list_public_v1.py b/candidate/generated/nimble_client/models/artifact_list_public_v1.py new file mode 100644 index 0000000..00681fa --- /dev/null +++ b/candidate/generated/nimble_client/models/artifact_list_public_v1.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from nimble_client.models.artifact_public_v1 import ArtifactPublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ArtifactListPublicV1(BaseModel): + """ + Artifacts produced by a run. + """ # noqa: E501 + items: List[ArtifactPublicV1] = Field(description="Artifacts produced by the run.") + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactListPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactListPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [ArtifactPublicV1.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/artifact_list_public_v2.py b/candidate/generated/nimble_client/models/artifact_list_public_v2.py new file mode 100644 index 0000000..12e7b3e --- /dev/null +++ b/candidate/generated/nimble_client/models/artifact_list_public_v2.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from nimble_client.models.artifact_public_v2 import ArtifactPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ArtifactListPublicV2(BaseModel): + """ + Artifacts produced by a run. + """ # noqa: E501 + items: List[ArtifactPublicV2] = Field(description="Artifacts produced by the run.") + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactListPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactListPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [ArtifactPublicV2.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/artifact_preview_public_v1.py b/candidate/generated/nimble_client/models/artifact_preview_public_v1.py new file mode 100644 index 0000000..36c7999 --- /dev/null +++ b/candidate/generated/nimble_client/models/artifact_preview_public_v1.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ArtifactPreviewPublicV1(BaseModel): + """ + A tabular preview of an artifact's contents. + """ # noqa: E501 + columns: List[StrictStr] = Field(description="Column names in the preview.") + row_count: StrictInt = Field(description="Total number of rows in the artifact.") + rows: List[Dict[str, Any]] = Field(description="Sample rows from the artifact.") + __properties: ClassVar[List[str]] = ["columns", "row_count", "rows"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactPreviewPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactPreviewPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "columns": obj.get("columns"), + "row_count": obj.get("row_count"), + "rows": obj.get("rows") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/artifact_preview_public_v2.py b/candidate/generated/nimble_client/models/artifact_preview_public_v2.py new file mode 100644 index 0000000..025ccda --- /dev/null +++ b/candidate/generated/nimble_client/models/artifact_preview_public_v2.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ArtifactPreviewPublicV2(BaseModel): + """ + A tabular preview of an artifact's contents. + """ # noqa: E501 + columns: List[StrictStr] = Field(description="Column names in the preview.") + row_count: StrictInt = Field(description="Total number of rows in the artifact.") + rows: List[Dict[str, Any]] = Field(description="Sample rows from the artifact.") + __properties: ClassVar[List[str]] = ["columns", "row_count", "rows"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactPreviewPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactPreviewPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "columns": obj.get("columns"), + "row_count": obj.get("row_count"), + "rows": obj.get("rows") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/artifact_public_v1.py b/candidate/generated/nimble_client/models/artifact_public_v1.py new file mode 100644 index 0000000..c314016 --- /dev/null +++ b/candidate/generated/nimble_client/models/artifact_public_v1.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ArtifactPublicV1(BaseModel): + """ + A file produced by a run. + """ # noqa: E501 + created_at: datetime = Field(description="When the artifact was created.") + description: StrictStr = Field(description="Human-readable artifact description.") + id: StrictStr = Field(description="Artifact identifier.") + type: StrictStr = Field(description="Artifact type.") + __properties: ClassVar[List[str]] = ["created_at", "description", "id", "type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "id": obj.get("id"), + "type": obj.get("type") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/artifact_public_v2.py b/candidate/generated/nimble_client/models/artifact_public_v2.py new file mode 100644 index 0000000..3da1332 --- /dev/null +++ b/candidate/generated/nimble_client/models/artifact_public_v2.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ArtifactPublicV2(BaseModel): + """ + A file produced by a run. + """ # noqa: E501 + created_at: datetime = Field(description="When the artifact was created.") + description: StrictStr = Field(description="Human-readable artifact description.") + id: StrictStr = Field(description="Artifact identifier.") + type: StrictStr = Field(description="Artifact type.") + __properties: ClassVar[List[str]] = ["created_at", "description", "id", "type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ArtifactPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ArtifactPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "id": obj.get("id"), + "type": obj.get("type") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/auto_scroll_action.py b/candidate/generated/nimble_client/models/auto_scroll_action.py new file mode 100644 index 0000000..aa7663e --- /dev/null +++ b/candidate/generated/nimble_client/models/auto_scroll_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.auto_scroll_action_auto_scroll import AutoScrollActionAutoScroll +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AutoScrollAction(BaseModel): + """ + Continuously scroll to load dynamic content + """ # noqa: E501 + auto_scroll: AutoScrollActionAutoScroll + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["auto_scroll"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AutoScrollAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of auto_scroll + if self.auto_scroll: + _dict['auto_scroll'] = self.auto_scroll.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AutoScrollAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auto_scroll": AutoScrollActionAutoScroll.from_dict(obj["auto_scroll"]) if obj.get("auto_scroll") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll.py b/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll.py new file mode 100644 index 0000000..6a426da --- /dev/null +++ b/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.auto_scroll_action_auto_scroll_one_of import AutoScrollActionAutoScrollOneOf +from nimble_client.models.duration import Duration +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +AUTOSCROLLACTIONAUTOSCROLL_ONE_OF_SCHEMAS = ["AutoScrollActionAutoScrollOneOf", "Duration", "bool"] + +class AutoScrollActionAutoScroll(BaseModel): + """ + AutoScrollActionAutoScroll + """ + # data type: bool + oneof_schema_1_validator: Optional[StrictBool] = None + # data type: Duration + oneof_schema_2_validator: Optional[Duration] = None + # data type: AutoScrollActionAutoScrollOneOf + oneof_schema_3_validator: Optional[AutoScrollActionAutoScrollOneOf] = None + actual_instance: Optional[Union[AutoScrollActionAutoScrollOneOf, Duration, bool]] = None + one_of_schemas: Set[str] = { "AutoScrollActionAutoScrollOneOf", "Duration", "bool" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = AutoScrollActionAutoScroll.model_construct() + error_messages = [] + match = 0 + # validate data type: bool + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: Duration + if not isinstance(v, Duration): + error_messages.append(f"Error! Input type `{type(v)}` is not `Duration`") + else: + match += 1 + # validate data type: AutoScrollActionAutoScrollOneOf + if not isinstance(v, AutoScrollActionAutoScrollOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `AutoScrollActionAutoScrollOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in AutoScrollActionAutoScroll with oneOf schemas: AutoScrollActionAutoScrollOneOf, Duration, bool. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in AutoScrollActionAutoScroll with oneOf schemas: AutoScrollActionAutoScrollOneOf, Duration, bool. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into bool + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into Duration + try: + instance.actual_instance = Duration.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AutoScrollActionAutoScrollOneOf + try: + instance.actual_instance = AutoScrollActionAutoScrollOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into AutoScrollActionAutoScroll with oneOf schemas: AutoScrollActionAutoScrollOneOf, Duration, bool. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into AutoScrollActionAutoScroll with oneOf schemas: AutoScrollActionAutoScrollOneOf, Duration, bool. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AutoScrollActionAutoScrollOneOf, Duration, bool]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of.py b/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of.py new file mode 100644 index 0000000..977f018 --- /dev/null +++ b/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.duration import Duration +from nimble_client.models.selector import Selector +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AutoScrollActionAutoScrollOneOf(BaseModel): + """ + AutoScrollActionAutoScrollOneOf + """ # noqa: E501 + click_selector: Optional[Selector] = None + container: Optional[Selector] = None + delay_after_scroll: Optional[Duration] = None + idle_timeout: Optional[Duration] = None + loading_selector: Optional[Selector] = None + max_duration: Optional[Duration] = None + pause_on_selector: Optional[Selector] = None + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + step_size: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["click_selector", "container", "delay_after_scroll", "idle_timeout", "loading_selector", "max_duration", "pause_on_selector", "required", "skip", "step_size"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AutoScrollActionAutoScrollOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of click_selector + if self.click_selector: + _dict['click_selector'] = self.click_selector.to_dict() + # override the default output from pydantic by calling `to_dict()` of container + if self.container: + _dict['container'] = self.container.to_dict() + # override the default output from pydantic by calling `to_dict()` of delay_after_scroll + if self.delay_after_scroll: + _dict['delay_after_scroll'] = self.delay_after_scroll.to_dict() + # override the default output from pydantic by calling `to_dict()` of idle_timeout + if self.idle_timeout: + _dict['idle_timeout'] = self.idle_timeout.to_dict() + # override the default output from pydantic by calling `to_dict()` of loading_selector + if self.loading_selector: + _dict['loading_selector'] = self.loading_selector.to_dict() + # override the default output from pydantic by calling `to_dict()` of max_duration + if self.max_duration: + _dict['max_duration'] = self.max_duration.to_dict() + # override the default output from pydantic by calling `to_dict()` of pause_on_selector + if self.pause_on_selector: + _dict['pause_on_selector'] = self.pause_on_selector.to_dict() + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AutoScrollActionAutoScrollOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "click_selector": Selector.from_dict(obj["click_selector"]) if obj.get("click_selector") is not None else None, + "container": Selector.from_dict(obj["container"]) if obj.get("container") is not None else None, + "delay_after_scroll": Duration.from_dict(obj["delay_after_scroll"]) if obj.get("delay_after_scroll") is not None else None, + "idle_timeout": Duration.from_dict(obj["idle_timeout"]) if obj.get("idle_timeout") is not None else None, + "loading_selector": Selector.from_dict(obj["loading_selector"]) if obj.get("loading_selector") is not None else None, + "max_duration": Duration.from_dict(obj["max_duration"]) if obj.get("max_duration") is not None else None, + "pause_on_selector": Selector.from_dict(obj["pause_on_selector"]) if obj.get("pause_on_selector") is not None else None, + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "step_size": obj.get("step_size") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of_required.py b/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of_required.py new file mode 100644 index 0000000..925fe4b --- /dev/null +++ b/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of_required.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +AUTOSCROLLACTIONAUTOSCROLLONEOFREQUIRED_ANY_OF_SCHEMAS = ["bool", "str"] + +class AutoScrollActionAutoScrollOneOfRequired(BaseModel): + """ + Whether this action is required. If true, pipeline stops on failure. Accepts boolean or string \"true\"/\"false\". Default: true. + """ + + # data type: bool + anyof_schema_1_validator: Optional[StrictBool] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + # data type: str + anyof_schema_3_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "bool", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = AutoScrollActionAutoScrollOneOfRequired.model_construct() + error_messages = [] + # validate data type: bool + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in AutoScrollActionAutoScrollOneOfRequired with anyOf schemas: bool, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into bool + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_3_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into AutoScrollActionAutoScrollOneOfRequired with anyOf schemas: bool, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of_skip.py b/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of_skip.py new file mode 100644 index 0000000..23c9e9a --- /dev/null +++ b/candidate/generated/nimble_client/models/auto_scroll_action_auto_scroll_one_of_skip.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +AUTOSCROLLACTIONAUTOSCROLLONEOFSKIP_ANY_OF_SCHEMAS = ["bool", "str"] + +class AutoScrollActionAutoScrollOneOfSkip(BaseModel): + """ + Whether to skip this action. Accepts boolean or string \"true\"/\"false\". Default: false. + """ + + # data type: bool + anyof_schema_1_validator: Optional[StrictBool] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + # data type: str + anyof_schema_3_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "bool", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = AutoScrollActionAutoScrollOneOfSkip.model_construct() + error_messages = [] + # validate data type: bool + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in AutoScrollActionAutoScrollOneOfSkip with anyOf schemas: bool, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into bool + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_3_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into AutoScrollActionAutoScrollOneOfSkip with anyOf schemas: bool, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/avg_duration_seconds.py b/candidate/generated/nimble_client/models/avg_duration_seconds.py new file mode 100644 index 0000000..7e2afa4 --- /dev/null +++ b/candidate/generated/nimble_client/models/avg_duration_seconds.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +AVGDURATIONSECONDS_ANY_OF_SCHEMAS = ["float", "int"] + +class AvgDurationSeconds(BaseModel): + """ + AvgDurationSeconds + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: float + anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, int]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "float", "int" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = AvgDurationSeconds.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in AvgDurationSeconds with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into AvgDurationSeconds with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/batch_get_response.py b/candidate/generated/nimble_client/models/batch_get_response.py new file mode 100644 index 0000000..7eb4361 --- /dev/null +++ b/candidate/generated/nimble_client/models/batch_get_response.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from nimble_client.models.batch_get_response_tasks_inner import BatchGetResponseTasksInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class BatchGetResponse(BaseModel): + """ + Response containing batch details with all tasks. + """ # noqa: E501 + completed: StrictBool = Field(description="Whether all tasks in the batch have finished.") + completed_at: Optional[StrictStr] = Field(default=None, description="ISO timestamp when the batch completed.") + completed_count: Union[StrictFloat, StrictInt] = Field(description="Number of tasks that have completed so far.") + created_at: StrictStr = Field(description="ISO timestamp when the batch was created.") + id: StrictStr = Field(description="Unique identifier for the batch.") + progress: Union[StrictFloat, StrictInt] = Field(description="Completion ratio between 0 and 1.") + status: StrictStr + tasks: List[Optional[BatchGetResponseTasksInner]] = Field(description="List of tasks in the batch.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["completed", "completed_at", "completed_count", "created_at", "id", "progress", "status", "tasks"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success']): + raise ValueError("must be one of enum values ('success')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BatchGetResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in tasks (list) + _items = [] + if self.tasks: + for _item_tasks in self.tasks: + _items.append(_item_tasks.to_dict() if _item_tasks is not None else None) + _dict['tasks'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchGetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "completed": obj.get("completed"), + "completed_at": obj.get("completed_at"), + "completed_count": obj.get("completed_count"), + "created_at": obj.get("created_at"), + "id": obj.get("id"), + "progress": obj.get("progress"), + "status": obj.get("status"), + "tasks": [BatchGetResponseTasksInner.from_dict(_item) for _item in obj["tasks"]] if obj.get("tasks") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/batch_get_response_tasks_inner.py b/candidate/generated/nimble_client/models/batch_get_response_tasks_inner.py new file mode 100644 index 0000000..b2fd73b --- /dev/null +++ b/candidate/generated/nimble_client/models/batch_get_response_tasks_inner.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class BatchGetResponseTasksInner(BaseModel): + """ + BatchGetResponseTasksInner + """ # noqa: E501 + query: Optional[Any] = Field(alias="_query") + account_name: Optional[StrictStr] = Field(default=None, description="Account name that owns the task.") + api_type: Optional[StrictStr] = None + batch_id: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + created_at: StrictStr = Field(description="Timestamp when the task was created.") + download_url: Optional[StrictStr] = Field(default=None, description="URL for downloading the task results.") + error: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + error_type: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Unique task identifier.") + input: Optional[Any] = Field(description="Original input data for the task. ZDR tasks retain only a policy marker and required internal routing metadata.") + modified_at: Optional[StrictStr] = Field(default=None, description="Timestamp when the task was last modified.") + output_url: Optional[StrictStr] = Field(default=None, description="Storage location of the output data.") + queue: Optional[StrictStr] = Field(default=None, description="Queue name the task was submitted to.") + state: StrictStr = Field(description="Current state of the task.") + status_code: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="HTTP status code from the task execution.") + status_url: StrictStr = Field(description="URL for checking the task status.") + __properties: ClassVar[List[str]] = ["_query", "account_name", "api_type", "batch_id", "created_at", "download_url", "error", "error_type", "id", "input", "modified_at", "output_url", "queue", "state", "status_code", "status_url"] + + @field_validator('api_type') + def api_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs']): + raise ValueError("must be one of enum values ('web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'queued', 'in_progress', 'success', 'error']): + raise ValueError("must be one of enum values ('pending', 'queued', 'in_progress', 'success', 'error')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BatchGetResponseTasksInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if query (nullable) is None + # and model_fields_set contains the field + if self.query is None and "query" in self.model_fields_set: + _dict['_query'] = None + + # set to None if batch_id (nullable) is None + # and model_fields_set contains the field + if self.batch_id is None and "batch_id" in self.model_fields_set: + _dict['batch_id'] = None + + # set to None if download_url (nullable) is None + # and model_fields_set contains the field + if self.download_url is None and "download_url" in self.model_fields_set: + _dict['download_url'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if error_type (nullable) is None + # and model_fields_set contains the field + if self.error_type is None and "error_type" in self.model_fields_set: + _dict['error_type'] = None + + # set to None if input (nullable) is None + # and model_fields_set contains the field + if self.input is None and "input" in self.model_fields_set: + _dict['input'] = None + + # set to None if output_url (nullable) is None + # and model_fields_set contains the field + if self.output_url is None and "output_url" in self.model_fields_set: + _dict['output_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchGetResponseTasksInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_query": obj.get("_query"), + "account_name": obj.get("account_name"), + "api_type": obj.get("api_type"), + "batch_id": obj.get("batch_id"), + "created_at": obj.get("created_at"), + "download_url": obj.get("download_url"), + "error": obj.get("error"), + "error_type": obj.get("error_type"), + "id": obj.get("id"), + "input": obj.get("input"), + "modified_at": obj.get("modified_at"), + "output_url": obj.get("output_url"), + "queue": obj.get("queue"), + "state": obj.get("state"), + "status_code": obj.get("status_code"), + "status_url": obj.get("status_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/batch_progress_response.py b/candidate/generated/nimble_client/models/batch_progress_response.py new file mode 100644 index 0000000..ee8cb65 --- /dev/null +++ b/candidate/generated/nimble_client/models/batch_progress_response.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class BatchProgressResponse(BaseModel): + """ + Lightweight batch progress without task details. + """ # noqa: E501 + completed: StrictBool = Field(description="Whether all tasks in the batch have finished.") + completed_at: Optional[StrictStr] = Field(default=None, description="ISO timestamp when the batch completed.") + completed_count: Union[StrictFloat, StrictInt] = Field(description="Number of tasks that have completed so far.") + id: StrictStr = Field(description="Unique identifier for the batch.") + progress: Union[StrictFloat, StrictInt] = Field(description="Completion ratio between 0 and 1.") + status: StrictStr + __properties: ClassVar[List[str]] = ["completed", "completed_at", "completed_count", "id", "progress", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success']): + raise ValueError("must be one of enum values ('success')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BatchProgressResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchProgressResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "completed": obj.get("completed"), + "completed_at": obj.get("completed_at"), + "completed_count": obj.get("completed_count"), + "id": obj.get("id"), + "progress": obj.get("progress"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/browser_action.py b/candidate/generated/nimble_client/models/browser_action.py new file mode 100644 index 0000000..402d58c --- /dev/null +++ b/candidate/generated/nimble_client/models/browser_action.py @@ -0,0 +1,291 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.auto_scroll_action import AutoScrollAction +from nimble_client.models.click_action import ClickAction +from nimble_client.models.eval_action import EvalAction +from nimble_client.models.fetch_action import FetchAction +from nimble_client.models.fill_action import FillAction +from nimble_client.models.get_cookies_action import GetCookiesAction +from nimble_client.models.goto_action import GotoAction +from nimble_client.models.press_action import PressAction +from nimble_client.models.screenshot_action import ScreenshotAction +from nimble_client.models.scroll_action import ScrollAction +from nimble_client.models.wait_action import WaitAction +from nimble_client.models.wait_for_element_action import WaitForElementAction +from nimble_client.models.wait_for_navigation_action import WaitForNavigationAction +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +BROWSERACTION_ONE_OF_SCHEMAS = ["AutoScrollAction", "ClickAction", "EvalAction", "FetchAction", "FillAction", "GetCookiesAction", "GotoAction", "PressAction", "ScreenshotAction", "ScrollAction", "WaitAction", "WaitForElementAction", "WaitForNavigationAction"] + +class BrowserAction(BaseModel): + """ + A browser automation action. Exactly one action key must be present. + """ + # data type: AutoScrollAction + oneof_schema_1_validator: Optional[AutoScrollAction] = None + # data type: ClickAction + oneof_schema_2_validator: Optional[ClickAction] = None + # data type: EvalAction + oneof_schema_3_validator: Optional[EvalAction] = None + # data type: FetchAction + oneof_schema_4_validator: Optional[FetchAction] = None + # data type: FillAction + oneof_schema_5_validator: Optional[FillAction] = None + # data type: GetCookiesAction + oneof_schema_6_validator: Optional[GetCookiesAction] = None + # data type: GotoAction + oneof_schema_7_validator: Optional[GotoAction] = None + # data type: PressAction + oneof_schema_8_validator: Optional[PressAction] = None + # data type: ScreenshotAction + oneof_schema_9_validator: Optional[ScreenshotAction] = None + # data type: ScrollAction + oneof_schema_10_validator: Optional[ScrollAction] = None + # data type: WaitAction + oneof_schema_11_validator: Optional[WaitAction] = None + # data type: WaitForElementAction + oneof_schema_12_validator: Optional[WaitForElementAction] = None + # data type: WaitForNavigationAction + oneof_schema_13_validator: Optional[WaitForNavigationAction] = None + actual_instance: Optional[Union[AutoScrollAction, ClickAction, EvalAction, FetchAction, FillAction, GetCookiesAction, GotoAction, PressAction, ScreenshotAction, ScrollAction, WaitAction, WaitForElementAction, WaitForNavigationAction]] = None + one_of_schemas: Set[str] = { "AutoScrollAction", "ClickAction", "EvalAction", "FetchAction", "FillAction", "GetCookiesAction", "GotoAction", "PressAction", "ScreenshotAction", "ScrollAction", "WaitAction", "WaitForElementAction", "WaitForNavigationAction" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = BrowserAction.model_construct() + error_messages = [] + match = 0 + # validate data type: AutoScrollAction + if not isinstance(v, AutoScrollAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `AutoScrollAction`") + else: + match += 1 + # validate data type: ClickAction + if not isinstance(v, ClickAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `ClickAction`") + else: + match += 1 + # validate data type: EvalAction + if not isinstance(v, EvalAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `EvalAction`") + else: + match += 1 + # validate data type: FetchAction + if not isinstance(v, FetchAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `FetchAction`") + else: + match += 1 + # validate data type: FillAction + if not isinstance(v, FillAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `FillAction`") + else: + match += 1 + # validate data type: GetCookiesAction + if not isinstance(v, GetCookiesAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `GetCookiesAction`") + else: + match += 1 + # validate data type: GotoAction + if not isinstance(v, GotoAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `GotoAction`") + else: + match += 1 + # validate data type: PressAction + if not isinstance(v, PressAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `PressAction`") + else: + match += 1 + # validate data type: ScreenshotAction + if not isinstance(v, ScreenshotAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScreenshotAction`") + else: + match += 1 + # validate data type: ScrollAction + if not isinstance(v, ScrollAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScrollAction`") + else: + match += 1 + # validate data type: WaitAction + if not isinstance(v, WaitAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `WaitAction`") + else: + match += 1 + # validate data type: WaitForElementAction + if not isinstance(v, WaitForElementAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `WaitForElementAction`") + else: + match += 1 + # validate data type: WaitForNavigationAction + if not isinstance(v, WaitForNavigationAction): + error_messages.append(f"Error! Input type `{type(v)}` is not `WaitForNavigationAction`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in BrowserAction with oneOf schemas: AutoScrollAction, ClickAction, EvalAction, FetchAction, FillAction, GetCookiesAction, GotoAction, PressAction, ScreenshotAction, ScrollAction, WaitAction, WaitForElementAction, WaitForNavigationAction. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in BrowserAction with oneOf schemas: AutoScrollAction, ClickAction, EvalAction, FetchAction, FillAction, GetCookiesAction, GotoAction, PressAction, ScreenshotAction, ScrollAction, WaitAction, WaitForElementAction, WaitForNavigationAction. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into AutoScrollAction + try: + instance.actual_instance = AutoScrollAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ClickAction + try: + instance.actual_instance = ClickAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EvalAction + try: + instance.actual_instance = EvalAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into FetchAction + try: + instance.actual_instance = FetchAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into FillAction + try: + instance.actual_instance = FillAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GetCookiesAction + try: + instance.actual_instance = GetCookiesAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GotoAction + try: + instance.actual_instance = GotoAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into PressAction + try: + instance.actual_instance = PressAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ScreenshotAction + try: + instance.actual_instance = ScreenshotAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ScrollAction + try: + instance.actual_instance = ScrollAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WaitAction + try: + instance.actual_instance = WaitAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WaitForElementAction + try: + instance.actual_instance = WaitForElementAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WaitForNavigationAction + try: + instance.actual_instance = WaitForNavigationAction.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into BrowserAction with oneOf schemas: AutoScrollAction, ClickAction, EvalAction, FetchAction, FillAction, GetCookiesAction, GotoAction, PressAction, ScreenshotAction, ScrollAction, WaitAction, WaitForElementAction, WaitForNavigationAction. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into BrowserAction with oneOf schemas: AutoScrollAction, ClickAction, EvalAction, FetchAction, FillAction, GetCookiesAction, GotoAction, PressAction, ScreenshotAction, ScrollAction, WaitAction, WaitForElementAction, WaitForNavigationAction. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AutoScrollAction, ClickAction, EvalAction, FetchAction, FillAction, GetCookiesAction, GotoAction, PressAction, ScreenshotAction, ScrollAction, WaitAction, WaitForElementAction, WaitForNavigationAction]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/citation.py b/candidate/generated/nimble_client/models/citation.py new file mode 100644 index 0000000..c65890a --- /dev/null +++ b/candidate/generated/nimble_client/models/citation.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Citation(BaseModel): + """ + Citation model that maps citation markers to result indices. + """ # noqa: E501 + marker: Annotated[int, Field(strict=True, ge=1)] = Field(description="Citation marker number (e.g., 1 for [1])") + result_index: Annotated[int, Field(strict=True, ge=0)] = Field(description="Zero-based index into the results array") + __properties: ClassVar[List[str]] = ["marker", "result_index"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Citation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Citation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "marker": obj.get("marker"), + "result_index": obj.get("result_index") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/citation_config.py b/candidate/generated/nimble_client/models/citation_config.py new file mode 100644 index 0000000..b3999a4 --- /dev/null +++ b/candidate/generated/nimble_client/models/citation_config.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CitationConfig(BaseModel): + """ + Configuration for citation behavior in the /answer endpoint. + """ # noqa: E501 + enabled: Optional[StrictBool] = Field(default=True, description="Include citations in the answer. When false, returns plain answer without [N] markers.") + format: Optional[StrictStr] = Field(default='marker', description="Citation format: 'marker' embeds [N] in text; 'annotation' returns text with inline markdown links and character-range citations.") + include_description: Optional[StrictBool] = Field(default=False, description="Include description/snippet in each citation object. Default returns only index, url, title.") + __properties: ClassVar[List[str]] = ["enabled", "format", "include_description"] + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['marker', 'annotation']): + raise ValueError("must be one of enum values ('marker', 'annotation')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CitationConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CitationConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "format": obj.get("format") if obj.get("format") is not None else 'marker', + "include_description": obj.get("include_description") if obj.get("include_description") is not None else False + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/citations.py b/candidate/generated/nimble_client/models/citations.py new file mode 100644 index 0000000..85d4278 --- /dev/null +++ b/candidate/generated/nimble_client/models/citations.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from nimble_client.models.answer_annotation_citation import AnswerAnnotationCitation +from nimble_client.models.answer_marker_citation import AnswerMarkerCitation +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CITATIONS_ANY_OF_SCHEMAS = ["List[AnswerAnnotationCitation]", "List[AnswerMarkerCitation]"] + +class Citations(BaseModel): + """ + Sources referenced in the answer. Shape depends on citations.format: 'marker' includes index, 'annotation' includes start_index/end_index character ranges. + """ + + # data type: List[AnswerMarkerCitation] + anyof_schema_1_validator: Optional[List[AnswerMarkerCitation]] = None + # data type: List[AnswerAnnotationCitation] + anyof_schema_2_validator: Optional[List[AnswerAnnotationCitation]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[List[AnswerAnnotationCitation], List[AnswerMarkerCitation]]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[AnswerAnnotationCitation]", "List[AnswerMarkerCitation]" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Citations.model_construct() + error_messages = [] + # validate data type: List[AnswerMarkerCitation] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[AnswerAnnotationCitation] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Citations with anyOf schemas: List[AnswerAnnotationCitation], List[AnswerMarkerCitation]. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into List[AnswerMarkerCitation] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[AnswerAnnotationCitation] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Citations with anyOf schemas: List[AnswerAnnotationCitation], List[AnswerMarkerCitation]. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[AnswerAnnotationCitation], List[AnswerMarkerCitation]]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/click_action.py b/candidate/generated/nimble_client/models/click_action.py new file mode 100644 index 0000000..de49b7f --- /dev/null +++ b/candidate/generated/nimble_client/models/click_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.click_action_click import ClickActionClick +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClickAction(BaseModel): + """ + Click on an element by selector + """ # noqa: E501 + click: ClickActionClick + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["click"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClickAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of click + if self.click: + _dict['click'] = self.click.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClickAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "click": ClickActionClick.from_dict(obj["click"]) if obj.get("click") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/click_action_click.py b/candidate/generated/nimble_client/models/click_action_click.py new file mode 100644 index 0000000..8918e78 --- /dev/null +++ b/candidate/generated/nimble_client/models/click_action_click.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.click_action_click_one_of import ClickActionClickOneOf +from nimble_client.models.selector import Selector +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +CLICKACTIONCLICK_ONE_OF_SCHEMAS = ["ClickActionClickOneOf", "Selector"] + +class ClickActionClick(BaseModel): + """ + ClickActionClick + """ + # data type: Selector + oneof_schema_1_validator: Optional[Selector] = None + # data type: ClickActionClickOneOf + oneof_schema_2_validator: Optional[ClickActionClickOneOf] = None + actual_instance: Optional[Union[ClickActionClickOneOf, Selector]] = None + one_of_schemas: Set[str] = { "ClickActionClickOneOf", "Selector" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = ClickActionClick.model_construct() + error_messages = [] + match = 0 + # validate data type: Selector + if not isinstance(v, Selector): + error_messages.append(f"Error! Input type `{type(v)}` is not `Selector`") + else: + match += 1 + # validate data type: ClickActionClickOneOf + if not isinstance(v, ClickActionClickOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `ClickActionClickOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in ClickActionClick with oneOf schemas: ClickActionClickOneOf, Selector. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in ClickActionClick with oneOf schemas: ClickActionClickOneOf, Selector. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into Selector + try: + instance.actual_instance = Selector.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ClickActionClickOneOf + try: + instance.actual_instance = ClickActionClickOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into ClickActionClick with oneOf schemas: ClickActionClickOneOf, Selector. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into ClickActionClick with oneOf schemas: ClickActionClickOneOf, Selector. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ClickActionClickOneOf, Selector]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/click_action_click_one_of.py b/candidate/generated/nimble_client/models/click_action_click_one_of.py new file mode 100644 index 0000000..2d519c1 --- /dev/null +++ b/candidate/generated/nimble_client/models/click_action_click_one_of.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.duration import Duration +from nimble_client.models.selector import Selector +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClickActionClickOneOf(BaseModel): + """ + ClickActionClickOneOf + """ # noqa: E501 + count: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = 1 + delay: Optional[Duration] = None + offset_x: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]] = None + offset_y: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]] = None + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + scroll: Optional[StrictBool] = True + selector: Selector + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + steps: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = None + strategy: Optional[StrictStr] = None + timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=15000, description="Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.") + visible: Optional[StrictBool] = True + __properties: ClassVar[List[str]] = ["count", "delay", "offset_x", "offset_y", "required", "scroll", "selector", "skip", "steps", "strategy", "timeout", "visible"] + + @field_validator('strategy') + def strategy_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['linear', 'ghost-cursor', 'windmouse']): + raise ValueError("must be one of enum values ('linear', 'ghost-cursor', 'windmouse')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClickActionClickOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of delay + if self.delay: + _dict['delay'] = self.delay.to_dict() + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of selector + if self.selector: + _dict['selector'] = self.selector.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClickActionClickOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "count": obj.get("count") if obj.get("count") is not None else 1, + "delay": Duration.from_dict(obj["delay"]) if obj.get("delay") is not None else None, + "offset_x": obj.get("offset_x"), + "offset_y": obj.get("offset_y"), + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "scroll": obj.get("scroll") if obj.get("scroll") is not None else True, + "selector": Selector.from_dict(obj["selector"]) if obj.get("selector") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "steps": obj.get("steps"), + "strategy": obj.get("strategy"), + "timeout": obj.get("timeout") if obj.get("timeout") is not None else 15000, + "visible": obj.get("visible") if obj.get("visible") is not None else True + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/company_entity.py b/candidate/generated/nimble_client/models/company_entity.py new file mode 100644 index 0000000..c20192e --- /dev/null +++ b/candidate/generated/nimble_client/models/company_entity.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.company_financials import CompanyFinancials +from nimble_client.models.company_headquarters import CompanyHeadquarters +from nimble_client.models.company_web_traffic import CompanyWebTraffic +from nimble_client.models.workforce_total import WorkforceTotal +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CompanyEntity(BaseModel): + """ + Structured data about the company a result is about. + """ # noqa: E501 + financials: Optional[CompanyFinancials] = None + founded_year: Optional[StrictInt] = None + headquarters: Optional[CompanyHeadquarters] = None + name: Optional[StrictStr] = None + type: Optional[StrictStr] = 'company' + web_traffic: Optional[CompanyWebTraffic] = None + workforce_total: Optional[WorkforceTotal] = None + __properties: ClassVar[List[str]] = ["financials", "founded_year", "headquarters", "name", "type", "web_traffic", "workforce_total"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['company']): + raise ValueError("must be one of enum values ('company')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CompanyEntity from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of financials + if self.financials: + _dict['financials'] = self.financials.to_dict() + # override the default output from pydantic by calling `to_dict()` of headquarters + if self.headquarters: + _dict['headquarters'] = self.headquarters.to_dict() + # override the default output from pydantic by calling `to_dict()` of web_traffic + if self.web_traffic: + _dict['web_traffic'] = self.web_traffic.to_dict() + # override the default output from pydantic by calling `to_dict()` of workforce_total + if self.workforce_total: + _dict['workforce_total'] = self.workforce_total.to_dict() + # set to None if financials (nullable) is None + # and model_fields_set contains the field + if self.financials is None and "financials" in self.model_fields_set: + _dict['financials'] = None + + # set to None if founded_year (nullable) is None + # and model_fields_set contains the field + if self.founded_year is None and "founded_year" in self.model_fields_set: + _dict['founded_year'] = None + + # set to None if headquarters (nullable) is None + # and model_fields_set contains the field + if self.headquarters is None and "headquarters" in self.model_fields_set: + _dict['headquarters'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if web_traffic (nullable) is None + # and model_fields_set contains the field + if self.web_traffic is None and "web_traffic" in self.model_fields_set: + _dict['web_traffic'] = None + + # set to None if workforce_total (nullable) is None + # and model_fields_set contains the field + if self.workforce_total is None and "workforce_total" in self.model_fields_set: + _dict['workforce_total'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CompanyEntity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "financials": CompanyFinancials.from_dict(obj["financials"]) if obj.get("financials") is not None else None, + "founded_year": obj.get("founded_year"), + "headquarters": CompanyHeadquarters.from_dict(obj["headquarters"]) if obj.get("headquarters") is not None else None, + "name": obj.get("name"), + "type": obj.get("type") if obj.get("type") is not None else 'company', + "web_traffic": CompanyWebTraffic.from_dict(obj["web_traffic"]) if obj.get("web_traffic") is not None else None, + "workforce_total": WorkforceTotal.from_dict(obj["workforce_total"]) if obj.get("workforce_total") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/company_financials.py b/candidate/generated/nimble_client/models/company_financials.py new file mode 100644 index 0000000..a08f3c4 --- /dev/null +++ b/candidate/generated/nimble_client/models/company_financials.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.funding_round import FundingRound +from nimble_client.models.funding_total import FundingTotal +from nimble_client.models.revenue_annual import RevenueAnnual +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CompanyFinancials(BaseModel): + """ + CompanyFinancials + """ # noqa: E501 + funding_latest_round: Optional[FundingRound] = None + funding_total: Optional[FundingTotal] = None + revenue_annual: Optional[RevenueAnnual] = None + __properties: ClassVar[List[str]] = ["funding_latest_round", "funding_total", "revenue_annual"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CompanyFinancials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of funding_latest_round + if self.funding_latest_round: + _dict['funding_latest_round'] = self.funding_latest_round.to_dict() + # override the default output from pydantic by calling `to_dict()` of funding_total + if self.funding_total: + _dict['funding_total'] = self.funding_total.to_dict() + # override the default output from pydantic by calling `to_dict()` of revenue_annual + if self.revenue_annual: + _dict['revenue_annual'] = self.revenue_annual.to_dict() + # set to None if funding_latest_round (nullable) is None + # and model_fields_set contains the field + if self.funding_latest_round is None and "funding_latest_round" in self.model_fields_set: + _dict['funding_latest_round'] = None + + # set to None if funding_total (nullable) is None + # and model_fields_set contains the field + if self.funding_total is None and "funding_total" in self.model_fields_set: + _dict['funding_total'] = None + + # set to None if revenue_annual (nullable) is None + # and model_fields_set contains the field + if self.revenue_annual is None and "revenue_annual" in self.model_fields_set: + _dict['revenue_annual'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CompanyFinancials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "funding_latest_round": FundingRound.from_dict(obj["funding_latest_round"]) if obj.get("funding_latest_round") is not None else None, + "funding_total": FundingTotal.from_dict(obj["funding_total"]) if obj.get("funding_total") is not None else None, + "revenue_annual": RevenueAnnual.from_dict(obj["revenue_annual"]) if obj.get("revenue_annual") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/company_headquarters.py b/candidate/generated/nimble_client/models/company_headquarters.py new file mode 100644 index 0000000..3c7bf89 --- /dev/null +++ b/candidate/generated/nimble_client/models/company_headquarters.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CompanyHeadquarters(BaseModel): + """ + CompanyHeadquarters + """ # noqa: E501 + address: Optional[StrictStr] = None + city: Optional[StrictStr] = None + country: Optional[StrictStr] = None + postal_code: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "city", "country", "postal_code"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CompanyHeadquarters from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if address (nullable) is None + # and model_fields_set contains the field + if self.address is None and "address" in self.model_fields_set: + _dict['address'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if country (nullable) is None + # and model_fields_set contains the field + if self.country is None and "country" in self.model_fields_set: + _dict['country'] = None + + # set to None if postal_code (nullable) is None + # and model_fields_set contains the field + if self.postal_code is None and "postal_code" in self.model_fields_set: + _dict['postal_code'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CompanyHeadquarters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "city": obj.get("city"), + "country": obj.get("country"), + "postal_code": obj.get("postal_code") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/company_web_traffic.py b/candidate/generated/nimble_client/models/company_web_traffic.py new file mode 100644 index 0000000..4cffd72 --- /dev/null +++ b/candidate/generated/nimble_client/models/company_web_traffic.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.avg_duration_seconds import AvgDurationSeconds +from nimble_client.models.country_rank import CountryRank +from nimble_client.models.visits_monthly import VisitsMonthly +from nimble_client.models.web_traffic_month import WebTrafficMonth +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CompanyWebTraffic(BaseModel): + """ + CompanyWebTraffic + """ # noqa: E501 + avg_duration_seconds: Optional[AvgDurationSeconds] = None + country_rank: Optional[CountryRank] = None + history: Optional[List[WebTrafficMonth]] = None + visits_monthly: Optional[VisitsMonthly] = None + __properties: ClassVar[List[str]] = ["avg_duration_seconds", "country_rank", "history", "visits_monthly"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CompanyWebTraffic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of avg_duration_seconds + if self.avg_duration_seconds: + _dict['avg_duration_seconds'] = self.avg_duration_seconds.to_dict() + # override the default output from pydantic by calling `to_dict()` of country_rank + if self.country_rank: + _dict['country_rank'] = self.country_rank.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in history (list) + _items = [] + if self.history: + for _item_history in self.history: + _items.append(_item_history.to_dict() if _item_history is not None else None) + _dict['history'] = _items + # override the default output from pydantic by calling `to_dict()` of visits_monthly + if self.visits_monthly: + _dict['visits_monthly'] = self.visits_monthly.to_dict() + # set to None if avg_duration_seconds (nullable) is None + # and model_fields_set contains the field + if self.avg_duration_seconds is None and "avg_duration_seconds" in self.model_fields_set: + _dict['avg_duration_seconds'] = None + + # set to None if country_rank (nullable) is None + # and model_fields_set contains the field + if self.country_rank is None and "country_rank" in self.model_fields_set: + _dict['country_rank'] = None + + # set to None if history (nullable) is None + # and model_fields_set contains the field + if self.history is None and "history" in self.model_fields_set: + _dict['history'] = None + + # set to None if visits_monthly (nullable) is None + # and model_fields_set contains the field + if self.visits_monthly is None and "visits_monthly" in self.model_fields_set: + _dict['visits_monthly'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CompanyWebTraffic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avg_duration_seconds": AvgDurationSeconds.from_dict(obj["avg_duration_seconds"]) if obj.get("avg_duration_seconds") is not None else None, + "country_rank": CountryRank.from_dict(obj["country_rank"]) if obj.get("country_rank") is not None else None, + "history": [WebTrafficMonth.from_dict(_item) for _item in obj["history"]] if obj.get("history") is not None else None, + "visits_monthly": VisitsMonthly.from_dict(obj["visits_monthly"]) if obj.get("visits_monthly") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/content.py b/candidate/generated/nimble_client/models/content.py new file mode 100644 index 0000000..516611e --- /dev/null +++ b/candidate/generated/nimble_client/models/content.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, List, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CONTENT_ANY_OF_SCHEMAS = ["Dict[str, object]", "List[object]"] + +class Content(BaseModel): + """ + Data conforming to the caller-supplied JSON schema. A dict for object schemas; a list for array schemas. + """ + + # data type: Dict[str, object] + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: List[object] + anyof_schema_2_validator: Optional[List[Any]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Dict[str, object], List[object]]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "Dict[str, object]", "List[object]" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Content.model_construct() + error_messages = [] + # validate data type: Dict[str, object] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[object] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Content with anyOf schemas: Dict[str, object], List[object]. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into Dict[str, object] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[object] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Content with anyOf schemas: Dict[str, object], List[object]. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, object], List[object]]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/country_rank.py b/candidate/generated/nimble_client/models/country_rank.py new file mode 100644 index 0000000..1b2a34a --- /dev/null +++ b/candidate/generated/nimble_client/models/country_rank.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +COUNTRYRANK_ANY_OF_SCHEMAS = ["float", "int"] + +class CountryRank(BaseModel): + """ + CountryRank + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: float + anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, int]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "float", "int" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = CountryRank.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CountryRank with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CountryRank with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_api_response.py b/candidate/generated/nimble_client/models/crawl_api_response.py new file mode 100644 index 0000000..d1ec110 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_api_response.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from uuid import UUID +from nimble_client.models.crawl_api_response_completed_at import CrawlApiResponseCompletedAt +from nimble_client.models.crawl_api_response_crawl_options import CrawlApiResponseCrawlOptions +from nimble_client.models.crawl_api_response_created_at import CrawlApiResponseCreatedAt +from nimble_client.models.crawl_api_response_tasks_inner import CrawlApiResponseTasksInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlApiResponse(BaseModel): + """ + Crawl API response + """ # noqa: E501 + account_name: Optional[StrictStr] = Field(description="Cursor for pagination.") + completed: Optional[Union[StrictFloat, StrictInt]] = None + completed_at: Optional[CrawlApiResponseCompletedAt] = None + crawl_id: Optional[UUID] + crawl_options: CrawlApiResponseCrawlOptions + created_at: CrawlApiResponseCreatedAt + extract_options: Optional[Dict[str, Any]] = None + failed: Optional[Union[StrictFloat, StrictInt]] = None + name: Optional[StrictStr] = None + pending: Optional[Union[StrictFloat, StrictInt]] = None + status: StrictStr + tasks: Optional[List[CrawlApiResponseTasksInner]] = None + total: Optional[Union[StrictFloat, StrictInt]] = None + updated_at: CrawlApiResponseCreatedAt + url: Optional[StrictStr] = Field(description="URL for downloading the task results.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["account_name", "completed", "completed_at", "crawl_id", "crawl_options", "created_at", "extract_options", "failed", "name", "pending", "status", "tasks", "total", "updated_at", "url"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['queued', 'running', 'succeeded', 'failed', 'canceled']): + raise ValueError("must be one of enum values ('queued', 'running', 'succeeded', 'failed', 'canceled')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlApiResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of completed_at + if self.completed_at: + _dict['completed_at'] = self.completed_at.to_dict() + # override the default output from pydantic by calling `to_dict()` of crawl_options + if self.crawl_options: + _dict['crawl_options'] = self.crawl_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of created_at + if self.created_at: + _dict['created_at'] = self.created_at.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in tasks (list) + _items = [] + if self.tasks: + for _item_tasks in self.tasks: + _items.append(_item_tasks.to_dict() if _item_tasks is not None else None) + _dict['tasks'] = _items + # override the default output from pydantic by calling `to_dict()` of updated_at + if self.updated_at: + _dict['updated_at'] = self.updated_at.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if account_name (nullable) is None + # and model_fields_set contains the field + if self.account_name is None and "account_name" in self.model_fields_set: + _dict['account_name'] = None + + # set to None if completed_at (nullable) is None + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: + _dict['completed_at'] = None + + # set to None if crawl_id (nullable) is None + # and model_fields_set contains the field + if self.crawl_id is None and "crawl_id" in self.model_fields_set: + _dict['crawl_id'] = None + + # set to None if extract_options (nullable) is None + # and model_fields_set contains the field + if self.extract_options is None and "extract_options" in self.model_fields_set: + _dict['extract_options'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlApiResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_name": obj.get("account_name"), + "completed": obj.get("completed"), + "completed_at": CrawlApiResponseCompletedAt.from_dict(obj["completed_at"]) if obj.get("completed_at") is not None else None, + "crawl_id": obj.get("crawl_id"), + "crawl_options": CrawlApiResponseCrawlOptions.from_dict(obj["crawl_options"]) if obj.get("crawl_options") is not None else None, + "created_at": CrawlApiResponseCreatedAt.from_dict(obj["created_at"]) if obj.get("created_at") is not None else None, + "extract_options": obj.get("extract_options"), + "failed": obj.get("failed"), + "name": obj.get("name"), + "pending": obj.get("pending"), + "status": obj.get("status"), + "tasks": [CrawlApiResponseTasksInner.from_dict(_item) for _item in obj["tasks"]] if obj.get("tasks") is not None else None, + "total": obj.get("total"), + "updated_at": CrawlApiResponseCreatedAt.from_dict(obj["updated_at"]) if obj.get("updated_at") is not None else None, + "url": obj.get("url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_api_response_completed_at.py b/candidate/generated/nimble_client/models/crawl_api_response_completed_at.py new file mode 100644 index 0000000..e4d0719 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_api_response_completed_at.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLAPIRESPONSECOMPLETEDAT_ANY_OF_SCHEMAS = ["Dict[str, object]", "str"] + +class CrawlApiResponseCompletedAt(BaseModel): + """ + CrawlApiResponseCompletedAt + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: Dict[str, object] + anyof_schema_2_validator: Optional[Dict[str, Any]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Dict[str, object], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "Dict[str, object]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = CrawlApiResponseCompletedAt.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: Dict[str, object] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlApiResponseCompletedAt with anyOf schemas: Dict[str, object], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into Dict[str, object] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlApiResponseCompletedAt with anyOf schemas: Dict[str, object], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, object], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_api_response_crawl_options.py b/candidate/generated/nimble_client/models/crawl_api_response_crawl_options.py new file mode 100644 index 0000000..21e9081 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_api_response_crawl_options.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.crawl_api_response_crawl_options_callback import CrawlApiResponseCrawlOptionsCallback +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlApiResponseCrawlOptions(BaseModel): + """ + CrawlApiResponseCrawlOptions + """ # noqa: E501 + allow_external_links: StrictBool + allow_subdomains: StrictBool + callback: Optional[CrawlApiResponseCrawlOptionsCallback] = None + crawl_entire_domain: StrictBool + exclude_paths: Optional[List[StrictStr]] = None + ignore_query_parameters: StrictBool + include_paths: Optional[List[StrictStr]] = None + limit: Annotated[int, Field(le=10000, strict=True, ge=1)] + max_discovery_depth: Annotated[int, Field(le=20, strict=True, ge=1)] + sitemap: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["allow_external_links", "allow_subdomains", "callback", "crawl_entire_domain", "exclude_paths", "ignore_query_parameters", "include_paths", "limit", "max_discovery_depth", "sitemap"] + + @field_validator('sitemap') + def sitemap_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['skip', 'include', 'only']): + raise ValueError("must be one of enum values ('skip', 'include', 'only')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlApiResponseCrawlOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of callback + if self.callback: + _dict['callback'] = self.callback.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlApiResponseCrawlOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow_external_links": obj.get("allow_external_links") if obj.get("allow_external_links") is not None else False, + "allow_subdomains": obj.get("allow_subdomains") if obj.get("allow_subdomains") is not None else False, + "callback": CrawlApiResponseCrawlOptionsCallback.from_dict(obj["callback"]) if obj.get("callback") is not None else None, + "crawl_entire_domain": obj.get("crawl_entire_domain") if obj.get("crawl_entire_domain") is not None else False, + "exclude_paths": obj.get("exclude_paths"), + "ignore_query_parameters": obj.get("ignore_query_parameters") if obj.get("ignore_query_parameters") is not None else False, + "include_paths": obj.get("include_paths"), + "limit": obj.get("limit") if obj.get("limit") is not None else 5000, + "max_discovery_depth": obj.get("max_discovery_depth") if obj.get("max_discovery_depth") is not None else 5, + "sitemap": obj.get("sitemap") if obj.get("sitemap") is not None else 'include' + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_api_response_crawl_options_callback.py b/candidate/generated/nimble_client/models/crawl_api_response_crawl_options_callback.py new file mode 100644 index 0000000..68d8461 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_api_response_crawl_options_callback.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.crawl_api_response_crawl_options_callback_any_of import CrawlApiResponseCrawlOptionsCallbackAnyOf +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLAPIRESPONSECRAWLOPTIONSCALLBACK_ANY_OF_SCHEMAS = ["CrawlApiResponseCrawlOptionsCallbackAnyOf", "str"] + +class CrawlApiResponseCrawlOptionsCallback(BaseModel): + """ + CrawlApiResponseCrawlOptionsCallback + """ + + # data type: CrawlApiResponseCrawlOptionsCallbackAnyOf + anyof_schema_1_validator: Optional[CrawlApiResponseCrawlOptionsCallbackAnyOf] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = Field(default=None, description="URL for downloading the task results.") + if TYPE_CHECKING: + actual_instance: Optional[Union[CrawlApiResponseCrawlOptionsCallbackAnyOf, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "CrawlApiResponseCrawlOptionsCallbackAnyOf", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlApiResponseCrawlOptionsCallback.model_construct() + error_messages = [] + # validate data type: CrawlApiResponseCrawlOptionsCallbackAnyOf + if not isinstance(v, CrawlApiResponseCrawlOptionsCallbackAnyOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `CrawlApiResponseCrawlOptionsCallbackAnyOf`") + else: + return v + + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlApiResponseCrawlOptionsCallback with anyOf schemas: CrawlApiResponseCrawlOptionsCallbackAnyOf, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[CrawlApiResponseCrawlOptionsCallbackAnyOf] = None + try: + instance.actual_instance = CrawlApiResponseCrawlOptionsCallbackAnyOf.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlApiResponseCrawlOptionsCallback with anyOf schemas: CrawlApiResponseCrawlOptionsCallbackAnyOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], CrawlApiResponseCrawlOptionsCallbackAnyOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_api_response_crawl_options_callback_any_of.py b/candidate/generated/nimble_client/models/crawl_api_response_crawl_options_callback_any_of.py new file mode 100644 index 0000000..69bdbdd --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_api_response_crawl_options_callback_any_of.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlApiResponseCrawlOptionsCallbackAnyOf(BaseModel): + """ + CrawlApiResponseCrawlOptionsCallbackAnyOf + """ # noqa: E501 + events: Optional[List[StrictStr]] = None + headers: Optional[Dict[str, StrictStr]] = None + metadata: Optional[Dict[str, Any]] = None + url: Optional[StrictStr] = Field(description="URL for downloading the task results.") + __properties: ClassVar[List[str]] = ["events", "headers", "metadata", "url"] + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['started', 'page', 'completed', 'failed']): + raise ValueError("each list item must be one of ('started', 'page', 'completed', 'failed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlApiResponseCrawlOptionsCallbackAnyOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlApiResponseCrawlOptionsCallbackAnyOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "events": obj.get("events"), + "headers": obj.get("headers"), + "metadata": obj.get("metadata"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_api_response_created_at.py b/candidate/generated/nimble_client/models/crawl_api_response_created_at.py new file mode 100644 index 0000000..4700026 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_api_response_created_at.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLAPIRESPONSECREATEDAT_ANY_OF_SCHEMAS = ["Dict[str, object]", "str"] + +class CrawlApiResponseCreatedAt(BaseModel): + """ + CrawlApiResponseCreatedAt + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: Dict[str, object] + anyof_schema_2_validator: Optional[Dict[str, Any]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Dict[str, object], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "Dict[str, object]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlApiResponseCreatedAt.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: Dict[str, object] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlApiResponseCreatedAt with anyOf schemas: Dict[str, object], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into Dict[str, object] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlApiResponseCreatedAt with anyOf schemas: Dict[str, object], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, object], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_api_response_tasks_inner.py b/candidate/generated/nimble_client/models/crawl_api_response_tasks_inner.py new file mode 100644 index 0000000..8f42c04 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_api_response_tasks_inner.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlApiResponseTasksInner(BaseModel): + """ + CrawlApiResponseTasksInner + """ # noqa: E501 + created_at: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + status: StrictStr + task_id: Optional[StrictStr] = Field(description="Cursor for pagination.") + updated_at: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + __properties: ClassVar[List[str]] = ["created_at", "status", "task_id", "updated_at"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'completed', 'failed']): + raise ValueError("must be one of enum values ('pending', 'completed', 'failed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlApiResponseTasksInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if task_id (nullable) is None + # and model_fields_set contains the field + if self.task_id is None and "task_id" in self.model_fields_set: + _dict['task_id'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlApiResponseTasksInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "status": obj.get("status"), + "task_id": obj.get("task_id"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_by_filters_response.py b/candidate/generated/nimble_client/models/crawl_by_filters_response.py new file mode 100644 index 0000000..a7fbeb0 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_by_filters_response.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.crawl_api_response import CrawlApiResponse +from nimble_client.models.crawl_by_filters_response_pagination import CrawlByFiltersResponsePagination +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlByFiltersResponse(BaseModel): + """ + Successful get crawl response + """ # noqa: E501 + data: List[CrawlApiResponse] + pagination: CrawlByFiltersResponsePagination + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data", "pagination"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlByFiltersResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + _items.append(_item_data.to_dict() if _item_data is not None else None) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlByFiltersResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CrawlApiResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "pagination": CrawlByFiltersResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_by_filters_response_pagination.py b/candidate/generated/nimble_client/models/crawl_by_filters_response_pagination.py new file mode 100644 index 0000000..b4c31fa --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_by_filters_response_pagination.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlByFiltersResponsePagination(BaseModel): + """ + CrawlByFiltersResponsePagination + """ # noqa: E501 + has_next: StrictBool + next_cursor: Optional[StrictStr] = None + total: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["has_next", "next_cursor", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlByFiltersResponsePagination from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if next_cursor (nullable) is None + # and model_fields_set contains the field + if self.next_cursor is None and "next_cursor" in self.model_fields_set: + _dict['next_cursor'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlByFiltersResponsePagination from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "has_next": obj.get("has_next"), + "next_cursor": obj.get("next_cursor"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload.py b/candidate/generated/nimble_client/models/crawl_payload.py new file mode 100644 index 0000000..b1be568 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.crawl_payload_callback import CrawlPayloadCallback +from nimble_client.models.crawl_payload_extract_options import CrawlPayloadExtractOptions +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlPayload(BaseModel): + """ + Request body model for the /crawl endpoint + """ # noqa: E501 + allow_external_links: Optional[StrictBool] = Field(default=False, description="Allows the crawler to follow links to external websites.") + allow_subdomains: Optional[StrictBool] = Field(default=False, description="Allows the crawler to follow links to subdomains of the main domain.") + callback: Optional[CrawlPayloadCallback] = None + crawl_entire_domain: Optional[StrictBool] = Field(default=False, description="Allows the crawler to follow internal links to sibling or parent URLs, not just child paths.") + exclude_paths: Optional[List[Optional[StrictStr]]] = Field(default=None, description="URL pathname regex patterns that exclude matching URLs from the crawl.") + extract_options: Optional[CrawlPayloadExtractOptions] = None + ignore_query_parameters: Optional[StrictBool] = Field(default=False, description="Do not re-scrape the same path with different (or none) query parameters.") + include_paths: Optional[List[Optional[StrictStr]]] = Field(default=None, description="URL pathname regex patterns that include matching URLs in the crawl.") + limit: Optional[Annotated[int, Field(le=10000, strict=True, ge=1)]] = Field(default=5000, description="Maximum number of pages to crawl.") + max_discovery_depth: Optional[Annotated[int, Field(le=20, strict=True, ge=1)]] = Field(default=5, description="Maximum depth to crawl based on discovery order.") + name: Optional[StrictStr] = Field(default=None, description="Name of the crawl.") + sitemap: Optional[StrictStr] = Field(default='include', description="Sitemap and other methods will be used together to find URLs.") + url: StrictStr = Field(description="Url to crawl.") + __properties: ClassVar[List[str]] = ["allow_external_links", "allow_subdomains", "callback", "crawl_entire_domain", "exclude_paths", "extract_options", "ignore_query_parameters", "include_paths", "limit", "max_discovery_depth", "name", "sitemap", "url"] + + @field_validator('sitemap') + def sitemap_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['skip', 'include', 'only']): + raise ValueError("must be one of enum values ('skip', 'include', 'only')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of callback + if self.callback: + _dict['callback'] = self.callback.to_dict() + # override the default output from pydantic by calling `to_dict()` of extract_options + if self.extract_options: + _dict['extract_options'] = self.extract_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow_external_links": obj.get("allow_external_links") if obj.get("allow_external_links") is not None else False, + "allow_subdomains": obj.get("allow_subdomains") if obj.get("allow_subdomains") is not None else False, + "callback": CrawlPayloadCallback.from_dict(obj["callback"]) if obj.get("callback") is not None else None, + "crawl_entire_domain": obj.get("crawl_entire_domain") if obj.get("crawl_entire_domain") is not None else False, + "exclude_paths": obj.get("exclude_paths"), + "extract_options": CrawlPayloadExtractOptions.from_dict(obj["extract_options"]) if obj.get("extract_options") is not None else None, + "ignore_query_parameters": obj.get("ignore_query_parameters") if obj.get("ignore_query_parameters") is not None else False, + "include_paths": obj.get("include_paths"), + "limit": obj.get("limit") if obj.get("limit") is not None else 5000, + "max_discovery_depth": obj.get("max_discovery_depth") if obj.get("max_discovery_depth") is not None else 5, + "name": obj.get("name"), + "sitemap": obj.get("sitemap") if obj.get("sitemap") is not None else 'include', + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_callback.py b/candidate/generated/nimble_client/models/crawl_payload_callback.py new file mode 100644 index 0000000..af2f25c --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_callback.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.crawl_payload_callback_any_of import CrawlPayloadCallbackAnyOf +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADCALLBACK_ANY_OF_SCHEMAS = ["CrawlPayloadCallbackAnyOf", "str"] + +class CrawlPayloadCallback(BaseModel): + """ + Webhook configuration for receiving crawl results. + """ + + # data type: CrawlPayloadCallbackAnyOf + anyof_schema_1_validator: Optional[CrawlPayloadCallbackAnyOf] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[CrawlPayloadCallbackAnyOf, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "CrawlPayloadCallbackAnyOf", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlPayloadCallback.model_construct() + error_messages = [] + # validate data type: CrawlPayloadCallbackAnyOf + if not isinstance(v, CrawlPayloadCallbackAnyOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `CrawlPayloadCallbackAnyOf`") + else: + return v + + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadCallback with anyOf schemas: CrawlPayloadCallbackAnyOf, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[CrawlPayloadCallbackAnyOf] = None + try: + instance.actual_instance = CrawlPayloadCallbackAnyOf.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadCallback with anyOf schemas: CrawlPayloadCallbackAnyOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], CrawlPayloadCallbackAnyOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_callback_any_of.py b/candidate/generated/nimble_client/models/crawl_payload_callback_any_of.py new file mode 100644 index 0000000..3590fdc --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_callback_any_of.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.crawl_payload_callback_any_of_any_of import CrawlPayloadCallbackAnyOfAnyOf +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADCALLBACKANYOF_ANY_OF_SCHEMAS = ["CrawlPayloadCallbackAnyOfAnyOf", "str"] + +class CrawlPayloadCallbackAnyOf(BaseModel): + """ + CrawlPayloadCallbackAnyOf + """ + + # data type: CrawlPayloadCallbackAnyOfAnyOf + anyof_schema_1_validator: Optional[CrawlPayloadCallbackAnyOfAnyOf] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[CrawlPayloadCallbackAnyOfAnyOf, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "CrawlPayloadCallbackAnyOfAnyOf", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlPayloadCallbackAnyOf.model_construct() + error_messages = [] + # validate data type: CrawlPayloadCallbackAnyOfAnyOf + if not isinstance(v, CrawlPayloadCallbackAnyOfAnyOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `CrawlPayloadCallbackAnyOfAnyOf`") + else: + return v + + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadCallbackAnyOf with anyOf schemas: CrawlPayloadCallbackAnyOfAnyOf, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[CrawlPayloadCallbackAnyOfAnyOf] = None + try: + instance.actual_instance = CrawlPayloadCallbackAnyOfAnyOf.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadCallbackAnyOf with anyOf schemas: CrawlPayloadCallbackAnyOfAnyOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], CrawlPayloadCallbackAnyOfAnyOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_callback_any_of_any_of.py b/candidate/generated/nimble_client/models/crawl_payload_callback_any_of_any_of.py new file mode 100644 index 0000000..c63a35e --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_callback_any_of_any_of.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlPayloadCallbackAnyOfAnyOf(BaseModel): + """ + CrawlPayloadCallbackAnyOfAnyOf + """ # noqa: E501 + events: Optional[List[StrictStr]] = None + headers: Optional[Dict[str, StrictStr]] = None + metadata: Optional[Dict[str, Any]] = None + url: StrictStr + __properties: ClassVar[List[str]] = ["events", "headers", "metadata", "url"] + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['started', 'page', 'completed', 'failed']): + raise ValueError("each list item must be one of ('started', 'page', 'completed', 'failed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlPayloadCallbackAnyOfAnyOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlPayloadCallbackAnyOfAnyOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "events": obj.get("events"), + "headers": obj.get("headers"), + "metadata": obj.get("metadata"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options.py new file mode 100644 index 0000000..0c1251a --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options.py @@ -0,0 +1,311 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.browser_action import BrowserAction +from nimble_client.models.crawl_payload_extract_options_browser import CrawlPayloadExtractOptionsBrowser +from nimble_client.models.crawl_payload_extract_options_cookies import CrawlPayloadExtractOptionsCookies +from nimble_client.models.crawl_payload_extract_options_file_parsing_options import CrawlPayloadExtractOptionsFileParsingOptions +from nimble_client.models.crawl_payload_extract_options_headers_value import CrawlPayloadExtractOptionsHeadersValue +from nimble_client.models.crawl_payload_extract_options_network_capture_inner import CrawlPayloadExtractOptionsNetworkCaptureInner +from nimble_client.models.crawl_payload_extract_options_parser import CrawlPayloadExtractOptionsParser +from nimble_client.models.crawl_payload_extract_options_render import CrawlPayloadExtractOptionsRender +from nimble_client.models.crawl_payload_extract_options_session import CrawlPayloadExtractOptionsSession +from nimble_client.models.crawl_payload_extract_options_skill import CrawlPayloadExtractOptionsSkill +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlPayloadExtractOptions(BaseModel): + """ + CrawlPayloadExtractOptions + """ # noqa: E501 + auto_driver_configuration: Optional[Dict[str, Annotated[int, Field(le=10, strict=True, ge=0)]]] = Field(default=None, description="Custom flow for the optimization engine: maps candidate names to the number of attempts to spend on each candidate before advancing (0 skips it). Key order defines the flow order. Providing it opts the request into 'auto' driver selection.") + body: Optional[Any] = Field(default=None, description="Request body for POST, PUT, PATCH methods") + browser: Optional[CrawlPayloadExtractOptionsBrowser] = None + browser_actions: Optional[Annotated[List[BrowserAction], Field(min_length=1)]] = Field(default=None, description="Array of browser automation actions to execute sequentially", json_schema_extra={"examples": [[{"goto": "https://example.com/login"}, {"wait_for_element": "#login-form"}, {"fill": {"selector": "#username", "value": "user@example.com"}}, {"fill": {"selector": "#password", "value": "password123"}}, {"click": "#submit"}, {"screenshot": {"full_page": True}}]]}) + city: Optional[StrictStr] = Field(default=None, description="City for geolocation") + consent_header: Optional[StrictBool] = Field(default=None, description="Whether to automatically handle cookie consent headers") + cookies: Optional[CrawlPayloadExtractOptionsCookies] = None + country: Optional[StrictStr] = Field(default='ALL', description="Country code for geolocation and proxy selection") + device: Optional[StrictStr] = Field(default='desktop', description="Device type for browser emulation") + driver: Optional[StrictStr] = Field(default=None, description="Browser driver to use") + expected_status_codes: Optional[List[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]]] = Field(default=None, description="Expected HTTP status codes for successful requests") + file_parsing_options: Optional[CrawlPayloadExtractOptionsFileParsingOptions] = None + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="List of acceptable response formats in order of preference") + headers: Optional[Dict[str, Optional[CrawlPayloadExtractOptionsHeadersValue]]] = Field(default=None, description="Custom HTTP headers to include in the request") + http2: Optional[StrictBool] = Field(default=False, description="Whether to use HTTP/2 protocol") + is_xhr: Optional[StrictBool] = Field(default=False, description="Whether to emulate XMLHttpRequest behavior") + locale: Optional[StrictStr] = Field(default='en', description="Locale for browser language and region settings") + markdown_backend: Optional[StrictStr] = Field(default='full_page', description="Selects which markdown conversion strategy to use. \"full_page\" converts the entire HTML page. \"main_content\" uses Mozilla Readability to extract the main article content before converting.") + method: Optional[StrictStr] = Field(default='GET', description="HTTP method for the request") + network_capture: Optional[List[CrawlPayloadExtractOptionsNetworkCaptureInner]] = Field(default=None, description="Filters for capturing network traffic") + os: Optional[StrictStr] = Field(default=None, description="Operating system to emulate") + parse: Optional[StrictBool] = Field(default=False, description="Whether to parse the response content") + parser: Optional[CrawlPayloadExtractOptionsParser] = None + realtime_total_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout — it can shorten the deadline but never extend it. Has no effect on async requests.") + referrer_type: Optional[StrictStr] = Field(default=None, description="Referrer policy for the request") + render: Optional[CrawlPayloadExtractOptionsRender] = None + request_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Request timeout in milliseconds") + session: Optional[CrawlPayloadExtractOptionsSession] = None + skill: Optional[CrawlPayloadExtractOptionsSkill] = None + state: Optional[StrictStr] = Field(default=None, description="US state for geolocation (only valid when country is US)") + tag: Optional[StrictStr] = Field(default=None, description="User-defined tag for request identification") + url: Optional[StrictStr] = Field(default=None, description="Target URL to scrape") + __properties: ClassVar[List[str]] = ["auto_driver_configuration", "body", "browser", "browser_actions", "city", "consent_header", "cookies", "country", "device", "driver", "expected_status_codes", "file_parsing_options", "formats", "headers", "http2", "is_xhr", "locale", "markdown_backend", "method", "network_capture", "os", "parse", "parser", "realtime_total_timeout", "referrer_type", "render", "request_timeout", "session", "skill", "state", "tag", "url"] + + @field_validator('country') + def country_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL']): + raise ValueError("must be one of enum values ('AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL')") + return value + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile', 'tablet']): + raise ValueError("must be one of enum values ('desktop', 'mobile', 'tablet')") + return value + + @field_validator('driver') + def driver_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6']): + raise ValueError("must be one of enum values ('auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6')") + return value + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto']): + raise ValueError("must be one of enum values ('aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto')") + return value + + @field_validator('markdown_backend') + def markdown_backend_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['full_page', 'main_content']): + raise ValueError("must be one of enum values ('full_page', 'main_content')") + return value + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']): + raise ValueError("must be one of enum values ('GET', 'POST', 'PUT', 'PATCH', 'DELETE')") + return value + + @field_validator('os') + def os_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['windows', 'mac os', 'linux', 'android', 'ios']): + raise ValueError("must be one of enum values ('windows', 'mac os', 'linux', 'android', 'ios')") + return value + + @field_validator('referrer_type') + def referrer_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram']): + raise ValueError("must be one of enum values ('random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY']): + raise ValueError("must be one of enum values ('AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser + if self.browser: + _dict['browser'] = self.browser.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in browser_actions (list) + _items = [] + if self.browser_actions: + for _item_browser_actions in self.browser_actions: + _items.append(_item_browser_actions.to_dict() if _item_browser_actions is not None else None) + _dict['browser_actions'] = _items + # override the default output from pydantic by calling `to_dict()` of cookies + if self.cookies: + _dict['cookies'] = self.cookies.to_dict() + # override the default output from pydantic by calling `to_dict()` of file_parsing_options + if self.file_parsing_options: + _dict['file_parsing_options'] = self.file_parsing_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in headers (dict) + _field_dict = {} + if self.headers: + for _key_headers in self.headers: + _field_dict[_key_headers] = self.headers[_key_headers].to_dict() if self.headers[_key_headers] is not None else None + _dict['headers'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of each item in network_capture (list) + _items = [] + if self.network_capture: + for _item_network_capture in self.network_capture: + _items.append(_item_network_capture.to_dict() if _item_network_capture is not None else None) + _dict['network_capture'] = _items + # override the default output from pydantic by calling `to_dict()` of parser + if self.parser: + _dict['parser'] = self.parser.to_dict() + # override the default output from pydantic by calling `to_dict()` of render + if self.render: + _dict['render'] = self.render.to_dict() + # override the default output from pydantic by calling `to_dict()` of session + if self.session: + _dict['session'] = self.session.to_dict() + # override the default output from pydantic by calling `to_dict()` of skill + if self.skill: + _dict['skill'] = self.skill.to_dict() + # set to None if body (nullable) is None + # and model_fields_set contains the field + if self.body is None and "body" in self.model_fields_set: + _dict['body'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auto_driver_configuration": obj.get("auto_driver_configuration"), + "body": obj.get("body"), + "browser": CrawlPayloadExtractOptionsBrowser.from_dict(obj["browser"]) if obj.get("browser") is not None else None, + "browser_actions": [BrowserAction.from_dict(_item) for _item in obj["browser_actions"]] if obj.get("browser_actions") is not None else None, + "city": obj.get("city"), + "consent_header": obj.get("consent_header"), + "cookies": CrawlPayloadExtractOptionsCookies.from_dict(obj["cookies"]) if obj.get("cookies") is not None else None, + "country": obj.get("country") if obj.get("country") is not None else 'ALL', + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "driver": obj.get("driver"), + "expected_status_codes": obj.get("expected_status_codes"), + "file_parsing_options": CrawlPayloadExtractOptionsFileParsingOptions.from_dict(obj["file_parsing_options"]) if obj.get("file_parsing_options") is not None else None, + "formats": obj.get("formats"), + "headers": dict( + (_k, CrawlPayloadExtractOptionsHeadersValue.from_dict(_v)) + for _k, _v in obj["headers"].items() + ) + if obj.get("headers") is not None + else None, + "http2": obj.get("http2") if obj.get("http2") is not None else False, + "is_xhr": obj.get("is_xhr") if obj.get("is_xhr") is not None else False, + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', + "markdown_backend": obj.get("markdown_backend") if obj.get("markdown_backend") is not None else 'full_page', + "method": obj.get("method") if obj.get("method") is not None else 'GET', + "network_capture": [CrawlPayloadExtractOptionsNetworkCaptureInner.from_dict(_item) for _item in obj["network_capture"]] if obj.get("network_capture") is not None else None, + "os": obj.get("os"), + "parse": obj.get("parse") if obj.get("parse") is not None else False, + "parser": CrawlPayloadExtractOptionsParser.from_dict(obj["parser"]) if obj.get("parser") is not None else None, + "realtime_total_timeout": obj.get("realtime_total_timeout"), + "referrer_type": obj.get("referrer_type"), + "render": CrawlPayloadExtractOptionsRender.from_dict(obj["render"]) if obj.get("render") is not None else None, + "request_timeout": obj.get("request_timeout"), + "session": CrawlPayloadExtractOptionsSession.from_dict(obj["session"]) if obj.get("session") is not None else None, + "skill": CrawlPayloadExtractOptionsSkill.from_dict(obj["skill"]) if obj.get("skill") is not None else None, + "state": obj.get("state"), + "tag": obj.get("tag"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_browser.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_browser.py new file mode 100644 index 0000000..4b4a06a --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_browser.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.crawl_payload_extract_options_browser_any_of import CrawlPayloadExtractOptionsBrowserAnyOf +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADEXTRACTOPTIONSBROWSER_ANY_OF_SCHEMAS = ["CrawlPayloadExtractOptionsBrowserAnyOf", "str"] + +class CrawlPayloadExtractOptionsBrowser(BaseModel): + """ + CrawlPayloadExtractOptionsBrowser + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = Field(default=None, description="Browser type to emulate") + # data type: CrawlPayloadExtractOptionsBrowserAnyOf + anyof_schema_2_validator: Optional[CrawlPayloadExtractOptionsBrowserAnyOf] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[CrawlPayloadExtractOptionsBrowserAnyOf, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "CrawlPayloadExtractOptionsBrowserAnyOf", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlPayloadExtractOptionsBrowser.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: CrawlPayloadExtractOptionsBrowserAnyOf + if not isinstance(v, CrawlPayloadExtractOptionsBrowserAnyOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `CrawlPayloadExtractOptionsBrowserAnyOf`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadExtractOptionsBrowser with anyOf schemas: CrawlPayloadExtractOptionsBrowserAnyOf, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[CrawlPayloadExtractOptionsBrowserAnyOf] = None + try: + instance.actual_instance = CrawlPayloadExtractOptionsBrowserAnyOf.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadExtractOptionsBrowser with anyOf schemas: CrawlPayloadExtractOptionsBrowserAnyOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], CrawlPayloadExtractOptionsBrowserAnyOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_browser_any_of.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_browser_any_of.py new file mode 100644 index 0000000..d2176d9 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_browser_any_of.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlPayloadExtractOptionsBrowserAnyOf(BaseModel): + """ + CrawlPayloadExtractOptionsBrowserAnyOf + """ # noqa: E501 + name: StrictStr + version: Optional[StrictStr] = Field(default=None, description="Specific browser version to emulate") + __properties: ClassVar[List[str]] = ["name", "version"] + + @field_validator('name') + def name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['chrome', 'firefox']): + raise ValueError("must be one of enum values ('chrome', 'firefox')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsBrowserAnyOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsBrowserAnyOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "version": obj.get("version") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies.py new file mode 100644 index 0000000..029c2dc --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from nimble_client.models.crawl_payload_extract_options_cookies_any_of_inner import CrawlPayloadExtractOptionsCookiesAnyOfInner +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADEXTRACTOPTIONSCOOKIES_ANY_OF_SCHEMAS = ["List[CrawlPayloadExtractOptionsCookiesAnyOfInner]", "str"] + +class CrawlPayloadExtractOptionsCookies(BaseModel): + """ + CrawlPayloadExtractOptionsCookies + """ + + # data type: List[CrawlPayloadExtractOptionsCookiesAnyOfInner] + anyof_schema_1_validator: Optional[List[CrawlPayloadExtractOptionsCookiesAnyOfInner]] = Field(default=None, description="Browser cookies as array of cookie objects") + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = Field(default=None, description="Browser cookies as string") + if TYPE_CHECKING: + actual_instance: Optional[Union[List[CrawlPayloadExtractOptionsCookiesAnyOfInner], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[CrawlPayloadExtractOptionsCookiesAnyOfInner]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlPayloadExtractOptionsCookies.model_construct() + error_messages = [] + # validate data type: List[CrawlPayloadExtractOptionsCookiesAnyOfInner] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadExtractOptionsCookies with anyOf schemas: List[CrawlPayloadExtractOptionsCookiesAnyOfInner], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into List[CrawlPayloadExtractOptionsCookiesAnyOfInner] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadExtractOptionsCookies with anyOf schemas: List[CrawlPayloadExtractOptionsCookiesAnyOfInner], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[CrawlPayloadExtractOptionsCookiesAnyOfInner], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner.py new file mode 100644 index 0000000..3566c84 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.crawl_payload_extract_options_cookies_any_of_inner_expires import CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires +from nimble_client.models.crawl_payload_extract_options_cookies_any_of_inner_max_age import CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlPayloadExtractOptionsCookiesAnyOfInner(BaseModel): + """ + CrawlPayloadExtractOptionsCookiesAnyOfInner + """ # noqa: E501 + creation: Optional[StrictStr] = None + domain: Optional[StrictStr] = None + expires: Optional[CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires] = None + extensions: Optional[List[StrictStr]] = None + host_only: Optional[StrictBool] = Field(default=None, alias="hostOnly") + http_only: Optional[StrictBool] = Field(default=None, alias="httpOnly") + last_accessed: Optional[StrictStr] = Field(default=None, alias="lastAccessed") + max_age: Optional[CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge] = Field(default=None, alias="maxAge") + name: Optional[StrictStr] = None + path: Optional[StrictStr] = None + path_is_default: Optional[StrictBool] = Field(default=None, alias="pathIsDefault") + same_site: Optional[StrictStr] = Field(default=None, alias="sameSite") + secure: Optional[StrictBool] = None + value: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["creation", "domain", "expires", "extensions", "hostOnly", "httpOnly", "lastAccessed", "maxAge", "name", "path", "pathIsDefault", "sameSite", "secure", "value"] + + @field_validator('same_site') + def same_site_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['strict', 'lax', 'none']): + raise ValueError("must be one of enum values ('strict', 'lax', 'none')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsCookiesAnyOfInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of expires + if self.expires: + _dict['expires'] = self.expires.to_dict() + # override the default output from pydantic by calling `to_dict()` of max_age + if self.max_age: + _dict['maxAge'] = self.max_age.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if creation (nullable) is None + # and model_fields_set contains the field + if self.creation is None and "creation" in self.model_fields_set: + _dict['creation'] = None + + # set to None if domain (nullable) is None + # and model_fields_set contains the field + if self.domain is None and "domain" in self.model_fields_set: + _dict['domain'] = None + + # set to None if extensions (nullable) is None + # and model_fields_set contains the field + if self.extensions is None and "extensions" in self.model_fields_set: + _dict['extensions'] = None + + # set to None if host_only (nullable) is None + # and model_fields_set contains the field + if self.host_only is None and "host_only" in self.model_fields_set: + _dict['hostOnly'] = None + + # set to None if http_only (nullable) is None + # and model_fields_set contains the field + if self.http_only is None and "http_only" in self.model_fields_set: + _dict['httpOnly'] = None + + # set to None if last_accessed (nullable) is None + # and model_fields_set contains the field + if self.last_accessed is None and "last_accessed" in self.model_fields_set: + _dict['lastAccessed'] = None + + # set to None if max_age (nullable) is None + # and model_fields_set contains the field + if self.max_age is None and "max_age" in self.model_fields_set: + _dict['maxAge'] = None + + # set to None if path (nullable) is None + # and model_fields_set contains the field + if self.path is None and "path" in self.model_fields_set: + _dict['path'] = None + + # set to None if path_is_default (nullable) is None + # and model_fields_set contains the field + if self.path_is_default is None and "path_is_default" in self.model_fields_set: + _dict['pathIsDefault'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsCookiesAnyOfInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "creation": obj.get("creation"), + "domain": obj.get("domain"), + "expires": CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires.from_dict(obj["expires"]) if obj.get("expires") is not None else None, + "extensions": obj.get("extensions"), + "hostOnly": obj.get("hostOnly"), + "httpOnly": obj.get("httpOnly"), + "lastAccessed": obj.get("lastAccessed"), + "maxAge": CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge.from_dict(obj["maxAge"]) if obj.get("maxAge") is not None else None, + "name": obj.get("name"), + "path": obj.get("path"), + "pathIsDefault": obj.get("pathIsDefault"), + "sameSite": obj.get("sameSite"), + "secure": obj.get("secure"), + "value": obj.get("value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_expires.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_expires.py new file mode 100644 index 0000000..55f3591 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_expires.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADEXTRACTOPTIONSCOOKIESANYOFINNEREXPIRES_ANY_OF_SCHEMAS = ["str"] + +class CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires(BaseModel): + """ + CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires with anyOf schemas: str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadExtractOptionsCookiesAnyOfInnerExpires with anyOf schemas: str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_max_age.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_max_age.py new file mode 100644 index 0000000..2f6534b --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_cookies_any_of_inner_max_age.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADEXTRACTOPTIONSCOOKIESANYOFINNERMAXAGE_ANY_OF_SCHEMAS = ["float", "str"] + +class CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge(BaseModel): + """ + CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge + """ + + # data type: float + anyof_schema_1_validator: Optional[Union[StrictFloat, StrictInt]] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + # data type: str + anyof_schema_3_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "float", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge.model_construct() + error_messages = [] + # validate data type: float + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge with anyOf schemas: float, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into float + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_3_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadExtractOptionsCookiesAnyOfInnerMaxAge with anyOf schemas: float, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_file_parsing_options.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_file_parsing_options.py new file mode 100644 index 0000000..8bb5f13 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_file_parsing_options.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlPayloadExtractOptionsFileParsingOptions(BaseModel): + """ + Parses PDF and Office documents into markdown. Enabling this adds a per-page-parsed charge on top of the base extract price, at a rate that depends on `mode` — see the pricing page. Billing is per page parsed, not per document. + """ # noqa: E501 + max_pages: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]] = Field(default=None, description="Maximum number of pages to parse. A PDF with more pages is rejected instead of being parsed, so it is never billed. Other formats (spreadsheets, presentations) are instead truncated to the first `max_pages` pages, and only those pages are parsed and billed.") + mode: Optional[StrictStr] = Field(default='light', description="`light`: fast, text-native extraction only, no OCR support. `pro`: adds LLM-based parsing with OCR fallback for scanned or complex PDFs. The two modes are billed at different per-page rates.") + __properties: ClassVar[List[str]] = ["max_pages", "mode"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['light', 'pro']): + raise ValueError("must be one of enum values ('light', 'pro')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsFileParsingOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsFileParsingOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "max_pages": obj.get("max_pages"), + "mode": obj.get("mode") if obj.get("mode") is not None else 'light' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_headers_value.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_headers_value.py new file mode 100644 index 0000000..c2f30a2 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_headers_value.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADEXTRACTOPTIONSHEADERSVALUE_ANY_OF_SCHEMAS = ["List[str]", "str"] + +class CrawlPayloadExtractOptionsHeadersValue(BaseModel): + """ + CrawlPayloadExtractOptionsHeadersValue + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: List[str] + anyof_schema_2_validator: Optional[List[StrictStr]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[List[str], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[str]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = CrawlPayloadExtractOptionsHeadersValue.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[str] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadExtractOptionsHeadersValue with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[str] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadExtractOptionsHeadersValue with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[str], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner.py new file mode 100644 index 0000000..5922e32 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.crawl_payload_extract_options_network_capture_inner_resource_type import CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType +from nimble_client.models.crawl_payload_extract_options_network_capture_inner_url import CrawlPayloadExtractOptionsNetworkCaptureInnerUrl +from nimble_client.models.extract200_response_data_network_capture_inner_filter_status_code import Extract200ResponseDataNetworkCaptureInnerFilterStatusCode +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlPayloadExtractOptionsNetworkCaptureInner(BaseModel): + """ + CrawlPayloadExtractOptionsNetworkCaptureInner + """ # noqa: E501 + method: Optional[StrictStr] = None + resource_type: Optional[CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType] = None + status_code: Optional[Extract200ResponseDataNetworkCaptureInnerFilterStatusCode] = None + url: Optional[CrawlPayloadExtractOptionsNetworkCaptureInnerUrl] = None + validation: Optional[StrictBool] = False + wait_for_requests_count: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = 0 + wait_for_requests_count_timeout: Optional[Union[Annotated[float, Field(le=300000, strict=True, gt=0)], Annotated[int, Field(le=300000, strict=True, gt=0)]]] = None + __properties: ClassVar[List[str]] = ["method", "resource_type", "status_code", "url", "validation", "wait_for_requests_count", "wait_for_requests_count_timeout"] + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH']): + raise ValueError("must be one of enum values ('GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsNetworkCaptureInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of resource_type + if self.resource_type: + _dict['resource_type'] = self.resource_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of status_code + if self.status_code: + _dict['status_code'] = self.status_code.to_dict() + # override the default output from pydantic by calling `to_dict()` of url + if self.url: + _dict['url'] = self.url.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsNetworkCaptureInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "method": obj.get("method"), + "resource_type": CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType.from_dict(obj["resource_type"]) if obj.get("resource_type") is not None else None, + "status_code": Extract200ResponseDataNetworkCaptureInnerFilterStatusCode.from_dict(obj["status_code"]) if obj.get("status_code") is not None else None, + "url": CrawlPayloadExtractOptionsNetworkCaptureInnerUrl.from_dict(obj["url"]) if obj.get("url") is not None else None, + "validation": obj.get("validation") if obj.get("validation") is not None else False, + "wait_for_requests_count": obj.get("wait_for_requests_count") if obj.get("wait_for_requests_count") is not None else 0, + "wait_for_requests_count_timeout": obj.get("wait_for_requests_count_timeout") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner_resource_type.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner_resource_type.py new file mode 100644 index 0000000..f603e37 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner_resource_type.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADEXTRACTOPTIONSNETWORKCAPTUREINNERRESOURCETYPE_ANY_OF_SCHEMAS = ["List[str]", "str"] + +class CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType(BaseModel): + """ + CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = Field(default=None, description="Resource type for network capture filtering") + # data type: List[str] + anyof_schema_2_validator: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[List[str], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[str]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[str] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[str] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadExtractOptionsNetworkCaptureInnerResourceType with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[str], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner_url.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner_url.py new file mode 100644 index 0000000..a2cf662 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_network_capture_inner_url.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlPayloadExtractOptionsNetworkCaptureInnerUrl(BaseModel): + """ + CrawlPayloadExtractOptionsNetworkCaptureInnerUrl + """ # noqa: E501 + type: Optional[StrictStr] = 'exact' + value: StrictStr + __properties: ClassVar[List[str]] = ["type", "value"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['exact', 'contains']): + raise ValueError("must be one of enum values ('exact', 'contains')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsNetworkCaptureInnerUrl from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsNetworkCaptureInnerUrl from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'exact', + "value": obj.get("value") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_parser.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_parser.py new file mode 100644 index 0000000..665714e --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_parser.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADEXTRACTOPTIONSPARSER_ANY_OF_SCHEMAS = ["Dict[str, Optional[object]]", "str"] + +class CrawlPayloadExtractOptionsParser(BaseModel): + """ + Custom parser configuration as a key-value map + """ + + # data type: Dict[str, Optional[object]] + anyof_schema_1_validator: Optional[Dict[str, Any]] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Dict[str, Optional[object]], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "Dict[str, Optional[object]]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlPayloadExtractOptionsParser.model_construct() + error_messages = [] + # validate data type: Dict[str, Optional[object]] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadExtractOptionsParser with anyOf schemas: Dict[str, Optional[object]], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into Dict[str, Optional[object]] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadExtractOptionsParser with anyOf schemas: Dict[str, Optional[object]], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, Optional[object]], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_render.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_render.py new file mode 100644 index 0000000..6e25697 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_render.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADEXTRACTOPTIONSRENDER_ANY_OF_SCHEMAS = ["bool", "str"] + +class CrawlPayloadExtractOptionsRender(BaseModel): + """ + Whether to render JavaScript content using a browser + """ + + # data type: bool + anyof_schema_1_validator: Optional[StrictBool] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "bool", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlPayloadExtractOptionsRender.model_construct() + error_messages = [] + # validate data type: bool + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadExtractOptionsRender with anyOf schemas: bool, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into bool + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadExtractOptionsRender with anyOf schemas: bool, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_session.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_session.py new file mode 100644 index 0000000..fe43be7 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_session.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CrawlPayloadExtractOptionsSession(BaseModel): + """ + CrawlPayloadExtractOptionsSession + """ # noqa: E501 + id: Optional[StrictStr] = None + prefetch_userbrowser: Optional[StrictBool] = False + renew_on_blocked: Optional[StrictBool] = False + retry: Optional[StrictBool] = False + timeout: Optional[Union[Annotated[float, Field(strict=True, gt=0)], Annotated[int, Field(strict=True, gt=0)]]] = None + __properties: ClassVar[List[str]] = ["id", "prefetch_userbrowser", "renew_on_blocked", "retry", "timeout"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsSession from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CrawlPayloadExtractOptionsSession from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "prefetch_userbrowser": obj.get("prefetch_userbrowser") if obj.get("prefetch_userbrowser") is not None else False, + "renew_on_blocked": obj.get("renew_on_blocked") if obj.get("renew_on_blocked") is not None else False, + "retry": obj.get("retry") if obj.get("retry") is not None else False, + "timeout": obj.get("timeout") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/crawl_payload_extract_options_skill.py b/candidate/generated/nimble_client/models/crawl_payload_extract_options_skill.py new file mode 100644 index 0000000..2f37bd5 --- /dev/null +++ b/candidate/generated/nimble_client/models/crawl_payload_extract_options_skill.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +CRAWLPAYLOADEXTRACTOPTIONSSKILL_ANY_OF_SCHEMAS = ["List[str]", "str"] + +class CrawlPayloadExtractOptionsSkill(BaseModel): + """ + CrawlPayloadExtractOptionsSkill + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = Field(default=None, description="Skills or capabilities required for the request") + # data type: List[str] + anyof_schema_2_validator: Optional[List[Optional[StrictStr]]] = Field(default=None, description="Skills or capabilities required for the request") + if TYPE_CHECKING: + actual_instance: Optional[Union[List[str], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[str]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = CrawlPayloadExtractOptionsSkill.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[str] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in CrawlPayloadExtractOptionsSkill with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[str] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into CrawlPayloadExtractOptionsSkill with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[str], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/create_extract_template_generation_request_public_v2.py b/candidate/generated/nimble_client/models/create_extract_template_generation_request_public_v2.py new file mode 100644 index 0000000..95fc5f2 --- /dev/null +++ b/candidate/generated/nimble_client/models/create_extract_template_generation_request_public_v2.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.create_extract_template_metadata_public_v2 import CreateExtractTemplateMetadataPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateExtractTemplateGenerationRequestPublicV2(BaseModel): + """ + CreateExtractTemplateGenerationRequestPublicV2 + """ # noqa: E501 + input_schema: Optional[Dict[str, Any]] = Field(default=None, description="Optional JSON schema describing expected input parameters.") + metadata: Optional[CreateExtractTemplateMetadataPublicV2] = Field(default=None, description="Metadata to attach to the generated extract template.") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="Optional stable name for the generated extract template.") + output_schema: Optional[Dict[str, Any]] = Field(default=None, description="Optional JSON schema describing desired extracted output.") + prompt: StrictStr = Field(description="Instructions for generating the extract template.") + url: StrictStr = Field(description="Example URL used to generate the extract template.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["input_schema", "metadata", "name", "output_schema", "prompt", "url"] + + @field_validator('name', mode="before") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if isinstance(value, str) and not re.match(r"^[a-z0-9_]+$", value): + raise ValueError(r"must validate the regular expression /^[a-z0-9_]+$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateExtractTemplateGenerationRequestPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateExtractTemplateGenerationRequestPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "input_schema": obj.get("input_schema"), + "metadata": CreateExtractTemplateMetadataPublicV2.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "output_schema": obj.get("output_schema"), + "prompt": obj.get("prompt"), + "url": obj.get("url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/create_extract_template_metadata_public_v2.py b/candidate/generated/nimble_client/models/create_extract_template_metadata_public_v2.py new file mode 100644 index 0000000..f7bd467 --- /dev/null +++ b/candidate/generated/nimble_client/models/create_extract_template_metadata_public_v2.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateExtractTemplateMetadataPublicV2(BaseModel): + """ + CreateExtractTemplateMetadataPublicV2 + """ # noqa: E501 + description: Optional[StrictStr] = Field(default=None, description="Description for the generated template.") + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly display name for the generated template.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Tags to associate with the generated template.") + __properties: ClassVar[List[str]] = ["description", "display_name", "tags"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateExtractTemplateMetadataPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateExtractTemplateMetadataPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/create_extract_template_refinement_request_public_v2.py b/candidate/generated/nimble_client/models/create_extract_template_refinement_request_public_v2.py new file mode 100644 index 0000000..02674a3 --- /dev/null +++ b/candidate/generated/nimble_client/models/create_extract_template_refinement_request_public_v2.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateExtractTemplateRefinementRequestPublicV2(BaseModel): + """ + CreateExtractTemplateRefinementRequestPublicV2 + """ # noqa: E501 + from_extract_template: StrictStr = Field(description="Name of the source extract template to refine.") + prompt: StrictStr = Field(description="Instructions for refining the extract template.") + __properties: ClassVar[List[str]] = ["from_extract_template", "prompt"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateExtractTemplateRefinementRequestPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateExtractTemplateRefinementRequestPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "from_extract_template": obj.get("from_extract_template"), + "prompt": obj.get("prompt") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/create_job_request_public_v1.py b/candidate/generated/nimble_client/models/create_job_request_public_v1.py new file mode 100644 index 0000000..a379bb4 --- /dev/null +++ b/candidate/generated/nimble_client/models/create_job_request_public_v1.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.job_destination_public_v1 import JobDestinationPublicV1 +from nimble_client.models.job_inputs_public_v1 import JobInputsPublicV1 +from nimble_client.models.job_schedule_public_v1 import JobSchedulePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateJobRequestPublicV1(BaseModel): + """ + Payload to create a new job. + """ # noqa: E501 + agent_name: StrictStr = Field(description="Name of the agent to run.") + description: Optional[StrictStr] = Field(default=None, description="Free-text description of the job.") + destination: Optional[JobDestinationPublicV1] = Field(default=None, description="Where the job writes its results.") + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly job name shown in the UI.") + inputs: Optional[JobInputsPublicV1] = Field(default=None, description="Input data configuration for the job.") + name: StrictStr = Field(description="Job name.") + schedule: Optional[JobSchedulePublicV1] = Field(default=None, description="Cron schedule controlling automatic runs.") + __properties: ClassVar[List[str]] = ["agent_name", "description", "destination", "display_name", "inputs", "name", "schedule"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateJobRequestPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of destination + if self.destination: + _dict['destination'] = self.destination.to_dict() + # override the default output from pydantic by calling `to_dict()` of inputs + if self.inputs: + _dict['inputs'] = self.inputs.to_dict() + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if destination (nullable) is None + # and model_fields_set contains the field + if self.destination is None and "destination" in self.model_fields_set: + _dict['destination'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if inputs (nullable) is None + # and model_fields_set contains the field + if self.inputs is None and "inputs" in self.model_fields_set: + _dict['inputs'] = None + + # set to None if schedule (nullable) is None + # and model_fields_set contains the field + if self.schedule is None and "schedule" in self.model_fields_set: + _dict['schedule'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateJobRequestPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "description": obj.get("description"), + "destination": JobDestinationPublicV1.from_dict(obj["destination"]) if obj.get("destination") is not None else None, + "display_name": obj.get("display_name"), + "inputs": JobInputsPublicV1.from_dict(obj["inputs"]) if obj.get("inputs") is not None else None, + "name": obj.get("name"), + "schedule": JobSchedulePublicV1.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/create_job_request_public_v2.py b/candidate/generated/nimble_client/models/create_job_request_public_v2.py new file mode 100644 index 0000000..f3db26e --- /dev/null +++ b/candidate/generated/nimble_client/models/create_job_request_public_v2.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.job_destination_public_v2 import JobDestinationPublicV2 +from nimble_client.models.job_inputs_public_v2 import JobInputsPublicV2 +from nimble_client.models.job_schedule_public_v2 import JobSchedulePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateJobRequestPublicV2(BaseModel): + """ + Payload to create a new job. + """ # noqa: E501 + description: Optional[StrictStr] = Field(default=None, description="Free-text description of the job.") + destination: Optional[JobDestinationPublicV2] = Field(default=None, description="Where the job writes its results.") + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly job name shown in the UI.") + extract_template_name: StrictStr = Field(description="Name of the extract template to run.") + inputs: Optional[JobInputsPublicV2] = Field(default=None, description="Input data configuration for the job.") + name: StrictStr = Field(description="Job name.") + schedule: Optional[JobSchedulePublicV2] = Field(default=None, description="Cron schedule controlling automatic runs.") + __properties: ClassVar[List[str]] = ["description", "destination", "display_name", "extract_template_name", "inputs", "name", "schedule"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateJobRequestPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of destination + if self.destination: + _dict['destination'] = self.destination.to_dict() + # override the default output from pydantic by calling `to_dict()` of inputs + if self.inputs: + _dict['inputs'] = self.inputs.to_dict() + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if destination (nullable) is None + # and model_fields_set contains the field + if self.destination is None and "destination" in self.model_fields_set: + _dict['destination'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if inputs (nullable) is None + # and model_fields_set contains the field + if self.inputs is None and "inputs" in self.model_fields_set: + _dict['inputs'] = None + + # set to None if schedule (nullable) is None + # and model_fields_set contains the field + if self.schedule is None and "schedule" in self.model_fields_set: + _dict['schedule'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateJobRequestPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "destination": JobDestinationPublicV2.from_dict(obj["destination"]) if obj.get("destination") is not None else None, + "display_name": obj.get("display_name"), + "extract_template_name": obj.get("extract_template_name"), + "inputs": JobInputsPublicV2.from_dict(obj["inputs"]) if obj.get("inputs") is not None else None, + "name": obj.get("name"), + "schedule": JobSchedulePublicV2.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/create_template_generation_request_public_v1.py b/candidate/generated/nimble_client/models/create_template_generation_request_public_v1.py new file mode 100644 index 0000000..d9d2b1e --- /dev/null +++ b/candidate/generated/nimble_client/models/create_template_generation_request_public_v1.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.create_template_metadata_public_v1 import CreateTemplateMetadataPublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateTemplateGenerationRequestPublicV1(BaseModel): + """ + CreateTemplateGenerationRequestPublicV1 + """ # noqa: E501 + input_schema: Optional[Dict[str, Any]] = None + metadata: Optional[CreateTemplateMetadataPublicV1] = None + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + output_schema: Optional[Dict[str, Any]] = None + prompt: StrictStr + url: StrictStr + __properties: ClassVar[List[str]] = ["input_schema", "metadata", "name", "output_schema", "prompt", "url"] + + @field_validator('name', mode="before") + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if isinstance(value, str) and not re.match(r"^[a-z0-9_]+$", value): + raise ValueError(r"must validate the regular expression /^[a-z0-9_]+$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateTemplateGenerationRequestPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateTemplateGenerationRequestPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "input_schema": obj.get("input_schema"), + "metadata": CreateTemplateMetadataPublicV1.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "output_schema": obj.get("output_schema"), + "prompt": obj.get("prompt"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/create_template_metadata_public_v1.py b/candidate/generated/nimble_client/models/create_template_metadata_public_v1.py new file mode 100644 index 0000000..a94fc76 --- /dev/null +++ b/candidate/generated/nimble_client/models/create_template_metadata_public_v1.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateTemplateMetadataPublicV1(BaseModel): + """ + CreateTemplateMetadataPublicV1 + """ # noqa: E501 + description: Optional[StrictStr] = None + display_name: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["description", "display_name", "tags"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateTemplateMetadataPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateTemplateMetadataPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/create_template_refinement_request_public_v1.py b/candidate/generated/nimble_client/models/create_template_refinement_request_public_v1.py new file mode 100644 index 0000000..fa422c7 --- /dev/null +++ b/candidate/generated/nimble_client/models/create_template_refinement_request_public_v1.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateTemplateRefinementRequestPublicV1(BaseModel): + """ + CreateTemplateRefinementRequestPublicV1 + """ # noqa: E501 + from_agent: StrictStr + prompt: StrictStr + __properties: ClassVar[List[str]] = ["from_agent", "prompt"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateTemplateRefinementRequestPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateTemplateRefinementRequestPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "from_agent": obj.get("from_agent"), + "prompt": obj.get("prompt") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/default.py b/candidate/generated/nimble_client/models/default.py new file mode 100644 index 0000000..a711c9f --- /dev/null +++ b/candidate/generated/nimble_client/models/default.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +DEFAULT_ANY_OF_SCHEMAS = ["bool", "float", "int", "str"] + +class Default(BaseModel): + """ + Default + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: bool + anyof_schema_2_validator: Optional[StrictBool] = None + # data type: int + anyof_schema_3_validator: Optional[StrictInt] = None + # data type: float + anyof_schema_4_validator: Optional[Union[StrictFloat, StrictInt]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, float, int, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "bool", "float", "int", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = Default.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: bool + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: int + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.anyof_schema_4_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Default with anyOf schemas: bool, float, int, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into bool + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into int + try: + # validation + instance.anyof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_3_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.anyof_schema_4_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_4_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Default with anyOf schemas: bool, float, int, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, float, int, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/delete_crawl200_response.py b/candidate/generated/nimble_client/models/delete_crawl200_response.py new file mode 100644 index 0000000..e800496 --- /dev/null +++ b/candidate/generated/nimble_client/models/delete_crawl200_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DeleteCrawl200Response(BaseModel): + """ + DeleteCrawl200Response + """ # noqa: E501 + status: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['canceled']): + raise ValueError("must be one of enum values ('canceled')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DeleteCrawl200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeleteCrawl200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/driver_resolution_response.py b/candidate/generated/nimble_client/models/driver_resolution_response.py new file mode 100644 index 0000000..4e949e9 --- /dev/null +++ b/candidate/generated/nimble_client/models/driver_resolution_response.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DriverResolutionResponse(BaseModel): + """ + DriverResolutionResponse + """ # noqa: E501 + agent: Optional[StrictStr] = Field(default=None, description="The input agent name (present when agent query param was used)") + antibots: List[StrictStr] = Field(description="List of detected antibots for the domain") + description: StrictStr = Field(description="Description of the driver") + driver: StrictStr = Field(description="Resolved driver name") + need_to_render: Optional[StrictBool] = Field(default=None, description="Whether the page needs to be rendered to be properly resolved.") + url: Optional[StrictStr] = Field(default=None, description="The input URL (present when url query param was used)") + __properties: ClassVar[List[str]] = ["agent", "antibots", "description", "driver", "need_to_render", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DriverResolutionResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DriverResolutionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent": obj.get("agent"), + "antibots": obj.get("antibots"), + "description": obj.get("description"), + "driver": obj.get("driver"), + "need_to_render": obj.get("need_to_render"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/duration.py b/candidate/generated/nimble_client/models/duration.py new file mode 100644 index 0000000..0ed15af --- /dev/null +++ b/candidate/generated/nimble_client/models/duration.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional, Union +from typing_extensions import Annotated +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +DURATION_ONE_OF_SCHEMAS = ["float", "str"] + +class Duration(BaseModel): + """ + Duration value that accepts various formats. Supports: number (ms), string (\"1000\"), or string with unit (\"2s\", \"500ms\", \"2m\", \"1h\") + """ + # data type: float + oneof_schema_1_validator: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = None + # data type: str + oneof_schema_2_validator: Optional[StrictStr] = None + actual_instance: Optional[Union[float, str]] = None + one_of_schemas: Set[str] = { "float", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = Duration.model_construct() + error_messages = [] + match = 0 + # validate data type: float + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in Duration with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in Duration with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into float + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into Duration with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into Duration with oneOf schemas: float, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/effort.py b/candidate/generated/nimble_client/models/effort.py new file mode 100644 index 0000000..42052e6 --- /dev/null +++ b/candidate/generated/nimble_client/models/effort.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class Effort(str, Enum): + """ + Canonical effort tier names for the research graph. + """ + + """ + allowed enum values + """ + LOW = 'low' + MEDIUM = 'medium' + HIGH = 'high' + X_MINUS_HIGH = 'x-high' + CUSTOM = 'custom' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Effort from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/eval_action.py b/candidate/generated/nimble_client/models/eval_action.py new file mode 100644 index 0000000..ffca86b --- /dev/null +++ b/candidate/generated/nimble_client/models/eval_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.eval_action_eval import EvalActionEval +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EvalAction(BaseModel): + """ + Execute JavaScript code in page context + """ # noqa: E501 + eval: EvalActionEval + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["eval"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EvalAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of eval + if self.eval: + _dict['eval'] = self.eval.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EvalAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "eval": EvalActionEval.from_dict(obj["eval"]) if obj.get("eval") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/eval_action_eval.py b/candidate/generated/nimble_client/models/eval_action_eval.py new file mode 100644 index 0000000..a42f589 --- /dev/null +++ b/candidate/generated/nimble_client/models/eval_action_eval.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.eval_action_eval_one_of import EvalActionEvalOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +EVALACTIONEVAL_ONE_OF_SCHEMAS = ["EvalActionEvalOneOf", "str"] + +class EvalActionEval(BaseModel): + """ + EvalActionEval + """ + # data type: str + oneof_schema_1_validator: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + # data type: EvalActionEvalOneOf + oneof_schema_2_validator: Optional[EvalActionEvalOneOf] = None + actual_instance: Optional[Union[EvalActionEvalOneOf, str]] = None + one_of_schemas: Set[str] = { "EvalActionEvalOneOf", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EvalActionEval.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: EvalActionEvalOneOf + if not isinstance(v, EvalActionEvalOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `EvalActionEvalOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EvalActionEval with oneOf schemas: EvalActionEvalOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EvalActionEval with oneOf schemas: EvalActionEvalOneOf, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into str + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EvalActionEvalOneOf + try: + instance.actual_instance = EvalActionEvalOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into EvalActionEval with oneOf schemas: EvalActionEvalOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EvalActionEval with oneOf schemas: EvalActionEvalOneOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], EvalActionEvalOneOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/eval_action_eval_one_of.py b/candidate/generated/nimble_client/models/eval_action_eval_one_of.py new file mode 100644 index 0000000..28c5821 --- /dev/null +++ b/candidate/generated/nimble_client/models/eval_action_eval_one_of.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EvalActionEvalOneOf(BaseModel): + """ + EvalActionEvalOneOf + """ # noqa: E501 + code: Annotated[str, Field(min_length=1, strict=True)] + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=15000, description="Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.") + __properties: ClassVar[List[str]] = ["code", "required", "skip", "timeout"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EvalActionEvalOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EvalActionEvalOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "timeout": obj.get("timeout") if obj.get("timeout") is not None else 15000 + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response.py b/candidate/generated/nimble_client/models/extract200_response.py new file mode 100644 index 0000000..109c11d --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from nimble_client.models.extract200_response_data import Extract200ResponseData +from nimble_client.models.extract200_response_debug import Extract200ResponseDebug +from nimble_client.models.extract200_response_metadata import Extract200ResponseMetadata +from nimble_client.models.extract200_response_pagination import Extract200ResponsePagination +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200Response(BaseModel): + """ + Extract200Response + """ # noqa: E501 + data: Extract200ResponseData + debug: Optional[Extract200ResponseDebug] = None + metadata: Extract200ResponseMetadata + pagination: Optional[Extract200ResponsePagination] = None + status: StrictStr = Field(description="The status of the task.") + status_code: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The HTTP status code of the task.") + task_id: StrictStr = Field(description="Unique identifier for the task.") + url: StrictStr = Field(description="The final URL.") + warnings: Optional[List[Optional[StrictStr]]] = Field(default=None, description="List of warnings generated during the task.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data", "debug", "metadata", "pagination", "status", "status_code", "task_id", "url", "warnings"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'skipped', 'fatal', 'error', 'postponed', 'ignored', 'rejected', 'blocked']): + raise ValueError("must be one of enum values ('success', 'skipped', 'fatal', 'error', 'postponed', 'ignored', 'rejected', 'blocked')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # override the default output from pydantic by calling `to_dict()` of debug + if self.debug: + _dict['debug'] = self.debug.to_dict() + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": Extract200ResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None, + "debug": Extract200ResponseDebug.from_dict(obj["debug"]) if obj.get("debug") is not None else None, + "metadata": Extract200ResponseMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "pagination": Extract200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "status": obj.get("status"), + "status_code": obj.get("status_code"), + "task_id": obj.get("task_id"), + "url": obj.get("url"), + "warnings": obj.get("warnings") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data.py b/candidate/generated/nimble_client/models/extract200_response_data.py new file mode 100644 index 0000000..1ea39fe --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.extract200_response_data_browser_actions import Extract200ResponseDataBrowserActions +from nimble_client.models.extract200_response_data_network_capture_inner import Extract200ResponseDataNetworkCaptureInner +from nimble_client.models.extract200_response_data_parsing import Extract200ResponseDataParsing +from nimble_client.models.extract200_response_data_redirects_inner import Extract200ResponseDataRedirectsInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseData(BaseModel): + """ + Extract200ResponseData + """ # noqa: E501 + browser_actions: Optional[Extract200ResponseDataBrowserActions] = None + cookies: Optional[List[Any]] = Field(default=None, description="The cookies collected from browser actions during the task.") + eval: Optional[List[Any]] = Field(default=None, description="The evaluation results from browser actions during the task.") + fetch: Optional[List[Any]] = Field(default=None, description="The http requests from browser actions made during the task.") + headers: Optional[Dict[str, Optional[StrictStr]]] = Field(default=None, description="The headers received during the task.") + html: Optional[StrictStr] = Field(default=None, description="The HTML content of the page.") + links: Optional[List[Optional[StrictStr]]] = Field(default=None, description="List of all unique URLs found on the page.") + markdown: Optional[StrictStr] = Field(default=None, description="The Markdown version of the HTML content.") + network_capture: Optional[List[Extract200ResponseDataNetworkCaptureInner]] = Field(default=None, description="The network capture data collected during the task.") + pages_html: Optional[List[Optional[StrictStr]]] = Field(default=None, description="Individual HTML content of each pagination page, before merging.") + parsing: Optional[Extract200ResponseDataParsing] = None + redirects: Optional[List[Extract200ResponseDataRedirectsInner]] = Field(default=None, description="The list of redirects that occurred during the task.") + screenshots: Optional[List[Any]] = Field(default=None, description="Screenshots taken during the task, from browser actions, or the screenshot format.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["browser_actions", "cookies", "eval", "fetch", "headers", "html", "links", "markdown", "network_capture", "pages_html", "parsing", "redirects", "screenshots"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "network_capture", + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser_actions + if self.browser_actions: + _dict['browser_actions'] = self.browser_actions.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in network_capture (list) + _items = [] + if self.network_capture: + for _item_network_capture in self.network_capture: + _items.append(_item_network_capture.to_dict() if _item_network_capture is not None else None) + _dict['network_capture'] = _items + # override the default output from pydantic by calling `to_dict()` of parsing + if self.parsing: + _dict['parsing'] = self.parsing.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in redirects (list) + _items = [] + if self.redirects: + for _item_redirects in self.redirects: + _items.append(_item_redirects.to_dict() if _item_redirects is not None else None) + _dict['redirects'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "browser_actions": Extract200ResponseDataBrowserActions.from_dict(obj["browser_actions"]) if obj.get("browser_actions") is not None else None, + "cookies": obj.get("cookies"), + "eval": obj.get("eval"), + "fetch": obj.get("fetch"), + "headers": obj.get("headers"), + "html": obj.get("html"), + "links": obj.get("links"), + "markdown": obj.get("markdown"), + "network_capture": [Extract200ResponseDataNetworkCaptureInner.from_dict(_item) for _item in obj["network_capture"]] if obj.get("network_capture") is not None else None, + "pages_html": obj.get("pages_html"), + "parsing": Extract200ResponseDataParsing.from_dict(obj["parsing"]) if obj.get("parsing") is not None else None, + "redirects": [Extract200ResponseDataRedirectsInner.from_dict(_item) for _item in obj["redirects"]] if obj.get("redirects") is not None else None, + "screenshots": obj.get("screenshots") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_browser_actions.py b/candidate/generated/nimble_client/models/extract200_response_data_browser_actions.py new file mode 100644 index 0000000..153f305 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_browser_actions.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from nimble_client.models.extract200_response_data_browser_actions_results_inner import Extract200ResponseDataBrowserActionsResultsInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDataBrowserActions(BaseModel): + """ + Browser actions execution results. Present only when browser_actions were specified in the request. + """ # noqa: E501 + results: List[Extract200ResponseDataBrowserActionsResultsInner] + success: StrictBool + total_duration: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["results", "success", "total_duration"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDataBrowserActions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "results", + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + _items.append(_item_results.to_dict() if _item_results is not None else None) + _dict['results'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDataBrowserActions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [Extract200ResponseDataBrowserActionsResultsInner.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "success": obj.get("success"), + "total_duration": obj.get("total_duration") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_browser_actions_results_inner.py b/candidate/generated/nimble_client/models/extract200_response_data_browser_actions_results_inner.py new file mode 100644 index 0000000..e0eec66 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_browser_actions_results_inner.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDataBrowserActionsResultsInner(BaseModel): + """ + Extract200ResponseDataBrowserActionsResultsInner + """ # noqa: E501 + duration: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] + error: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + name: StrictStr + result: Optional[Any] = None + status: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["duration", "error", "name", "result", "status"] + + @field_validator('name') + def name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['goto', 'wait', 'wait_for_element', 'wait_for_navigation', 'click', 'fill', 'press', 'scroll', 'auto_scroll', 'screenshot', 'get_cookies', 'eval', 'fetch']): + raise ValueError("must be one of enum values ('goto', 'wait', 'wait_for_element', 'wait_for_navigation', 'click', 'fill', 'press', 'scroll', 'auto_scroll', 'screenshot', 'get_cookies', 'eval', 'fetch')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['no-run', 'in-progress', 'done', 'error', 'skipped']): + raise ValueError("must be one of enum values ('no-run', 'in-progress', 'done', 'error', 'skipped')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDataBrowserActionsResultsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if result (nullable) is None + # and model_fields_set contains the field + if self.result is None and "result" in self.model_fields_set: + _dict['result'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDataBrowserActionsResultsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "duration": obj.get("duration"), + "error": obj.get("error"), + "name": obj.get("name"), + "result": obj.get("result"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner.py b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner.py new file mode 100644 index 0000000..df72472 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.extract200_response_data_network_capture_inner_filter import Extract200ResponseDataNetworkCaptureInnerFilter +from nimble_client.models.extract200_response_data_network_capture_inner_results_inner import Extract200ResponseDataNetworkCaptureInnerResultsInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDataNetworkCaptureInner(BaseModel): + """ + Extract200ResponseDataNetworkCaptureInner + """ # noqa: E501 + error_message: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.", alias="errorMessage") + filter: Extract200ResponseDataNetworkCaptureInnerFilter + results: List[Extract200ResponseDataNetworkCaptureInnerResultsInner] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["errorMessage", "filter", "results"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of filter + if self.filter: + _dict['filter'] = self.filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + _items.append(_item_results.to_dict() if _item_results is not None else None) + _dict['results'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if error_message (nullable) is None + # and model_fields_set contains the field + if self.error_message is None and "error_message" in self.model_fields_set: + _dict['errorMessage'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "errorMessage": obj.get("errorMessage"), + "filter": Extract200ResponseDataNetworkCaptureInnerFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None, + "results": [Extract200ResponseDataNetworkCaptureInnerResultsInner.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter.py b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter.py new file mode 100644 index 0000000..5f97e31 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.extract200_response_data_network_capture_inner_filter_resource_type import Extract200ResponseDataNetworkCaptureInnerFilterResourceType +from nimble_client.models.extract200_response_data_network_capture_inner_filter_status_code import Extract200ResponseDataNetworkCaptureInnerFilterStatusCode +from nimble_client.models.extract200_response_data_network_capture_inner_filter_url import Extract200ResponseDataNetworkCaptureInnerFilterUrl +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDataNetworkCaptureInnerFilter(BaseModel): + """ + Extract200ResponseDataNetworkCaptureInnerFilter + """ # noqa: E501 + method: Optional[StrictStr] = None + resource_type: Optional[Extract200ResponseDataNetworkCaptureInnerFilterResourceType] = None + status_code: Optional[Extract200ResponseDataNetworkCaptureInnerFilterStatusCode] = None + url: Optional[Extract200ResponseDataNetworkCaptureInnerFilterUrl] = None + validation: StrictBool + wait_for_requests_count: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] + wait_for_requests_count_timeout: Optional[Union[Annotated[float, Field(le=300000, strict=True, gt=0)], Annotated[int, Field(le=300000, strict=True, gt=0)]]] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["method", "resource_type", "status_code", "url", "validation", "wait_for_requests_count", "wait_for_requests_count_timeout"] + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH']): + raise ValueError("must be one of enum values ('GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of resource_type + if self.resource_type: + _dict['resource_type'] = self.resource_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of status_code + if self.status_code: + _dict['status_code'] = self.status_code.to_dict() + # override the default output from pydantic by calling `to_dict()` of url + if self.url: + _dict['url'] = self.url.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "method": obj.get("method"), + "resource_type": Extract200ResponseDataNetworkCaptureInnerFilterResourceType.from_dict(obj["resource_type"]) if obj.get("resource_type") is not None else None, + "status_code": Extract200ResponseDataNetworkCaptureInnerFilterStatusCode.from_dict(obj["status_code"]) if obj.get("status_code") is not None else None, + "url": Extract200ResponseDataNetworkCaptureInnerFilterUrl.from_dict(obj["url"]) if obj.get("url") is not None else None, + "validation": obj.get("validation") if obj.get("validation") is not None else False, + "wait_for_requests_count": obj.get("wait_for_requests_count") if obj.get("wait_for_requests_count") is not None else 0, + "wait_for_requests_count_timeout": obj.get("wait_for_requests_count_timeout") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_resource_type.py b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_resource_type.py new file mode 100644 index 0000000..243a6d0 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_resource_type.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from nimble_client.models.sdk_string_variant7a06ddd6b0fd import SdkStringVariant7a06ddd6b0fd +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +EXTRACT200RESPONSEDATANETWORKCAPTUREINNERFILTERRESOURCETYPE_ANY_OF_SCHEMAS = ["List[SdkStringVariant7a06ddd6b0fd]", "SdkStringVariant7a06ddd6b0fd"] + +class Extract200ResponseDataNetworkCaptureInnerFilterResourceType(BaseModel): + """ + Extract200ResponseDataNetworkCaptureInnerFilterResourceType + """ + + # data type: SdkStringVariant7a06ddd6b0fd + anyof_schema_1_validator: Optional[SdkStringVariant7a06ddd6b0fd] = None + # data type: List[SdkStringVariant7a06ddd6b0fd] + anyof_schema_2_validator: Optional[Annotated[List[SdkStringVariant7a06ddd6b0fd], Field(min_length=1)]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[List[SdkStringVariant7a06ddd6b0fd], SdkStringVariant7a06ddd6b0fd]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[SdkStringVariant7a06ddd6b0fd]", "SdkStringVariant7a06ddd6b0fd" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Extract200ResponseDataNetworkCaptureInnerFilterResourceType.model_construct() + error_messages = [] + # validate data type: SdkStringVariant7a06ddd6b0fd + if not isinstance(v, SdkStringVariant7a06ddd6b0fd): + error_messages.append(f"Error! Input type `{type(v)}` is not `SdkStringVariant7a06ddd6b0fd`") + else: + return v + + # validate data type: List[SdkStringVariant7a06ddd6b0fd] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Extract200ResponseDataNetworkCaptureInnerFilterResourceType with anyOf schemas: List[SdkStringVariant7a06ddd6b0fd], SdkStringVariant7a06ddd6b0fd. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[SdkStringVariant7a06ddd6b0fd] = None + try: + instance.actual_instance = SdkStringVariant7a06ddd6b0fd.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[SdkStringVariant7a06ddd6b0fd] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Extract200ResponseDataNetworkCaptureInnerFilterResourceType with anyOf schemas: List[SdkStringVariant7a06ddd6b0fd], SdkStringVariant7a06ddd6b0fd. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[SdkStringVariant7a06ddd6b0fd], SdkStringVariant7a06ddd6b0fd]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_status_code.py b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_status_code.py new file mode 100644 index 0000000..4c19f6a --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_status_code.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional, Union +from typing_extensions import Annotated +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +EXTRACT200RESPONSEDATANETWORKCAPTUREINNERFILTERSTATUSCODE_ANY_OF_SCHEMAS = ["List[float]", "float"] + +class Extract200ResponseDataNetworkCaptureInnerFilterStatusCode(BaseModel): + """ + Extract200ResponseDataNetworkCaptureInnerFilterStatusCode + """ + + # data type: float + anyof_schema_1_validator: Optional[Union[Annotated[float, Field(le=599, strict=True, ge=100)], Annotated[int, Field(le=599, strict=True, ge=100)]]] = None + # data type: List[float] + anyof_schema_2_validator: Optional[Annotated[List[Union[Annotated[float, Field(le=599, strict=True, ge=100)], Annotated[int, Field(le=599, strict=True, ge=100)]]], Field(min_length=1)]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[List[float], float]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[float]", "float" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Extract200ResponseDataNetworkCaptureInnerFilterStatusCode.model_construct() + error_messages = [] + # validate data type: float + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[float] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Extract200ResponseDataNetworkCaptureInnerFilterStatusCode with anyOf schemas: List[float], float. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into float + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[float] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Extract200ResponseDataNetworkCaptureInnerFilterStatusCode with anyOf schemas: List[float], float. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[float], float]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_url.py b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_url.py new file mode 100644 index 0000000..efed63e --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_filter_url.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDataNetworkCaptureInnerFilterUrl(BaseModel): + """ + Extract200ResponseDataNetworkCaptureInnerFilterUrl + """ # noqa: E501 + type: StrictStr + value: Optional[StrictStr] = Field(description="Cursor for pagination.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "value"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['exact', 'contains']): + raise ValueError("must be one of enum values ('exact', 'contains')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerFilterUrl from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['value'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerFilterUrl from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'exact', + "value": obj.get("value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner.py b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner.py new file mode 100644 index 0000000..f3c0685 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.extract200_response_data_network_capture_inner_results_inner_request import Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest +from nimble_client.models.extract200_response_data_network_capture_inner_results_inner_response import Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDataNetworkCaptureInnerResultsInner(BaseModel): + """ + Extract200ResponseDataNetworkCaptureInnerResultsInner + """ # noqa: E501 + request: Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest + response: Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["request", "response"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerResultsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of request + if self.request: + _dict['request'] = self.request.to_dict() + # override the default output from pydantic by calling `to_dict()` of response + if self.response: + _dict['response'] = self.response.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerResultsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "request": Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest.from_dict(obj["request"]) if obj.get("request") is not None else None, + "response": Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse.from_dict(obj["response"]) if obj.get("response") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner_request.py b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner_request.py new file mode 100644 index 0000000..3458cea --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner_request.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest(BaseModel): + """ + Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest + """ # noqa: E501 + body: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + headers: Dict[str, StrictStr] + method: Optional[StrictStr] = Field(description="Cursor for pagination.") + resource_type: StrictStr = Field(description="Resource type for network capture filtering") + url: Optional[StrictStr] = Field(description="Cursor for pagination.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["body", "headers", "method", "resource_type", "url"] + + @field_validator('resource_type') + def resource_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['document', 'stylesheet', 'image', 'media', 'font', 'script', 'texttrack', 'xhr', 'fetch', 'prefetch', 'eventsource', 'websocket', 'manifest', 'signedexchange', 'ping', 'cspviolationreport', 'preflight', 'other', 'fedcm']): + raise ValueError("must be one of enum values ('document', 'stylesheet', 'image', 'media', 'font', 'script', 'texttrack', 'xhr', 'fetch', 'prefetch', 'eventsource', 'websocket', 'manifest', 'signedexchange', 'ping', 'cspviolationreport', 'preflight', 'other', 'fedcm')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if body (nullable) is None + # and model_fields_set contains the field + if self.body is None and "body" in self.model_fields_set: + _dict['body'] = None + + # set to None if method (nullable) is None + # and model_fields_set contains the field + if self.method is None and "method" in self.model_fields_set: + _dict['method'] = None + + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerResultsInnerRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "body": obj.get("body"), + "headers": obj.get("headers"), + "method": obj.get("method"), + "resource_type": obj.get("resource_type"), + "url": obj.get("url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner_response.py b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner_response.py new file mode 100644 index 0000000..403aa9b --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_network_capture_inner_results_inner_response.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse(BaseModel): + """ + Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse + """ # noqa: E501 + body: Optional[StrictStr] = Field(description="Cursor for pagination.") + headers: Dict[str, StrictStr] + serialization: StrictStr + status: Union[StrictFloat, StrictInt] + status_text: Optional[StrictStr] = Field(description="Cursor for pagination.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["body", "headers", "serialization", "status", "status_text"] + + @field_validator('serialization') + def serialization_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['none', 'base64']): + raise ValueError("must be one of enum values ('none', 'base64')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if body (nullable) is None + # and model_fields_set contains the field + if self.body is None and "body" in self.model_fields_set: + _dict['body'] = None + + # set to None if status_text (nullable) is None + # and model_fields_set contains the field + if self.status_text is None and "status_text" in self.model_fields_set: + _dict['status_text'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDataNetworkCaptureInnerResultsInnerResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "body": obj.get("body"), + "headers": obj.get("headers"), + "serialization": obj.get("serialization"), + "status": obj.get("status"), + "status_text": obj.get("status_text") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_parsing.py b/candidate/generated/nimble_client/models/extract200_response_data_parsing.py new file mode 100644 index 0000000..db05668 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_parsing.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, Optional +from nimble_client.models.parsing_error_result import ParsingErrorResult +from nimble_client.models.parsing_success_result import ParsingSuccessResult +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +EXTRACT200RESPONSEDATAPARSING_ANY_OF_SCHEMAS = ["Dict[str, Optional[object]]", "ParsingErrorResult", "ParsingSuccessResult"] + +class Extract200ResponseDataParsing(BaseModel): + """ + The parsing results extracted from the HTML & network content. + """ + + # data type: ParsingSuccessResult + anyof_schema_1_validator: Optional[ParsingSuccessResult] = None + # data type: ParsingErrorResult + anyof_schema_2_validator: Optional[ParsingErrorResult] = None + # data type: Dict[str, Optional[object]] + anyof_schema_3_validator: Optional[Dict[str, Any]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Dict[str, Optional[object]], ParsingErrorResult, ParsingSuccessResult]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "Dict[str, Optional[object]]", "ParsingErrorResult", "ParsingSuccessResult" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Extract200ResponseDataParsing.model_construct() + error_messages = [] + # validate data type: ParsingSuccessResult + if not isinstance(v, ParsingSuccessResult): + error_messages.append(f"Error! Input type `{type(v)}` is not `ParsingSuccessResult`") + else: + return v + + # validate data type: ParsingErrorResult + if not isinstance(v, ParsingErrorResult): + error_messages.append(f"Error! Input type `{type(v)}` is not `ParsingErrorResult`") + else: + return v + + # validate data type: Dict[str, Optional[object]] + try: + instance.anyof_schema_3_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Extract200ResponseDataParsing with anyOf schemas: Dict[str, Optional[object]], ParsingErrorResult, ParsingSuccessResult. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[ParsingSuccessResult] = None + try: + instance.actual_instance = ParsingSuccessResult.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[ParsingErrorResult] = None + try: + instance.actual_instance = ParsingErrorResult.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into Dict[str, Optional[object]] + try: + # validation + instance.anyof_schema_3_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_3_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Extract200ResponseDataParsing with anyOf schemas: Dict[str, Optional[object]], ParsingErrorResult, ParsingSuccessResult. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, Optional[object]], ParsingErrorResult, ParsingSuccessResult]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/extract200_response_data_redirects_inner.py b/candidate/generated/nimble_client/models/extract200_response_data_redirects_inner.py new file mode 100644 index 0000000..2238df8 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_data_redirects_inner.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDataRedirectsInner(BaseModel): + """ + Extract200ResponseDataRedirectsInner + """ # noqa: E501 + status_code: Union[Annotated[float, Field(le=599, strict=True, ge=100)], Annotated[int, Field(le=599, strict=True, ge=100)]] + url: Optional[StrictStr] = Field(description="Cursor for pagination.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["status_code", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDataRedirectsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDataRedirectsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status_code": obj.get("status_code"), + "url": obj.get("url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_debug.py b/candidate/generated/nimble_client/models/extract200_response_debug.py new file mode 100644 index 0000000..98ebfbc --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_debug.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseDebug(BaseModel): + """ + Extract200ResponseDebug + """ # noqa: E501 + performance_metrics: Optional[Dict[str, Union[StrictFloat, StrictInt]]] = Field(default=None, description="Performance metrics collected during the task.") + proxy_total_bytes_usage: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="Total bytes used by the proxy during the task.") + transformed_output: Optional[Any] = Field(default=None, description="The transformed output after applying any transformations.") + userbrowser: Optional[Any] = Field(default=None, description="The userbrowser instance using during the task.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["performance_metrics", "proxy_total_bytes_usage", "transformed_output", "userbrowser"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseDebug from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if transformed_output (nullable) is None + # and model_fields_set contains the field + if self.transformed_output is None and "transformed_output" in self.model_fields_set: + _dict['transformed_output'] = None + + # set to None if userbrowser (nullable) is None + # and model_fields_set contains the field + if self.userbrowser is None and "userbrowser" in self.model_fields_set: + _dict['userbrowser'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseDebug from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "performance_metrics": obj.get("performance_metrics"), + "proxy_total_bytes_usage": obj.get("proxy_total_bytes_usage"), + "transformed_output": obj.get("transformed_output"), + "userbrowser": obj.get("userbrowser") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_metadata.py b/candidate/generated/nimble_client/models/extract200_response_metadata.py new file mode 100644 index 0000000..77bd369 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_metadata.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponseMetadata(BaseModel): + """ + Extract200ResponseMetadata + """ # noqa: E501 + agent: Optional[StrictStr] = Field(default=None, description="The name of the agent used for the query.") + driver: Optional[StrictStr] = Field(default=None, description="The driver used for the task.") + localization_id: Optional[StrictStr] = Field(default=None, description="The localization identifier for the query.") + query_duration: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The duration in milliseconds of the query processing.") + query_time: Optional[StrictStr] = Field(default=None, description="The time when the query was received.") + response_parameters: Optional[Any] = Field(default=None, description="Additional response parameters.") + tag: Optional[StrictStr] = Field(default=None, description="A tag associated with the query.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["agent", "driver", "localization_id", "query_duration", "query_time", "response_parameters", "tag"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponseMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if response_parameters (nullable) is None + # and model_fields_set contains the field + if self.response_parameters is None and "response_parameters" in self.model_fields_set: + _dict['response_parameters'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponseMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent": obj.get("agent"), + "driver": obj.get("driver"), + "localization_id": obj.get("localization_id"), + "query_duration": obj.get("query_duration"), + "query_time": obj.get("query_time"), + "response_parameters": obj.get("response_parameters"), + "tag": obj.get("tag") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_pagination.py b/candidate/generated/nimble_client/models/extract200_response_pagination.py new file mode 100644 index 0000000..472d954 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_pagination.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from nimble_client.models.extract200_response_pagination_any_of import Extract200ResponsePaginationAnyOf +from nimble_client.models.extract200_response_pagination_any_of1_inner import Extract200ResponsePaginationAnyOf1Inner +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +EXTRACT200RESPONSEPAGINATION_ANY_OF_SCHEMAS = ["Extract200ResponsePaginationAnyOf", "List[Extract200ResponsePaginationAnyOf1Inner]"] + +class Extract200ResponsePagination(BaseModel): + """ + Pagination information if applicable. + """ + + # data type: Extract200ResponsePaginationAnyOf + anyof_schema_1_validator: Optional[Extract200ResponsePaginationAnyOf] = None + # data type: List[Extract200ResponsePaginationAnyOf1Inner] + anyof_schema_2_validator: Optional[List[Extract200ResponsePaginationAnyOf1Inner]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Extract200ResponsePaginationAnyOf, List[Extract200ResponsePaginationAnyOf1Inner]]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "Extract200ResponsePaginationAnyOf", "List[Extract200ResponsePaginationAnyOf1Inner]" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Extract200ResponsePagination.model_construct() + error_messages = [] + # validate data type: Extract200ResponsePaginationAnyOf + if not isinstance(v, Extract200ResponsePaginationAnyOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `Extract200ResponsePaginationAnyOf`") + else: + return v + + # validate data type: List[Extract200ResponsePaginationAnyOf1Inner] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Extract200ResponsePagination with anyOf schemas: Extract200ResponsePaginationAnyOf, List[Extract200ResponsePaginationAnyOf1Inner]. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[Extract200ResponsePaginationAnyOf] = None + try: + instance.actual_instance = Extract200ResponsePaginationAnyOf.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[Extract200ResponsePaginationAnyOf1Inner] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Extract200ResponsePagination with anyOf schemas: Extract200ResponsePaginationAnyOf, List[Extract200ResponsePaginationAnyOf1Inner]. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Extract200ResponsePaginationAnyOf, List[Extract200ResponsePaginationAnyOf1Inner]]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/extract200_response_pagination_any_of.py b/candidate/generated/nimble_client/models/extract200_response_pagination_any_of.py new file mode 100644 index 0000000..8981139 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_pagination_any_of.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponsePaginationAnyOf(BaseModel): + """ + Extract200ResponsePaginationAnyOf + """ # noqa: E501 + next_page_params: Dict[str, Any] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["next_page_params"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponsePaginationAnyOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponsePaginationAnyOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "next_page_params": obj.get("next_page_params") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract200_response_pagination_any_of1_inner.py b/candidate/generated/nimble_client/models/extract200_response_pagination_any_of1_inner.py new file mode 100644 index 0000000..40ad4ab --- /dev/null +++ b/candidate/generated/nimble_client/models/extract200_response_pagination_any_of1_inner.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Extract200ResponsePaginationAnyOf1Inner(BaseModel): + """ + Extract200ResponsePaginationAnyOf1Inner + """ # noqa: E501 + next_page_params: Dict[str, Any] + __properties: ClassVar[List[str]] = ["next_page_params"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Extract200ResponsePaginationAnyOf1Inner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Extract200ResponsePaginationAnyOf1Inner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "next_page_params": obj.get("next_page_params") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_async_request.py b/candidate/generated/nimble_client/models/extract_async_request.py new file mode 100644 index 0000000..fe1aa3c --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_async_request.py @@ -0,0 +1,321 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.browser_action import BrowserAction +from nimble_client.models.crawl_payload_extract_options_browser import CrawlPayloadExtractOptionsBrowser +from nimble_client.models.crawl_payload_extract_options_cookies import CrawlPayloadExtractOptionsCookies +from nimble_client.models.crawl_payload_extract_options_file_parsing_options import CrawlPayloadExtractOptionsFileParsingOptions +from nimble_client.models.crawl_payload_extract_options_headers_value import CrawlPayloadExtractOptionsHeadersValue +from nimble_client.models.crawl_payload_extract_options_network_capture_inner import CrawlPayloadExtractOptionsNetworkCaptureInner +from nimble_client.models.crawl_payload_extract_options_parser import CrawlPayloadExtractOptionsParser +from nimble_client.models.crawl_payload_extract_options_render import CrawlPayloadExtractOptionsRender +from nimble_client.models.crawl_payload_extract_options_session import CrawlPayloadExtractOptionsSession +from nimble_client.models.crawl_payload_extract_options_skill import CrawlPayloadExtractOptionsSkill +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractAsyncRequest(BaseModel): + """ + ExtractAsyncRequest + """ # noqa: E501 + auto_driver_configuration: Optional[Dict[str, Annotated[int, Field(le=10, strict=True, ge=0)]]] = Field(default=None, description="Custom flow for the optimization engine: maps candidate names to the number of attempts to spend on each candidate before advancing (0 skips it). Key order defines the flow order. Providing it opts the request into 'auto' driver selection.") + body: Optional[Any] = Field(default=None, description="Request body for POST, PUT, PATCH methods") + browser: Optional[CrawlPayloadExtractOptionsBrowser] = None + browser_actions: Optional[Annotated[List[BrowserAction], Field(min_length=1)]] = Field(default=None, description="Array of browser automation actions to execute sequentially", json_schema_extra={"examples": [[{"goto": "https://example.com/login"}, {"wait_for_element": "#login-form"}, {"fill": {"selector": "#username", "value": "user@example.com"}}, {"fill": {"selector": "#password", "value": "password123"}}, {"click": "#submit"}, {"screenshot": {"full_page": True}}]]}) + city: Optional[StrictStr] = Field(default=None, description="City for geolocation") + consent_header: Optional[StrictBool] = Field(default=None, description="Whether to automatically handle cookie consent headers") + cookies: Optional[CrawlPayloadExtractOptionsCookies] = None + country: Optional[StrictStr] = Field(default='ALL', description="Country code for geolocation and proxy selection") + device: Optional[StrictStr] = Field(default='desktop', description="Device type for browser emulation") + driver: Optional[StrictStr] = Field(default=None, description="Browser driver to use") + expected_status_codes: Optional[List[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]]] = Field(default=None, description="Expected HTTP status codes for successful requests") + file_parsing_options: Optional[CrawlPayloadExtractOptionsFileParsingOptions] = None + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="List of acceptable response formats in order of preference") + headers: Optional[Dict[str, Optional[CrawlPayloadExtractOptionsHeadersValue]]] = Field(default=None, description="Custom HTTP headers to include in the request") + http2: Optional[StrictBool] = Field(default=False, description="Whether to use HTTP/2 protocol") + is_xhr: Optional[StrictBool] = Field(default=False, description="Whether to emulate XMLHttpRequest behavior") + locale: Optional[StrictStr] = Field(default='en', description="Locale for browser language and region settings") + markdown_backend: Optional[StrictStr] = Field(default='full_page', description="Selects which markdown conversion strategy to use. \"full_page\" converts the entire HTML page. \"main_content\" uses Mozilla Readability to extract the main article content before converting.") + method: Optional[StrictStr] = Field(default='GET', description="HTTP method for the request") + network_capture: Optional[List[CrawlPayloadExtractOptionsNetworkCaptureInner]] = Field(default=None, description="Filters for capturing network traffic") + os: Optional[StrictStr] = Field(default=None, description="Operating system to emulate") + parse: Optional[StrictBool] = Field(default=False, description="Whether to parse the response content") + parser: Optional[CrawlPayloadExtractOptionsParser] = None + realtime_total_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout — it can shorten the deadline but never extend it. Has no effect on async requests.") + referrer_type: Optional[StrictStr] = Field(default=None, description="Referrer policy for the request") + render: Optional[CrawlPayloadExtractOptionsRender] = None + request_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Request timeout in milliseconds") + session: Optional[CrawlPayloadExtractOptionsSession] = None + skill: Optional[CrawlPayloadExtractOptionsSkill] = None + state: Optional[StrictStr] = Field(default=None, description="US state for geolocation (only valid when country is US)") + tag: Optional[StrictStr] = Field(default=None, description="User-defined tag for request identification") + url: StrictStr = Field(description="Target URL to scrape") + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["auto_driver_configuration", "body", "browser", "browser_actions", "city", "consent_header", "cookies", "country", "device", "driver", "expected_status_codes", "file_parsing_options", "formats", "headers", "http2", "is_xhr", "locale", "markdown_backend", "method", "network_capture", "os", "parse", "parser", "realtime_total_timeout", "referrer_type", "render", "request_timeout", "session", "skill", "state", "tag", "url", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('country') + def country_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL']): + raise ValueError("must be one of enum values ('AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL')") + return value + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile', 'tablet']): + raise ValueError("must be one of enum values ('desktop', 'mobile', 'tablet')") + return value + + @field_validator('driver') + def driver_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6']): + raise ValueError("must be one of enum values ('auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6')") + return value + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto']): + raise ValueError("must be one of enum values ('aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto')") + return value + + @field_validator('markdown_backend') + def markdown_backend_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['full_page', 'main_content']): + raise ValueError("must be one of enum values ('full_page', 'main_content')") + return value + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']): + raise ValueError("must be one of enum values ('GET', 'POST', 'PUT', 'PATCH', 'DELETE')") + return value + + @field_validator('os') + def os_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['windows', 'mac os', 'linux', 'android', 'ios']): + raise ValueError("must be one of enum values ('windows', 'mac os', 'linux', 'android', 'ios')") + return value + + @field_validator('referrer_type') + def referrer_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram']): + raise ValueError("must be one of enum values ('random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY']): + raise ValueError("must be one of enum values ('AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractAsyncRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser + if self.browser: + _dict['browser'] = self.browser.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in browser_actions (list) + _items = [] + if self.browser_actions: + for _item_browser_actions in self.browser_actions: + _items.append(_item_browser_actions.to_dict() if _item_browser_actions is not None else None) + _dict['browser_actions'] = _items + # override the default output from pydantic by calling `to_dict()` of cookies + if self.cookies: + _dict['cookies'] = self.cookies.to_dict() + # override the default output from pydantic by calling `to_dict()` of file_parsing_options + if self.file_parsing_options: + _dict['file_parsing_options'] = self.file_parsing_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in headers (dict) + _field_dict = {} + if self.headers: + for _key_headers in self.headers: + _field_dict[_key_headers] = self.headers[_key_headers].to_dict() if self.headers[_key_headers] is not None else None + _dict['headers'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of each item in network_capture (list) + _items = [] + if self.network_capture: + for _item_network_capture in self.network_capture: + _items.append(_item_network_capture.to_dict() if _item_network_capture is not None else None) + _dict['network_capture'] = _items + # override the default output from pydantic by calling `to_dict()` of parser + if self.parser: + _dict['parser'] = self.parser.to_dict() + # override the default output from pydantic by calling `to_dict()` of render + if self.render: + _dict['render'] = self.render.to_dict() + # override the default output from pydantic by calling `to_dict()` of session + if self.session: + _dict['session'] = self.session.to_dict() + # override the default output from pydantic by calling `to_dict()` of skill + if self.skill: + _dict['skill'] = self.skill.to_dict() + # set to None if body (nullable) is None + # and model_fields_set contains the field + if self.body is None and "body" in self.model_fields_set: + _dict['body'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractAsyncRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auto_driver_configuration": obj.get("auto_driver_configuration"), + "body": obj.get("body"), + "browser": CrawlPayloadExtractOptionsBrowser.from_dict(obj["browser"]) if obj.get("browser") is not None else None, + "browser_actions": [BrowserAction.from_dict(_item) for _item in obj["browser_actions"]] if obj.get("browser_actions") is not None else None, + "city": obj.get("city"), + "consent_header": obj.get("consent_header"), + "cookies": CrawlPayloadExtractOptionsCookies.from_dict(obj["cookies"]) if obj.get("cookies") is not None else None, + "country": obj.get("country") if obj.get("country") is not None else 'ALL', + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "driver": obj.get("driver"), + "expected_status_codes": obj.get("expected_status_codes"), + "file_parsing_options": CrawlPayloadExtractOptionsFileParsingOptions.from_dict(obj["file_parsing_options"]) if obj.get("file_parsing_options") is not None else None, + "formats": obj.get("formats"), + "headers": dict( + (_k, CrawlPayloadExtractOptionsHeadersValue.from_dict(_v)) + for _k, _v in obj["headers"].items() + ) + if obj.get("headers") is not None + else None, + "http2": obj.get("http2") if obj.get("http2") is not None else False, + "is_xhr": obj.get("is_xhr") if obj.get("is_xhr") is not None else False, + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', + "markdown_backend": obj.get("markdown_backend") if obj.get("markdown_backend") is not None else 'full_page', + "method": obj.get("method") if obj.get("method") is not None else 'GET', + "network_capture": [CrawlPayloadExtractOptionsNetworkCaptureInner.from_dict(_item) for _item in obj["network_capture"]] if obj.get("network_capture") is not None else None, + "os": obj.get("os"), + "parse": obj.get("parse") if obj.get("parse") is not None else False, + "parser": CrawlPayloadExtractOptionsParser.from_dict(obj["parser"]) if obj.get("parser") is not None else None, + "realtime_total_timeout": obj.get("realtime_total_timeout"), + "referrer_type": obj.get("referrer_type"), + "render": CrawlPayloadExtractOptionsRender.from_dict(obj["render"]) if obj.get("render") is not None else None, + "request_timeout": obj.get("request_timeout"), + "session": CrawlPayloadExtractOptionsSession.from_dict(obj["session"]) if obj.get("session") is not None else None, + "skill": CrawlPayloadExtractOptionsSkill.from_dict(obj["skill"]) if obj.get("skill") is not None else None, + "state": obj.get("state"), + "tag": obj.get("tag"), + "url": obj.get("url"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_async_response.py b/candidate/generated/nimble_client/models/extract_async_response.py new file mode 100644 index 0000000..4356038 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_async_response.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from nimble_client.models.extract_async_response_task import ExtractAsyncResponseTask +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractAsyncResponse(BaseModel): + """ + Response when an async extract task is created successfully. + """ # noqa: E501 + status: StrictStr = Field(description="Status indicating the async task was created successfully.") + task: ExtractAsyncResponseTask + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["status", "task"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success']): + raise ValueError("must be one of enum values ('success')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractAsyncResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of task + if self.task: + _dict['task'] = self.task.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractAsyncResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "task": ExtractAsyncResponseTask.from_dict(obj["task"]) if obj.get("task") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_async_response_task.py b/candidate/generated/nimble_client/models/extract_async_response_task.py new file mode 100644 index 0000000..e225ab7 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_async_response_task.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractAsyncResponseTask(BaseModel): + """ + The created async task details. + """ # noqa: E501 + query: Optional[Any] = Field(alias="_query") + account_name: Optional[StrictStr] = Field(default=None, description="Account name that owns the task.") + api_type: Optional[StrictStr] = None + batch_id: Optional[StrictStr] = Field(default=None, description="Batch ID if this task is part of a batch.") + created_at: StrictStr = Field(description="Timestamp when the task was created.") + download_url: Optional[StrictStr] = Field(default=None, description="URL for downloading the task results.") + error: Optional[StrictStr] = Field(default=None, description="Error message if the task failed.") + error_type: Optional[StrictStr] = Field(default=None, description="Classification of the error type.") + id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Unique task identifier.") + input: Optional[Any] = Field(description="Original input data for the task.") + modified_at: Optional[StrictStr] = Field(default=None, description="Timestamp when the task was last modified.") + output_url: Optional[StrictStr] = Field(default=None, description="Storage location of the output data.") + queue: Optional[StrictStr] = Field(default=None, description="Queue name the task was submitted to.") + state: StrictStr = Field(description="Current state of the task.") + status_code: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="HTTP status code from the task execution.") + status_url: StrictStr = Field(description="URL for checking the task status.") + __properties: ClassVar[List[str]] = ["_query", "account_name", "api_type", "batch_id", "created_at", "download_url", "error", "error_type", "id", "input", "modified_at", "output_url", "queue", "state", "status_code", "status_url"] + + @field_validator('api_type') + def api_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs']): + raise ValueError("must be one of enum values ('web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'queued', 'in_progress', 'success', 'error']): + raise ValueError("must be one of enum values ('pending', 'queued', 'in_progress', 'success', 'error')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractAsyncResponseTask from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if query (nullable) is None + # and model_fields_set contains the field + if self.query is None and "query" in self.model_fields_set: + _dict['_query'] = None + + # set to None if batch_id (nullable) is None + # and model_fields_set contains the field + if self.batch_id is None and "batch_id" in self.model_fields_set: + _dict['batch_id'] = None + + # set to None if download_url (nullable) is None + # and model_fields_set contains the field + if self.download_url is None and "download_url" in self.model_fields_set: + _dict['download_url'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if error_type (nullable) is None + # and model_fields_set contains the field + if self.error_type is None and "error_type" in self.model_fields_set: + _dict['error_type'] = None + + # set to None if input (nullable) is None + # and model_fields_set contains the field + if self.input is None and "input" in self.model_fields_set: + _dict['input'] = None + + # set to None if output_url (nullable) is None + # and model_fields_set contains the field + if self.output_url is None and "output_url" in self.model_fields_set: + _dict['output_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractAsyncResponseTask from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_query": obj.get("_query"), + "account_name": obj.get("account_name"), + "api_type": obj.get("api_type"), + "batch_id": obj.get("batch_id"), + "created_at": obj.get("created_at"), + "download_url": obj.get("download_url"), + "error": obj.get("error"), + "error_type": obj.get("error_type"), + "id": obj.get("id"), + "input": obj.get("input"), + "modified_at": obj.get("modified_at"), + "output_url": obj.get("output_url"), + "queue": obj.get("queue"), + "state": obj.get("state"), + "status_code": obj.get("status_code"), + "status_url": obj.get("status_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_batch_payload.py b/candidate/generated/nimble_client/models/extract_batch_payload.py new file mode 100644 index 0000000..f596d0f --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_batch_payload.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.extract_batch_payload_inputs_inner import ExtractBatchPayloadInputsInner +from nimble_client.models.extract_batch_payload_shared_inputs import ExtractBatchPayloadSharedInputs +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractBatchPayload(BaseModel): + """ + ExtractBatchPayload + """ # noqa: E501 + inputs: Annotated[List[ExtractBatchPayloadInputsInner], Field(min_length=1)] = Field(description="Array of extraction requests. Each object can include extraction parameters and async/storage settings.") + shared_inputs: Optional[ExtractBatchPayloadSharedInputs] = None + __properties: ClassVar[List[str]] = ["inputs", "shared_inputs"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractBatchPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in inputs (list) + _items = [] + if self.inputs: + for _item_inputs in self.inputs: + _items.append(_item_inputs.to_dict() if _item_inputs is not None else None) + _dict['inputs'] = _items + # override the default output from pydantic by calling `to_dict()` of shared_inputs + if self.shared_inputs: + _dict['shared_inputs'] = self.shared_inputs.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractBatchPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "inputs": [ExtractBatchPayloadInputsInner.from_dict(_item) for _item in obj["inputs"]] if obj.get("inputs") is not None else None, + "shared_inputs": ExtractBatchPayloadSharedInputs.from_dict(obj["shared_inputs"]) if obj.get("shared_inputs") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_batch_payload_inputs_inner.py b/candidate/generated/nimble_client/models/extract_batch_payload_inputs_inner.py new file mode 100644 index 0000000..b40d6aa --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_batch_payload_inputs_inner.py @@ -0,0 +1,321 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.browser_action import BrowserAction +from nimble_client.models.crawl_payload_extract_options_browser import CrawlPayloadExtractOptionsBrowser +from nimble_client.models.crawl_payload_extract_options_cookies import CrawlPayloadExtractOptionsCookies +from nimble_client.models.crawl_payload_extract_options_file_parsing_options import CrawlPayloadExtractOptionsFileParsingOptions +from nimble_client.models.crawl_payload_extract_options_headers_value import CrawlPayloadExtractOptionsHeadersValue +from nimble_client.models.crawl_payload_extract_options_network_capture_inner import CrawlPayloadExtractOptionsNetworkCaptureInner +from nimble_client.models.crawl_payload_extract_options_parser import CrawlPayloadExtractOptionsParser +from nimble_client.models.crawl_payload_extract_options_session import CrawlPayloadExtractOptionsSession +from nimble_client.models.crawl_payload_extract_options_skill import CrawlPayloadExtractOptionsSkill +from nimble_client.models.extract_batch_payload_inputs_inner_all_of_render import ExtractBatchPayloadInputsInnerAllOfRender +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractBatchPayloadInputsInner(BaseModel): + """ + ExtractBatchPayloadInputsInner + """ # noqa: E501 + auto_driver_configuration: Optional[Dict[str, Annotated[int, Field(le=10, strict=True, ge=0)]]] = Field(default=None, description="Sequential attempt budgets for the auto-render engine: maps candidate names to the number of attempts for each candidate before advancing (0 skips it). The first successful result is returned. Providing it opts the request into 'auto' driver selection.") + body: Optional[Any] = Field(default=None, description="Request body for POST, PUT, PATCH methods") + browser: Optional[CrawlPayloadExtractOptionsBrowser] = None + browser_actions: Optional[Annotated[List[BrowserAction], Field(min_length=1)]] = Field(default=None, description="Array of browser automation actions to execute sequentially", json_schema_extra={"examples": [[{"goto": "https://example.com/login"}, {"wait_for_element": "#login-form"}, {"fill": {"selector": "#username", "value": "user@example.com"}}, {"fill": {"selector": "#password", "value": "password123"}}, {"click": "#submit"}, {"screenshot": {"full_page": True}}]]}) + city: Optional[StrictStr] = Field(default=None, description="City for geolocation") + consent_header: Optional[StrictBool] = Field(default=None, description="Whether to automatically handle cookie consent headers") + cookies: Optional[CrawlPayloadExtractOptionsCookies] = None + country: Optional[StrictStr] = Field(default='ALL', description="Country code for geolocation and proxy selection") + device: Optional[StrictStr] = Field(default='desktop', description="Device type for browser emulation") + driver: Optional[StrictStr] = Field(default=None, description="Browser driver to use. Use 'auto' for auto-render or 'max' for the Max configuration race.") + expected_status_codes: Optional[List[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]]] = Field(default=None, description="Expected HTTP status codes for successful requests") + file_parsing_options: Optional[CrawlPayloadExtractOptionsFileParsingOptions] = None + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="List of acceptable response formats in order of preference") + headers: Optional[Dict[str, Optional[CrawlPayloadExtractOptionsHeadersValue]]] = Field(default=None, description="Custom HTTP headers to include in the request") + http2: Optional[StrictBool] = Field(default=False, description="Whether to use HTTP/2 protocol") + is_xhr: Optional[StrictBool] = Field(default=False, description="Whether to emulate XMLHttpRequest behavior") + locale: Optional[StrictStr] = Field(default='en', description="Locale for browser language and region settings") + markdown_backend: Optional[StrictStr] = Field(default='full_page', description="Selects which markdown conversion strategy to use. \"full_page\" converts the entire HTML page. \"main_content\" uses Mozilla Readability to extract the main article content before converting.") + method: Optional[StrictStr] = Field(default='GET', description="HTTP method for the request") + network_capture: Optional[List[CrawlPayloadExtractOptionsNetworkCaptureInner]] = Field(default=None, description="Filters for capturing network traffic") + os: Optional[StrictStr] = Field(default=None, description="Operating system to emulate") + parse: Optional[StrictBool] = Field(default=False, description="Whether to parse the response content") + parser: Optional[CrawlPayloadExtractOptionsParser] = None + realtime_total_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout — it can shorten the deadline but never extend it. Has no effect on async requests.") + referrer_type: Optional[StrictStr] = Field(default=None, description="Referrer policy for the request") + render: Optional[ExtractBatchPayloadInputsInnerAllOfRender] = None + request_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Request timeout in milliseconds") + session: Optional[CrawlPayloadExtractOptionsSession] = None + skill: Optional[CrawlPayloadExtractOptionsSkill] = None + state: Optional[StrictStr] = Field(default=None, description="US state for geolocation (only valid when country is US)") + tag: Optional[StrictStr] = Field(default=None, description="User-defined tag for request identification") + url: Optional[StrictStr] = Field(default=None, description="Target URL to scrape") + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["auto_driver_configuration", "body", "browser", "browser_actions", "city", "consent_header", "cookies", "country", "device", "driver", "expected_status_codes", "file_parsing_options", "formats", "headers", "http2", "is_xhr", "locale", "markdown_backend", "method", "network_capture", "os", "parse", "parser", "realtime_total_timeout", "referrer_type", "render", "request_timeout", "session", "skill", "state", "tag", "url", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('country') + def country_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL']): + raise ValueError("must be one of enum values ('AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL')") + return value + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile', 'tablet']): + raise ValueError("must be one of enum values ('desktop', 'mobile', 'tablet')") + return value + + @field_validator('driver') + def driver_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6']): + raise ValueError("must be one of enum values ('auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6')") + return value + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto']): + raise ValueError("must be one of enum values ('aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto')") + return value + + @field_validator('markdown_backend') + def markdown_backend_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['full_page', 'main_content']): + raise ValueError("must be one of enum values ('full_page', 'main_content')") + return value + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']): + raise ValueError("must be one of enum values ('GET', 'POST', 'PUT', 'PATCH', 'DELETE')") + return value + + @field_validator('os') + def os_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['windows', 'mac os', 'linux', 'android', 'ios']): + raise ValueError("must be one of enum values ('windows', 'mac os', 'linux', 'android', 'ios')") + return value + + @field_validator('referrer_type') + def referrer_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram']): + raise ValueError("must be one of enum values ('random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY']): + raise ValueError("must be one of enum values ('AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractBatchPayloadInputsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser + if self.browser: + _dict['browser'] = self.browser.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in browser_actions (list) + _items = [] + if self.browser_actions: + for _item_browser_actions in self.browser_actions: + _items.append(_item_browser_actions.to_dict() if _item_browser_actions is not None else None) + _dict['browser_actions'] = _items + # override the default output from pydantic by calling `to_dict()` of cookies + if self.cookies: + _dict['cookies'] = self.cookies.to_dict() + # override the default output from pydantic by calling `to_dict()` of file_parsing_options + if self.file_parsing_options: + _dict['file_parsing_options'] = self.file_parsing_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in headers (dict) + _field_dict = {} + if self.headers: + for _key_headers in self.headers: + _field_dict[_key_headers] = self.headers[_key_headers].to_dict() if self.headers[_key_headers] is not None else None + _dict['headers'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of each item in network_capture (list) + _items = [] + if self.network_capture: + for _item_network_capture in self.network_capture: + _items.append(_item_network_capture.to_dict() if _item_network_capture is not None else None) + _dict['network_capture'] = _items + # override the default output from pydantic by calling `to_dict()` of parser + if self.parser: + _dict['parser'] = self.parser.to_dict() + # override the default output from pydantic by calling `to_dict()` of render + if self.render: + _dict['render'] = self.render.to_dict() + # override the default output from pydantic by calling `to_dict()` of session + if self.session: + _dict['session'] = self.session.to_dict() + # override the default output from pydantic by calling `to_dict()` of skill + if self.skill: + _dict['skill'] = self.skill.to_dict() + # set to None if body (nullable) is None + # and model_fields_set contains the field + if self.body is None and "body" in self.model_fields_set: + _dict['body'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractBatchPayloadInputsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auto_driver_configuration": obj.get("auto_driver_configuration"), + "body": obj.get("body"), + "browser": CrawlPayloadExtractOptionsBrowser.from_dict(obj["browser"]) if obj.get("browser") is not None else None, + "browser_actions": [BrowserAction.from_dict(_item) for _item in obj["browser_actions"]] if obj.get("browser_actions") is not None else None, + "city": obj.get("city"), + "consent_header": obj.get("consent_header"), + "cookies": CrawlPayloadExtractOptionsCookies.from_dict(obj["cookies"]) if obj.get("cookies") is not None else None, + "country": obj.get("country") if obj.get("country") is not None else 'ALL', + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "driver": obj.get("driver"), + "expected_status_codes": obj.get("expected_status_codes"), + "file_parsing_options": CrawlPayloadExtractOptionsFileParsingOptions.from_dict(obj["file_parsing_options"]) if obj.get("file_parsing_options") is not None else None, + "formats": obj.get("formats"), + "headers": dict( + (_k, CrawlPayloadExtractOptionsHeadersValue.from_dict(_v)) + for _k, _v in obj["headers"].items() + ) + if obj.get("headers") is not None + else None, + "http2": obj.get("http2") if obj.get("http2") is not None else False, + "is_xhr": obj.get("is_xhr") if obj.get("is_xhr") is not None else False, + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', + "markdown_backend": obj.get("markdown_backend") if obj.get("markdown_backend") is not None else 'full_page', + "method": obj.get("method") if obj.get("method") is not None else 'GET', + "network_capture": [CrawlPayloadExtractOptionsNetworkCaptureInner.from_dict(_item) for _item in obj["network_capture"]] if obj.get("network_capture") is not None else None, + "os": obj.get("os"), + "parse": obj.get("parse") if obj.get("parse") is not None else False, + "parser": CrawlPayloadExtractOptionsParser.from_dict(obj["parser"]) if obj.get("parser") is not None else None, + "realtime_total_timeout": obj.get("realtime_total_timeout"), + "referrer_type": obj.get("referrer_type"), + "render": ExtractBatchPayloadInputsInnerAllOfRender.from_dict(obj["render"]) if obj.get("render") is not None else None, + "request_timeout": obj.get("request_timeout"), + "session": CrawlPayloadExtractOptionsSession.from_dict(obj["session"]) if obj.get("session") is not None else None, + "skill": CrawlPayloadExtractOptionsSkill.from_dict(obj["skill"]) if obj.get("skill") is not None else None, + "state": obj.get("state"), + "tag": obj.get("tag"), + "url": obj.get("url"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_batch_payload_inputs_inner_all_of_render.py b/candidate/generated/nimble_client/models/extract_batch_payload_inputs_inner_all_of_render.py new file mode 100644 index 0000000..697a459 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_batch_payload_inputs_inner_all_of_render.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +EXTRACTBATCHPAYLOADINPUTSINNERALLOFRENDER_ANY_OF_SCHEMAS = ["bool", "str"] + +class ExtractBatchPayloadInputsInnerAllOfRender(BaseModel): + """ + Whether to render JavaScript content using a browser. Use 'auto' to try eligible configurations sequentially until one succeeds. + """ + + # data type: bool + anyof_schema_1_validator: Optional[StrictBool] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[bool, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "bool", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ExtractBatchPayloadInputsInnerAllOfRender.model_construct() + error_messages = [] + # validate data type: bool + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ExtractBatchPayloadInputsInnerAllOfRender with anyOf schemas: bool, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into bool + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ExtractBatchPayloadInputsInnerAllOfRender with anyOf schemas: bool, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], bool, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/extract_batch_payload_shared_inputs.py b/candidate/generated/nimble_client/models/extract_batch_payload_shared_inputs.py new file mode 100644 index 0000000..3307ef1 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_batch_payload_shared_inputs.py @@ -0,0 +1,321 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.browser_action import BrowserAction +from nimble_client.models.crawl_payload_extract_options_browser import CrawlPayloadExtractOptionsBrowser +from nimble_client.models.crawl_payload_extract_options_cookies import CrawlPayloadExtractOptionsCookies +from nimble_client.models.crawl_payload_extract_options_file_parsing_options import CrawlPayloadExtractOptionsFileParsingOptions +from nimble_client.models.crawl_payload_extract_options_headers_value import CrawlPayloadExtractOptionsHeadersValue +from nimble_client.models.crawl_payload_extract_options_network_capture_inner import CrawlPayloadExtractOptionsNetworkCaptureInner +from nimble_client.models.crawl_payload_extract_options_parser import CrawlPayloadExtractOptionsParser +from nimble_client.models.crawl_payload_extract_options_session import CrawlPayloadExtractOptionsSession +from nimble_client.models.crawl_payload_extract_options_skill import CrawlPayloadExtractOptionsSkill +from nimble_client.models.extract_batch_payload_inputs_inner_all_of_render import ExtractBatchPayloadInputsInnerAllOfRender +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractBatchPayloadSharedInputs(BaseModel): + """ + Shared parameters applied to the entire batch. Can include extraction parameters and async/storage settings. + """ # noqa: E501 + auto_driver_configuration: Optional[Dict[str, Annotated[int, Field(le=10, strict=True, ge=0)]]] = Field(default=None, description="Sequential attempt budgets for the auto-render engine: maps candidate names to the number of attempts for each candidate before advancing (0 skips it). The first successful result is returned. Providing it opts the request into 'auto' driver selection.") + body: Optional[Any] = Field(default=None, description="Request body for POST, PUT, PATCH methods") + browser: Optional[CrawlPayloadExtractOptionsBrowser] = None + browser_actions: Optional[Annotated[List[BrowserAction], Field(min_length=1)]] = Field(default=None, description="Array of browser automation actions to execute sequentially", json_schema_extra={"examples": [[{"goto": "https://example.com/login"}, {"wait_for_element": "#login-form"}, {"fill": {"selector": "#username", "value": "user@example.com"}}, {"fill": {"selector": "#password", "value": "password123"}}, {"click": "#submit"}, {"screenshot": {"full_page": True}}]]}) + city: Optional[StrictStr] = Field(default=None, description="City for geolocation") + consent_header: Optional[StrictBool] = Field(default=None, description="Whether to automatically handle cookie consent headers") + cookies: Optional[CrawlPayloadExtractOptionsCookies] = None + country: Optional[StrictStr] = Field(default='ALL', description="Country code for geolocation and proxy selection") + device: Optional[StrictStr] = Field(default='desktop', description="Device type for browser emulation") + driver: Optional[StrictStr] = Field(default=None, description="Browser driver to use. Use 'auto' for auto-render or 'max' for the Max configuration race.") + expected_status_codes: Optional[List[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]]] = Field(default=None, description="Expected HTTP status codes for successful requests") + file_parsing_options: Optional[CrawlPayloadExtractOptionsFileParsingOptions] = None + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="List of acceptable response formats in order of preference") + headers: Optional[Dict[str, Optional[CrawlPayloadExtractOptionsHeadersValue]]] = Field(default=None, description="Custom HTTP headers to include in the request") + http2: Optional[StrictBool] = Field(default=False, description="Whether to use HTTP/2 protocol") + is_xhr: Optional[StrictBool] = Field(default=False, description="Whether to emulate XMLHttpRequest behavior") + locale: Optional[StrictStr] = Field(default='en', description="Locale for browser language and region settings") + markdown_backend: Optional[StrictStr] = Field(default='full_page', description="Selects which markdown conversion strategy to use. \"full_page\" converts the entire HTML page. \"main_content\" uses Mozilla Readability to extract the main article content before converting.") + method: Optional[StrictStr] = Field(default='GET', description="HTTP method for the request") + network_capture: Optional[List[CrawlPayloadExtractOptionsNetworkCaptureInner]] = Field(default=None, description="Filters for capturing network traffic") + os: Optional[StrictStr] = Field(default=None, description="Operating system to emulate") + parse: Optional[StrictBool] = Field(default=False, description="Whether to parse the response content") + parser: Optional[CrawlPayloadExtractOptionsParser] = None + realtime_total_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout — it can shorten the deadline but never extend it. Has no effect on async requests.") + referrer_type: Optional[StrictStr] = Field(default=None, description="Referrer policy for the request") + render: Optional[ExtractBatchPayloadInputsInnerAllOfRender] = None + request_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Request timeout in milliseconds") + session: Optional[CrawlPayloadExtractOptionsSession] = None + skill: Optional[CrawlPayloadExtractOptionsSkill] = None + state: Optional[StrictStr] = Field(default=None, description="US state for geolocation (only valid when country is US)") + tag: Optional[StrictStr] = Field(default=None, description="User-defined tag for request identification") + url: Optional[StrictStr] = Field(default=None, description="Target URL to scrape") + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["auto_driver_configuration", "body", "browser", "browser_actions", "city", "consent_header", "cookies", "country", "device", "driver", "expected_status_codes", "file_parsing_options", "formats", "headers", "http2", "is_xhr", "locale", "markdown_backend", "method", "network_capture", "os", "parse", "parser", "realtime_total_timeout", "referrer_type", "render", "request_timeout", "session", "skill", "state", "tag", "url", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('country') + def country_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL']): + raise ValueError("must be one of enum values ('AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL')") + return value + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile', 'tablet']): + raise ValueError("must be one of enum values ('desktop', 'mobile', 'tablet')") + return value + + @field_validator('driver') + def driver_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6']): + raise ValueError("must be one of enum values ('auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6')") + return value + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto']): + raise ValueError("must be one of enum values ('aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto')") + return value + + @field_validator('markdown_backend') + def markdown_backend_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['full_page', 'main_content']): + raise ValueError("must be one of enum values ('full_page', 'main_content')") + return value + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']): + raise ValueError("must be one of enum values ('GET', 'POST', 'PUT', 'PATCH', 'DELETE')") + return value + + @field_validator('os') + def os_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['windows', 'mac os', 'linux', 'android', 'ios']): + raise ValueError("must be one of enum values ('windows', 'mac os', 'linux', 'android', 'ios')") + return value + + @field_validator('referrer_type') + def referrer_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram']): + raise ValueError("must be one of enum values ('random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY']): + raise ValueError("must be one of enum values ('AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractBatchPayloadSharedInputs from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser + if self.browser: + _dict['browser'] = self.browser.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in browser_actions (list) + _items = [] + if self.browser_actions: + for _item_browser_actions in self.browser_actions: + _items.append(_item_browser_actions.to_dict() if _item_browser_actions is not None else None) + _dict['browser_actions'] = _items + # override the default output from pydantic by calling `to_dict()` of cookies + if self.cookies: + _dict['cookies'] = self.cookies.to_dict() + # override the default output from pydantic by calling `to_dict()` of file_parsing_options + if self.file_parsing_options: + _dict['file_parsing_options'] = self.file_parsing_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in headers (dict) + _field_dict = {} + if self.headers: + for _key_headers in self.headers: + _field_dict[_key_headers] = self.headers[_key_headers].to_dict() if self.headers[_key_headers] is not None else None + _dict['headers'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of each item in network_capture (list) + _items = [] + if self.network_capture: + for _item_network_capture in self.network_capture: + _items.append(_item_network_capture.to_dict() if _item_network_capture is not None else None) + _dict['network_capture'] = _items + # override the default output from pydantic by calling `to_dict()` of parser + if self.parser: + _dict['parser'] = self.parser.to_dict() + # override the default output from pydantic by calling `to_dict()` of render + if self.render: + _dict['render'] = self.render.to_dict() + # override the default output from pydantic by calling `to_dict()` of session + if self.session: + _dict['session'] = self.session.to_dict() + # override the default output from pydantic by calling `to_dict()` of skill + if self.skill: + _dict['skill'] = self.skill.to_dict() + # set to None if body (nullable) is None + # and model_fields_set contains the field + if self.body is None and "body" in self.model_fields_set: + _dict['body'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractBatchPayloadSharedInputs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auto_driver_configuration": obj.get("auto_driver_configuration"), + "body": obj.get("body"), + "browser": CrawlPayloadExtractOptionsBrowser.from_dict(obj["browser"]) if obj.get("browser") is not None else None, + "browser_actions": [BrowserAction.from_dict(_item) for _item in obj["browser_actions"]] if obj.get("browser_actions") is not None else None, + "city": obj.get("city"), + "consent_header": obj.get("consent_header"), + "cookies": CrawlPayloadExtractOptionsCookies.from_dict(obj["cookies"]) if obj.get("cookies") is not None else None, + "country": obj.get("country") if obj.get("country") is not None else 'ALL', + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "driver": obj.get("driver"), + "expected_status_codes": obj.get("expected_status_codes"), + "file_parsing_options": CrawlPayloadExtractOptionsFileParsingOptions.from_dict(obj["file_parsing_options"]) if obj.get("file_parsing_options") is not None else None, + "formats": obj.get("formats"), + "headers": dict( + (_k, CrawlPayloadExtractOptionsHeadersValue.from_dict(_v)) + for _k, _v in obj["headers"].items() + ) + if obj.get("headers") is not None + else None, + "http2": obj.get("http2") if obj.get("http2") is not None else False, + "is_xhr": obj.get("is_xhr") if obj.get("is_xhr") is not None else False, + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', + "markdown_backend": obj.get("markdown_backend") if obj.get("markdown_backend") is not None else 'full_page', + "method": obj.get("method") if obj.get("method") is not None else 'GET', + "network_capture": [CrawlPayloadExtractOptionsNetworkCaptureInner.from_dict(_item) for _item in obj["network_capture"]] if obj.get("network_capture") is not None else None, + "os": obj.get("os"), + "parse": obj.get("parse") if obj.get("parse") is not None else False, + "parser": CrawlPayloadExtractOptionsParser.from_dict(obj["parser"]) if obj.get("parser") is not None else None, + "realtime_total_timeout": obj.get("realtime_total_timeout"), + "referrer_type": obj.get("referrer_type"), + "render": ExtractBatchPayloadInputsInnerAllOfRender.from_dict(obj["render"]) if obj.get("render") is not None else None, + "request_timeout": obj.get("request_timeout"), + "session": CrawlPayloadExtractOptionsSession.from_dict(obj["session"]) if obj.get("session") is not None else None, + "skill": CrawlPayloadExtractOptionsSkill.from_dict(obj["skill"]) if obj.get("skill") is not None else None, + "state": obj.get("state"), + "tag": obj.get("tag"), + "url": obj.get("url"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_batch_response.py b/candidate/generated/nimble_client/models/extract_batch_response.py new file mode 100644 index 0000000..38ab8ee --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_batch_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from nimble_client.models.extract_batch_response_tasks_inner import ExtractBatchResponseTasksInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractBatchResponse(BaseModel): + """ + Response when a batch of extract tasks is created successfully. + """ # noqa: E501 + batch_id: StrictStr = Field(description="Unique identifier for the batch.") + batch_size: Union[StrictFloat, StrictInt] = Field(description="Number of tasks in the batch.") + tasks: List[ExtractBatchResponseTasksInner] = Field(description="List of created tasks.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["batch_id", "batch_size", "tasks"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractBatchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in tasks (list) + _items = [] + if self.tasks: + for _item_tasks in self.tasks: + _items.append(_item_tasks.to_dict() if _item_tasks is not None else None) + _dict['tasks'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractBatchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "batch_id": obj.get("batch_id"), + "batch_size": obj.get("batch_size"), + "tasks": [ExtractBatchResponseTasksInner.from_dict(_item) for _item in obj["tasks"]] if obj.get("tasks") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_batch_response_tasks_inner.py b/candidate/generated/nimble_client/models/extract_batch_response_tasks_inner.py new file mode 100644 index 0000000..572f06e --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_batch_response_tasks_inner.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractBatchResponseTasksInner(BaseModel): + """ + ExtractBatchResponseTasksInner + """ # noqa: E501 + query: Optional[Any] = Field(alias="_query") + account_name: Optional[StrictStr] = Field(default=None, description="Account name that owns the task.") + api_type: Optional[StrictStr] = None + batch_id: Optional[StrictStr] = Field(default=None, description="Batch ID if this task is part of a batch.") + created_at: StrictStr = Field(description="Timestamp when the task was created.") + download_url: Optional[StrictStr] = Field(default=None, description="URL for downloading the task results.") + error: Optional[StrictStr] = Field(default=None, description="Error message if the task failed.") + error_type: Optional[StrictStr] = Field(default=None, description="Classification of the error type.") + id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Unique task identifier.") + input: Optional[Any] = Field(description="Original input data for the task.") + modified_at: Optional[StrictStr] = Field(default=None, description="Timestamp when the task was last modified.") + output_url: Optional[StrictStr] = Field(default=None, description="Storage location of the output data.") + queue: Optional[StrictStr] = Field(default=None, description="Queue name the task was submitted to.") + state: StrictStr = Field(description="Current state of the task.") + status_code: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="HTTP status code from the task execution.") + status_url: StrictStr = Field(description="URL for checking the task status.") + __properties: ClassVar[List[str]] = ["_query", "account_name", "api_type", "batch_id", "created_at", "download_url", "error", "error_type", "id", "input", "modified_at", "output_url", "queue", "state", "status_code", "status_url"] + + @field_validator('api_type') + def api_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs']): + raise ValueError("must be one of enum values ('web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'queued', 'in_progress', 'success', 'error']): + raise ValueError("must be one of enum values ('pending', 'queued', 'in_progress', 'success', 'error')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractBatchResponseTasksInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if query (nullable) is None + # and model_fields_set contains the field + if self.query is None and "query" in self.model_fields_set: + _dict['_query'] = None + + # set to None if batch_id (nullable) is None + # and model_fields_set contains the field + if self.batch_id is None and "batch_id" in self.model_fields_set: + _dict['batch_id'] = None + + # set to None if download_url (nullable) is None + # and model_fields_set contains the field + if self.download_url is None and "download_url" in self.model_fields_set: + _dict['download_url'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if error_type (nullable) is None + # and model_fields_set contains the field + if self.error_type is None and "error_type" in self.model_fields_set: + _dict['error_type'] = None + + # set to None if input (nullable) is None + # and model_fields_set contains the field + if self.input is None and "input" in self.model_fields_set: + _dict['input'] = None + + # set to None if output_url (nullable) is None + # and model_fields_set contains the field + if self.output_url is None and "output_url" in self.model_fields_set: + _dict['output_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractBatchResponseTasksInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_query": obj.get("_query"), + "account_name": obj.get("account_name"), + "api_type": obj.get("api_type"), + "batch_id": obj.get("batch_id"), + "created_at": obj.get("created_at"), + "download_url": obj.get("download_url"), + "error": obj.get("error"), + "error_type": obj.get("error_type"), + "id": obj.get("id"), + "input": obj.get("input"), + "modified_at": obj.get("modified_at"), + "output_url": obj.get("output_url"), + "queue": obj.get("queue"), + "state": obj.get("state"), + "status_code": obj.get("status_code"), + "status_url": obj.get("status_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_payload.py b/candidate/generated/nimble_client/models/extract_payload.py new file mode 100644 index 0000000..c20aa25 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_payload.py @@ -0,0 +1,311 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.browser_action import BrowserAction +from nimble_client.models.crawl_payload_extract_options_browser import CrawlPayloadExtractOptionsBrowser +from nimble_client.models.crawl_payload_extract_options_cookies import CrawlPayloadExtractOptionsCookies +from nimble_client.models.crawl_payload_extract_options_file_parsing_options import CrawlPayloadExtractOptionsFileParsingOptions +from nimble_client.models.crawl_payload_extract_options_headers_value import CrawlPayloadExtractOptionsHeadersValue +from nimble_client.models.crawl_payload_extract_options_network_capture_inner import CrawlPayloadExtractOptionsNetworkCaptureInner +from nimble_client.models.crawl_payload_extract_options_parser import CrawlPayloadExtractOptionsParser +from nimble_client.models.crawl_payload_extract_options_render import CrawlPayloadExtractOptionsRender +from nimble_client.models.crawl_payload_extract_options_session import CrawlPayloadExtractOptionsSession +from nimble_client.models.crawl_payload_extract_options_skill import CrawlPayloadExtractOptionsSkill +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractPayload(BaseModel): + """ + ExtractPayload + """ # noqa: E501 + auto_driver_configuration: Optional[Dict[str, Annotated[int, Field(le=10, strict=True, ge=0)]]] = Field(default=None, description="Custom flow for the optimization engine: maps candidate names to the number of attempts to spend on each candidate before advancing (0 skips it). Key order defines the flow order. Providing it opts the request into 'auto' driver selection.") + body: Optional[Any] = Field(default=None, description="Request body for POST, PUT, PATCH methods") + browser: Optional[CrawlPayloadExtractOptionsBrowser] = None + browser_actions: Optional[Annotated[List[BrowserAction], Field(min_length=1)]] = Field(default=None, description="Array of browser automation actions to execute sequentially", json_schema_extra={"examples": [[{"goto": "https://example.com/login"}, {"wait_for_element": "#login-form"}, {"fill": {"selector": "#username", "value": "user@example.com"}}, {"fill": {"selector": "#password", "value": "password123"}}, {"click": "#submit"}, {"screenshot": {"full_page": True}}]]}) + city: Optional[StrictStr] = Field(default=None, description="City for geolocation") + consent_header: Optional[StrictBool] = Field(default=None, description="Whether to automatically handle cookie consent headers") + cookies: Optional[CrawlPayloadExtractOptionsCookies] = None + country: Optional[StrictStr] = Field(default='ALL', description="Country code for geolocation and proxy selection") + device: Optional[StrictStr] = Field(default='desktop', description="Device type for browser emulation") + driver: Optional[StrictStr] = Field(default=None, description="Browser driver to use") + expected_status_codes: Optional[List[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]]] = Field(default=None, description="Expected HTTP status codes for successful requests") + file_parsing_options: Optional[CrawlPayloadExtractOptionsFileParsingOptions] = None + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="List of acceptable response formats in order of preference") + headers: Optional[Dict[str, Optional[CrawlPayloadExtractOptionsHeadersValue]]] = Field(default=None, description="Custom HTTP headers to include in the request") + http2: Optional[StrictBool] = Field(default=False, description="Whether to use HTTP/2 protocol") + is_xhr: Optional[StrictBool] = Field(default=False, description="Whether to emulate XMLHttpRequest behavior") + locale: Optional[StrictStr] = Field(default='en', description="Locale for browser language and region settings") + markdown_backend: Optional[StrictStr] = Field(default='full_page', description="Selects which markdown conversion strategy to use. \"full_page\" converts the entire HTML page. \"main_content\" uses Mozilla Readability to extract the main article content before converting.") + method: Optional[StrictStr] = Field(default='GET', description="HTTP method for the request") + network_capture: Optional[List[CrawlPayloadExtractOptionsNetworkCaptureInner]] = Field(default=None, description="Filters for capturing network traffic") + os: Optional[StrictStr] = Field(default=None, description="Operating system to emulate") + parse: Optional[StrictBool] = Field(default=False, description="Whether to parse the response content") + parser: Optional[CrawlPayloadExtractOptionsParser] = None + realtime_total_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout — it can shorten the deadline but never extend it. Has no effect on async requests.") + referrer_type: Optional[StrictStr] = Field(default=None, description="Referrer policy for the request") + render: Optional[CrawlPayloadExtractOptionsRender] = None + request_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Request timeout in milliseconds") + session: Optional[CrawlPayloadExtractOptionsSession] = None + skill: Optional[CrawlPayloadExtractOptionsSkill] = None + state: Optional[StrictStr] = Field(default=None, description="US state for geolocation (only valid when country is US)") + tag: Optional[StrictStr] = Field(default=None, description="User-defined tag for request identification") + url: StrictStr = Field(description="Target URL to scrape") + __properties: ClassVar[List[str]] = ["auto_driver_configuration", "body", "browser", "browser_actions", "city", "consent_header", "cookies", "country", "device", "driver", "expected_status_codes", "file_parsing_options", "formats", "headers", "http2", "is_xhr", "locale", "markdown_backend", "method", "network_capture", "os", "parse", "parser", "realtime_total_timeout", "referrer_type", "render", "request_timeout", "session", "skill", "state", "tag", "url"] + + @field_validator('country') + def country_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL']): + raise ValueError("must be one of enum values ('AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL')") + return value + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile', 'tablet']): + raise ValueError("must be one of enum values ('desktop', 'mobile', 'tablet')") + return value + + @field_validator('driver') + def driver_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6']): + raise ValueError("must be one of enum values ('auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6')") + return value + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto']): + raise ValueError("must be one of enum values ('aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto')") + return value + + @field_validator('markdown_backend') + def markdown_backend_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['full_page', 'main_content']): + raise ValueError("must be one of enum values ('full_page', 'main_content')") + return value + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']): + raise ValueError("must be one of enum values ('GET', 'POST', 'PUT', 'PATCH', 'DELETE')") + return value + + @field_validator('os') + def os_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['windows', 'mac os', 'linux', 'android', 'ios']): + raise ValueError("must be one of enum values ('windows', 'mac os', 'linux', 'android', 'ios')") + return value + + @field_validator('referrer_type') + def referrer_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram']): + raise ValueError("must be one of enum values ('random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY']): + raise ValueError("must be one of enum values ('AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser + if self.browser: + _dict['browser'] = self.browser.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in browser_actions (list) + _items = [] + if self.browser_actions: + for _item_browser_actions in self.browser_actions: + _items.append(_item_browser_actions.to_dict() if _item_browser_actions is not None else None) + _dict['browser_actions'] = _items + # override the default output from pydantic by calling `to_dict()` of cookies + if self.cookies: + _dict['cookies'] = self.cookies.to_dict() + # override the default output from pydantic by calling `to_dict()` of file_parsing_options + if self.file_parsing_options: + _dict['file_parsing_options'] = self.file_parsing_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in headers (dict) + _field_dict = {} + if self.headers: + for _key_headers in self.headers: + _field_dict[_key_headers] = self.headers[_key_headers].to_dict() if self.headers[_key_headers] is not None else None + _dict['headers'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of each item in network_capture (list) + _items = [] + if self.network_capture: + for _item_network_capture in self.network_capture: + _items.append(_item_network_capture.to_dict() if _item_network_capture is not None else None) + _dict['network_capture'] = _items + # override the default output from pydantic by calling `to_dict()` of parser + if self.parser: + _dict['parser'] = self.parser.to_dict() + # override the default output from pydantic by calling `to_dict()` of render + if self.render: + _dict['render'] = self.render.to_dict() + # override the default output from pydantic by calling `to_dict()` of session + if self.session: + _dict['session'] = self.session.to_dict() + # override the default output from pydantic by calling `to_dict()` of skill + if self.skill: + _dict['skill'] = self.skill.to_dict() + # set to None if body (nullable) is None + # and model_fields_set contains the field + if self.body is None and "body" in self.model_fields_set: + _dict['body'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auto_driver_configuration": obj.get("auto_driver_configuration"), + "body": obj.get("body"), + "browser": CrawlPayloadExtractOptionsBrowser.from_dict(obj["browser"]) if obj.get("browser") is not None else None, + "browser_actions": [BrowserAction.from_dict(_item) for _item in obj["browser_actions"]] if obj.get("browser_actions") is not None else None, + "city": obj.get("city"), + "consent_header": obj.get("consent_header"), + "cookies": CrawlPayloadExtractOptionsCookies.from_dict(obj["cookies"]) if obj.get("cookies") is not None else None, + "country": obj.get("country") if obj.get("country") is not None else 'ALL', + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "driver": obj.get("driver"), + "expected_status_codes": obj.get("expected_status_codes"), + "file_parsing_options": CrawlPayloadExtractOptionsFileParsingOptions.from_dict(obj["file_parsing_options"]) if obj.get("file_parsing_options") is not None else None, + "formats": obj.get("formats"), + "headers": dict( + (_k, CrawlPayloadExtractOptionsHeadersValue.from_dict(_v)) + for _k, _v in obj["headers"].items() + ) + if obj.get("headers") is not None + else None, + "http2": obj.get("http2") if obj.get("http2") is not None else False, + "is_xhr": obj.get("is_xhr") if obj.get("is_xhr") is not None else False, + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', + "markdown_backend": obj.get("markdown_backend") if obj.get("markdown_backend") is not None else 'full_page', + "method": obj.get("method") if obj.get("method") is not None else 'GET', + "network_capture": [CrawlPayloadExtractOptionsNetworkCaptureInner.from_dict(_item) for _item in obj["network_capture"]] if obj.get("network_capture") is not None else None, + "os": obj.get("os"), + "parse": obj.get("parse") if obj.get("parse") is not None else False, + "parser": CrawlPayloadExtractOptionsParser.from_dict(obj["parser"]) if obj.get("parser") is not None else None, + "realtime_total_timeout": obj.get("realtime_total_timeout"), + "referrer_type": obj.get("referrer_type"), + "render": CrawlPayloadExtractOptionsRender.from_dict(obj["render"]) if obj.get("render") is not None else None, + "request_timeout": obj.get("request_timeout"), + "session": CrawlPayloadExtractOptionsSession.from_dict(obj["session"]) if obj.get("session") is not None else None, + "skill": CrawlPayloadExtractOptionsSkill.from_dict(obj["skill"]) if obj.get("skill") is not None else None, + "state": obj.get("state"), + "tag": obj.get("tag"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_template_filter_public_v2.py b/candidate/generated/nimble_client/models/extract_template_filter_public_v2.py new file mode 100644 index 0000000..d42e4dc --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_template_filter_public_v2.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.metadata_filter_public_v2 import MetadataFilterPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractTemplateFilterPublicV2(BaseModel): + """ + ExtractTemplateFilterPublicV2 + """ # noqa: E501 + metadata: Optional[MetadataFilterPublicV2] = Field(default=None, description="Metadata filters to apply.") + __properties: ClassVar[List[str]] = ["metadata"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractTemplateFilterPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractTemplateFilterPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metadata": MetadataFilterPublicV2.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_template_generation_response_public_v2.py b/candidate/generated/nimble_client/models/extract_template_generation_response_public_v2.py new file mode 100644 index 0000000..7342b10 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_template_generation_response_public_v2.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from nimble_client.models.extract_template_version_response_public_v2 import ExtractTemplateVersionResponsePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractTemplateGenerationResponsePublicV2(BaseModel): + """ + ExtractTemplateGenerationResponsePublicV2 + """ # noqa: E501 + completed_at: Optional[datetime] = Field(default=None, description="When the generation completed.") + created_at: Optional[datetime] = Field(default=None, description="When the generation was created.") + error: Optional[StrictStr] = Field(default=None, description="Error message when generation failed.") + generated_version: Optional[ExtractTemplateVersionResponsePublicV2] = Field(default=None, description="Generated version details, when available.") + generated_version_id: Optional[UUID] = Field(default=None, description="Identifier of the generated version.") + id: UUID = Field(description="Unique extract template generation identifier.") + name: Optional[StrictStr] = Field(default=None, description="Extract template name associated with the generation.") + source_version_id: Optional[UUID] = Field(default=None, description="Identifier of the version being refined.") + started_at: Optional[datetime] = Field(default=None, description="When the generation started executing.") + status: StrictStr = Field(description="Current generation status.") + summary: Optional[StrictStr] = Field(default=None, description="Summary of the generation result.") + __properties: ClassVar[List[str]] = ["completed_at", "created_at", "error", "generated_version", "generated_version_id", "id", "name", "source_version_id", "started_at", "status", "summary"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractTemplateGenerationResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of generated_version + if self.generated_version: + _dict['generated_version'] = self.generated_version.to_dict() + # set to None if completed_at (nullable) is None + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: + _dict['completed_at'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if generated_version (nullable) is None + # and model_fields_set contains the field + if self.generated_version is None and "generated_version" in self.model_fields_set: + _dict['generated_version'] = None + + # set to None if generated_version_id (nullable) is None + # and model_fields_set contains the field + if self.generated_version_id is None and "generated_version_id" in self.model_fields_set: + _dict['generated_version_id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if source_version_id (nullable) is None + # and model_fields_set contains the field + if self.source_version_id is None and "source_version_id" in self.model_fields_set: + _dict['source_version_id'] = None + + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict['started_at'] = None + + # set to None if summary (nullable) is None + # and model_fields_set contains the field + if self.summary is None and "summary" in self.model_fields_set: + _dict['summary'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractTemplateGenerationResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "completed_at": obj.get("completed_at"), + "created_at": obj.get("created_at"), + "error": obj.get("error"), + "generated_version": ExtractTemplateVersionResponsePublicV2.from_dict(obj["generated_version"]) if obj.get("generated_version") is not None else None, + "generated_version_id": obj.get("generated_version_id"), + "id": obj.get("id"), + "name": obj.get("name"), + "source_version_id": obj.get("source_version_id"), + "started_at": obj.get("started_at"), + "status": obj.get("status"), + "summary": obj.get("summary") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_template_response_public_v2.py b/candidate/generated/nimble_client/models/extract_template_response_public_v2.py new file mode 100644 index 0000000..68bef9d --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_template_response_public_v2.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from nimble_client.models.extract_template_version_metadata_public_v2 import ExtractTemplateVersionMetadataPublicV2 +from nimble_client.models.extract_template_version_response_public_v2 import ExtractTemplateVersionResponsePublicV2 +from nimble_client.models.privacy_level_public_v2 import PrivacyLevelPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractTemplateResponsePublicV2(BaseModel): + """ + ExtractTemplateResponsePublicV2 + """ # noqa: E501 + created_at: datetime = Field(description="When the extract template was created.") + id: UUID = Field(description="Unique extract template identifier.") + managed_by: Optional[StrictStr] = Field(default=None, description="Who maintains the template (e.g. NIMBLE, COMMUNITY, SELF_MANAGED), when known.") + metadata: Optional[ExtractTemplateVersionMetadataPublicV2] = Field(default=None, description="Catalog metadata for public templates that carry no version payload in list responses.") + name: StrictStr = Field(description="Stable extract template name.") + privacy: Optional[PrivacyLevelPublicV2] = Field(default=None, description="Whether the template is private to the account or from the shared public catalog.") + published_version: Optional[ExtractTemplateVersionResponsePublicV2] = Field(default=None, description="Published version details, when available.") + published_version_id: Optional[UUID] = Field(default=None, description="Identifier of the published version.") + updated_at: datetime = Field(description="When the extract template was last updated.") + __properties: ClassVar[List[str]] = ["created_at", "id", "managed_by", "metadata", "name", "privacy", "published_version", "published_version_id", "updated_at"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractTemplateResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of published_version + if self.published_version: + _dict['published_version'] = self.published_version.to_dict() + # set to None if managed_by (nullable) is None + # and model_fields_set contains the field + if self.managed_by is None and "managed_by" in self.model_fields_set: + _dict['managed_by'] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + + # set to None if privacy (nullable) is None + # and model_fields_set contains the field + if self.privacy is None and "privacy" in self.model_fields_set: + _dict['privacy'] = None + + # set to None if published_version (nullable) is None + # and model_fields_set contains the field + if self.published_version is None and "published_version" in self.model_fields_set: + _dict['published_version'] = None + + # set to None if published_version_id (nullable) is None + # and model_fields_set contains the field + if self.published_version_id is None and "published_version_id" in self.model_fields_set: + _dict['published_version_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractTemplateResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "id": obj.get("id"), + "managed_by": obj.get("managed_by"), + "metadata": ExtractTemplateVersionMetadataPublicV2.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "privacy": obj.get("privacy"), + "published_version": ExtractTemplateVersionResponsePublicV2.from_dict(obj["published_version"]) if obj.get("published_version") is not None else None, + "published_version_id": obj.get("published_version_id"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_template_sample_public_v2.py b/candidate/generated/nimble_client/models/extract_template_sample_public_v2.py new file mode 100644 index 0000000..113993c --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_template_sample_public_v2.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractTemplateSamplePublicV2(BaseModel): + """ + ExtractTemplateSamplePublicV2 + """ # noqa: E501 + input: Optional[Any] = Field(default=None, description="Sample input parameters for the version.") + output: Optional[Any] = Field(default=None, description="Sample output produced by the version.") + __properties: ClassVar[List[str]] = ["input", "output"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractTemplateSamplePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of input + if self.input: + _dict['input'] = self.input.to_dict() + # override the default output from pydantic by calling `to_dict()` of output + if self.output: + _dict['output'] = self.output.to_dict() + # set to None if input (nullable) is None + # and model_fields_set contains the field + if self.input is None and "input" in self.model_fields_set: + _dict['input'] = None + + # set to None if output (nullable) is None + # and model_fields_set contains the field + if self.output is None and "output" in self.model_fields_set: + _dict['output'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractTemplateSamplePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "input": AnyOf.from_dict(obj["input"]) if obj.get("input") is not None else None, + "output": AnyOf.from_dict(obj["output"]) if obj.get("output") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_template_version_metadata_public_v2.py b/candidate/generated/nimble_client/models/extract_template_version_metadata_public_v2.py new file mode 100644 index 0000000..4c55ac5 --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_template_version_metadata_public_v2.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractTemplateVersionMetadataPublicV2(BaseModel): + """ + ExtractTemplateVersionMetadataPublicV2 + """ # noqa: E501 + data_source: Optional[StrictStr] = Field(default=None, description="Data source associated with the version.") + description: Optional[StrictStr] = Field(default=None, description="Version description shown to users.") + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly version display name.") + domain: Optional[StrictStr] = Field(default=None, description="Domain associated with the version.") + entity_type: Optional[StrictStr] = Field(default=None, description="Entity type produced by the version.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Tags associated with the version.") + vertical: Optional[StrictStr] = Field(default=None, description="Business vertical associated with the version.") + __properties: ClassVar[List[str]] = ["data_source", "description", "display_name", "domain", "entity_type", "tags", "vertical"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractTemplateVersionMetadataPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if data_source (nullable) is None + # and model_fields_set contains the field + if self.data_source is None and "data_source" in self.model_fields_set: + _dict['data_source'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if domain (nullable) is None + # and model_fields_set contains the field + if self.domain is None and "domain" in self.model_fields_set: + _dict['domain'] = None + + # set to None if entity_type (nullable) is None + # and model_fields_set contains the field + if self.entity_type is None and "entity_type" in self.model_fields_set: + _dict['entity_type'] = None + + # set to None if vertical (nullable) is None + # and model_fields_set contains the field + if self.vertical is None and "vertical" in self.model_fields_set: + _dict['vertical'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractTemplateVersionMetadataPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_source": obj.get("data_source"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "domain": obj.get("domain"), + "entity_type": obj.get("entity_type"), + "tags": obj.get("tags"), + "vertical": obj.get("vertical") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extract_template_version_response_public_v2.py b/candidate/generated/nimble_client/models/extract_template_version_response_public_v2.py new file mode 100644 index 0000000..b72820f --- /dev/null +++ b/candidate/generated/nimble_client/models/extract_template_version_response_public_v2.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from nimble_client.models.extract_template_sample_public_v2 import ExtractTemplateSamplePublicV2 +from nimble_client.models.extract_template_version_metadata_public_v2 import ExtractTemplateVersionMetadataPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractTemplateVersionResponsePublicV2(BaseModel): + """ + ExtractTemplateVersionResponsePublicV2 + """ # noqa: E501 + created_at: datetime = Field(description="When the version was created.") + id: UUID = Field(description="Unique extract template version identifier.") + input_schema: Dict[str, Any] = Field(description="JSON schema describing accepted input parameters.") + metadata: ExtractTemplateVersionMetadataPublicV2 = Field(description="Metadata associated with this version.") + name: StrictStr = Field(description="Extract template name this version belongs to.") + output_schema: Dict[str, Any] = Field(description="JSON schema describing extracted output.") + samples: Optional[List[ExtractTemplateSamplePublicV2]] = Field(default=None, description="Sample input and output pairs for the version.") + version_number: StrictInt = Field(description="Monotonic version number for the extract template.") + __properties: ClassVar[List[str]] = ["created_at", "id", "input_schema", "metadata", "name", "output_schema", "samples", "version_number"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractTemplateVersionResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in samples (list) + _items = [] + if self.samples: + for _item_samples in self.samples: + _items.append(_item_samples.to_dict() if _item_samples is not None else None) + _dict['samples'] = _items + # set to None if samples (nullable) is None + # and model_fields_set contains the field + if self.samples is None and "samples" in self.model_fields_set: + _dict['samples'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractTemplateVersionResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "id": obj.get("id"), + "input_schema": obj.get("input_schema"), + "metadata": ExtractTemplateVersionMetadataPublicV2.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "output_schema": obj.get("output_schema"), + "samples": [ExtractTemplateSamplePublicV2.from_dict(_item) for _item in obj["samples"]] if obj.get("samples") is not None else None, + "version_number": obj.get("version_number") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extraction_template_batch_body.py b/candidate/generated/nimble_client/models/extraction_template_batch_body.py new file mode 100644 index 0000000..cba20d9 --- /dev/null +++ b/candidate/generated/nimble_client/models/extraction_template_batch_body.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from nimble_client.models.extraction_template_batch_body_inputs_inner import ExtractionTemplateBatchBodyInputsInner +from nimble_client.models.extraction_template_batch_body_shared_inputs import ExtractionTemplateBatchBodySharedInputs +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractionTemplateBatchBody(BaseModel): + """ + Request body for executing a batch of Extraction Template requests + """ # noqa: E501 + inputs: Annotated[List[ExtractionTemplateBatchBodyInputsInner], Field(min_length=1)] + shared_inputs: ExtractionTemplateBatchBodySharedInputs + __properties: ClassVar[List[str]] = ["inputs", "shared_inputs"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractionTemplateBatchBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in inputs (list) + _items = [] + if self.inputs: + for _item_inputs in self.inputs: + _items.append(_item_inputs.to_dict() if _item_inputs is not None else None) + _dict['inputs'] = _items + # override the default output from pydantic by calling `to_dict()` of shared_inputs + if self.shared_inputs: + _dict['shared_inputs'] = self.shared_inputs.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractionTemplateBatchBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "inputs": [ExtractionTemplateBatchBodyInputsInner.from_dict(_item) for _item in obj["inputs"]] if obj.get("inputs") is not None else None, + "shared_inputs": ExtractionTemplateBatchBodySharedInputs.from_dict(obj["shared_inputs"]) if obj.get("shared_inputs") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extraction_template_batch_body_inputs_inner.py b/candidate/generated/nimble_client/models/extraction_template_batch_body_inputs_inner.py new file mode 100644 index 0000000..39190d5 --- /dev/null +++ b/candidate/generated/nimble_client/models/extraction_template_batch_body_inputs_inner.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractionTemplateBatchBodyInputsInner(BaseModel): + """ + ExtractionTemplateBatchBodyInputsInner + """ # noqa: E501 + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="Response formats to include. All disabled by default.") + localization: Optional[StrictBool] = None + params: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["formats", "localization", "params"] + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractionTemplateBatchBodyInputsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractionTemplateBatchBodyInputsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "formats": obj.get("formats"), + "localization": obj.get("localization"), + "params": obj.get("params") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extraction_template_batch_body_shared_inputs.py b/candidate/generated/nimble_client/models/extraction_template_batch_body_shared_inputs.py new file mode 100644 index 0000000..796bc6e --- /dev/null +++ b/candidate/generated/nimble_client/models/extraction_template_batch_body_shared_inputs.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractionTemplateBatchBodySharedInputs(BaseModel): + """ + ExtractionTemplateBatchBodySharedInputs + """ # noqa: E501 + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="Response formats to include. All disabled by default.") + localization: Optional[StrictBool] = None + params: Optional[Dict[str, Any]] = None + template: StrictStr + __properties: ClassVar[List[str]] = ["formats", "localization", "params", "template"] + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractionTemplateBatchBodySharedInputs from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractionTemplateBatchBodySharedInputs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "formats": obj.get("formats"), + "localization": obj.get("localization"), + "params": obj.get("params"), + "template": obj.get("template") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/extraction_template_body.py b/candidate/generated/nimble_client/models/extraction_template_body.py new file mode 100644 index 0000000..1d6d765 --- /dev/null +++ b/candidate/generated/nimble_client/models/extraction_template_body.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ExtractionTemplateBody(BaseModel): + """ + Request body for executing an Extraction Template + """ # noqa: E501 + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="Response formats to include. All disabled by default.") + localization: Optional[StrictBool] = False + params: Dict[str, Any] + template: StrictStr + __properties: ClassVar[List[str]] = ["formats", "localization", "params", "template"] + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractionTemplateBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractionTemplateBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "formats": obj.get("formats"), + "localization": obj.get("localization") if obj.get("localization") is not None else False, + "params": obj.get("params"), + "template": obj.get("template") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/fetch_action.py b/candidate/generated/nimble_client/models/fetch_action.py new file mode 100644 index 0000000..27912e6 --- /dev/null +++ b/candidate/generated/nimble_client/models/fetch_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.fetch_action_fetch import FetchActionFetch +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FetchAction(BaseModel): + """ + Make an HTTP request in browser context + """ # noqa: E501 + fetch: FetchActionFetch + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["fetch"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FetchAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of fetch + if self.fetch: + _dict['fetch'] = self.fetch.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FetchAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fetch": FetchActionFetch.from_dict(obj["fetch"]) if obj.get("fetch") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/fetch_action_fetch.py b/candidate/generated/nimble_client/models/fetch_action_fetch.py new file mode 100644 index 0000000..ac0ba40 --- /dev/null +++ b/candidate/generated/nimble_client/models/fetch_action_fetch.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.fetch_action_fetch_one_of import FetchActionFetchOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +FETCHACTIONFETCH_ONE_OF_SCHEMAS = ["FetchActionFetchOneOf", "str"] + +class FetchActionFetch(BaseModel): + """ + FetchActionFetch + """ + # data type: str + oneof_schema_1_validator: Optional[StrictStr] = Field(default=None, description="URL for downloading the task results.") + # data type: FetchActionFetchOneOf + oneof_schema_2_validator: Optional[FetchActionFetchOneOf] = None + actual_instance: Optional[Union[FetchActionFetchOneOf, str]] = None + one_of_schemas: Set[str] = { "FetchActionFetchOneOf", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = FetchActionFetch.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: FetchActionFetchOneOf + if not isinstance(v, FetchActionFetchOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `FetchActionFetchOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in FetchActionFetch with oneOf schemas: FetchActionFetchOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in FetchActionFetch with oneOf schemas: FetchActionFetchOneOf, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into str + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into FetchActionFetchOneOf + try: + instance.actual_instance = FetchActionFetchOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into FetchActionFetch with oneOf schemas: FetchActionFetchOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into FetchActionFetch with oneOf schemas: FetchActionFetchOneOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], FetchActionFetchOneOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/fetch_action_fetch_one_of.py b/candidate/generated/nimble_client/models/fetch_action_fetch_one_of.py new file mode 100644 index 0000000..e4a6f71 --- /dev/null +++ b/candidate/generated/nimble_client/models/fetch_action_fetch_one_of.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FetchActionFetchOneOf(BaseModel): + """ + FetchActionFetchOneOf + """ # noqa: E501 + body: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + headers: Optional[Dict[str, StrictStr]] = None + method: Optional[StrictStr] = None + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=15000, description="Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.") + url: Optional[StrictStr] = Field(description="URL for downloading the task results.") + __properties: ClassVar[List[str]] = ["body", "headers", "method", "required", "skip", "timeout", "url"] + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH']): + raise ValueError("must be one of enum values ('GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FetchActionFetchOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + # set to None if body (nullable) is None + # and model_fields_set contains the field + if self.body is None and "body" in self.model_fields_set: + _dict['body'] = None + + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FetchActionFetchOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "body": obj.get("body"), + "headers": obj.get("headers"), + "method": obj.get("method"), + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "timeout": obj.get("timeout") if obj.get("timeout") is not None else 15000, + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/fill_action.py b/candidate/generated/nimble_client/models/fill_action.py new file mode 100644 index 0000000..ac8b500 --- /dev/null +++ b/candidate/generated/nimble_client/models/fill_action.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.fill_options import FillOptions +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FillAction(BaseModel): + """ + Fill text into an input field + """ # noqa: E501 + fill: FillOptions + __properties: ClassVar[List[str]] = ["fill"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FillAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of fill + if self.fill: + _dict['fill'] = self.fill.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FillAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fill": FillOptions.from_dict(obj["fill"]) if obj.get("fill") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/fill_options.py b/candidate/generated/nimble_client/models/fill_options.py new file mode 100644 index 0000000..44eff4f --- /dev/null +++ b/candidate/generated/nimble_client/models/fill_options.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.fill_options_one_of import FillOptionsOneOf +from nimble_client.models.fill_options_one_of1 import FillOptionsOneOf1 +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +FILLOPTIONS_ONE_OF_SCHEMAS = ["FillOptionsOneOf", "FillOptionsOneOf1"] + +class FillOptions(BaseModel): + """ + Fill options with mode-specific fields. Use \"type\" mode for behavioral typing simulation, or \"paste\" mode for instant paste. + """ + # data type: FillOptionsOneOf + oneof_schema_1_validator: Optional[FillOptionsOneOf] = None + # data type: FillOptionsOneOf1 + oneof_schema_2_validator: Optional[FillOptionsOneOf1] = None + actual_instance: Optional[Union[FillOptionsOneOf, FillOptionsOneOf1]] = None + one_of_schemas: Set[str] = { "FillOptionsOneOf", "FillOptionsOneOf1" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = FillOptions.model_construct() + error_messages = [] + match = 0 + # validate data type: FillOptionsOneOf + if not isinstance(v, FillOptionsOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `FillOptionsOneOf`") + else: + match += 1 + # validate data type: FillOptionsOneOf1 + if not isinstance(v, FillOptionsOneOf1): + error_messages.append(f"Error! Input type `{type(v)}` is not `FillOptionsOneOf1`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in FillOptions with oneOf schemas: FillOptionsOneOf, FillOptionsOneOf1. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in FillOptions with oneOf schemas: FillOptionsOneOf, FillOptionsOneOf1. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into FillOptionsOneOf + try: + instance.actual_instance = FillOptionsOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into FillOptionsOneOf1 + try: + instance.actual_instance = FillOptionsOneOf1.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into FillOptions with oneOf schemas: FillOptionsOneOf, FillOptionsOneOf1. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into FillOptions with oneOf schemas: FillOptionsOneOf, FillOptionsOneOf1. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], FillOptionsOneOf, FillOptionsOneOf1]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/fill_options_one_of.py b/candidate/generated/nimble_client/models/fill_options_one_of.py new file mode 100644 index 0000000..2b3232b --- /dev/null +++ b/candidate/generated/nimble_client/models/fill_options_one_of.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.duration import Duration +from nimble_client.models.selector import Selector +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FillOptionsOneOf(BaseModel): + """ + FillOptionsOneOf + """ # noqa: E501 + click_on_element: Optional[StrictBool] = True + delay: Optional[Duration] = None + mode: Optional[StrictStr] = 'type' + mouse_movement_strategy: Optional[StrictStr] = None + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + scroll: Optional[StrictBool] = True + selector: Selector + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=15000, description="Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.") + typing_interval: Optional[Duration] = None + typing_strategy: Optional[StrictStr] = None + value: Annotated[str, Field(min_length=1, strict=True)] + visible: Optional[StrictBool] = True + __properties: ClassVar[List[str]] = ["click_on_element", "delay", "mode", "mouse_movement_strategy", "required", "scroll", "selector", "skip", "timeout", "typing_interval", "typing_strategy", "value", "visible"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['type']): + raise ValueError("must be one of enum values ('type')") + return value + + @field_validator('mouse_movement_strategy') + def mouse_movement_strategy_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['linear', 'ghost-cursor', 'windmouse']): + raise ValueError("must be one of enum values ('linear', 'ghost-cursor', 'windmouse')") + return value + + @field_validator('typing_strategy') + def typing_strategy_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['simple', 'distribution']): + raise ValueError("must be one of enum values ('simple', 'distribution')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FillOptionsOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of delay + if self.delay: + _dict['delay'] = self.delay.to_dict() + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of selector + if self.selector: + _dict['selector'] = self.selector.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + # override the default output from pydantic by calling `to_dict()` of typing_interval + if self.typing_interval: + _dict['typing_interval'] = self.typing_interval.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FillOptionsOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "click_on_element": obj.get("click_on_element") if obj.get("click_on_element") is not None else True, + "delay": Duration.from_dict(obj["delay"]) if obj.get("delay") is not None else None, + "mode": obj.get("mode") if obj.get("mode") is not None else 'type', + "mouse_movement_strategy": obj.get("mouse_movement_strategy"), + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "scroll": obj.get("scroll") if obj.get("scroll") is not None else True, + "selector": Selector.from_dict(obj["selector"]) if obj.get("selector") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "timeout": obj.get("timeout") if obj.get("timeout") is not None else 15000, + "typing_interval": Duration.from_dict(obj["typing_interval"]) if obj.get("typing_interval") is not None else None, + "typing_strategy": obj.get("typing_strategy"), + "value": obj.get("value"), + "visible": obj.get("visible") if obj.get("visible") is not None else True + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/fill_options_one_of1.py b/candidate/generated/nimble_client/models/fill_options_one_of1.py new file mode 100644 index 0000000..f0e480f --- /dev/null +++ b/candidate/generated/nimble_client/models/fill_options_one_of1.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.duration import Duration +from nimble_client.models.selector import Selector +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FillOptionsOneOf1(BaseModel): + """ + FillOptionsOneOf1 + """ # noqa: E501 + click_on_element: Optional[StrictBool] = True + delay: Optional[Duration] = None + mode: StrictStr + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + scroll: Optional[StrictBool] = True + selector: Selector + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=15000, description="Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.") + value: Annotated[str, Field(min_length=1, strict=True)] + visible: Optional[StrictBool] = True + __properties: ClassVar[List[str]] = ["click_on_element", "delay", "mode", "required", "scroll", "selector", "skip", "timeout", "value", "visible"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['paste']): + raise ValueError("must be one of enum values ('paste')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FillOptionsOneOf1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of delay + if self.delay: + _dict['delay'] = self.delay.to_dict() + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of selector + if self.selector: + _dict['selector'] = self.selector.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FillOptionsOneOf1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "click_on_element": obj.get("click_on_element") if obj.get("click_on_element") is not None else True, + "delay": Duration.from_dict(obj["delay"]) if obj.get("delay") is not None else None, + "mode": obj.get("mode"), + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "scroll": obj.get("scroll") if obj.get("scroll") is not None else True, + "selector": Selector.from_dict(obj["selector"]) if obj.get("selector") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "timeout": obj.get("timeout") if obj.get("timeout") is not None else 15000, + "value": obj.get("value"), + "visible": obj.get("visible") if obj.get("visible") is not None else True + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/focus.py b/candidate/generated/nimble_client/models/focus.py new file mode 100644 index 0000000..97e5327 --- /dev/null +++ b/candidate/generated/nimble_client/models/focus.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +FOCUS_ANY_OF_SCHEMAS = ["List[str]", "str"] + +class Focus(BaseModel): + """ + Search focus mode (e.g., 'general', 'news', 'shopping') or a list of explicit subagent names (e.g., ['amazon_serp', 'target_serp']) + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + # data type: List[str] + anyof_schema_2_validator: Optional[List[Optional[StrictStr]]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[List[str], str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "List[str]", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Focus.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[str] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Focus with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[str] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Focus with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[str], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/full_template_public_v1.py b/candidate/generated/nimble_client/models/full_template_public_v1.py new file mode 100644 index 0000000..5605322 --- /dev/null +++ b/candidate/generated/nimble_client/models/full_template_public_v1.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.template_feature_flags_public_v1 import TemplateFeatureFlagsPublicV1 +from nimble_client.models.template_input_property_public_v1 import TemplateInputPropertyPublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FullTemplatePublicV1(BaseModel): + """ + FullTemplatePublicV1 + """ # noqa: E501 + description: Optional[StrictStr] = None + display_name: StrictStr + domain: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + entity_type: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + feature_flags: Optional[TemplateFeatureFlagsPublicV1] = None + input_properties: Optional[List[TemplateInputPropertyPublicV1]] = None + is_public: StrictBool + managed_by: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + name: StrictStr + output_schema: Optional[Dict[str, Any]] = None + vertical: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + __properties: ClassVar[List[str]] = ["description", "display_name", "domain", "entity_type", "feature_flags", "input_properties", "is_public", "managed_by", "name", "output_schema", "vertical"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FullTemplatePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of feature_flags + if self.feature_flags: + _dict['feature_flags'] = self.feature_flags.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in input_properties (list) + _items = [] + if self.input_properties: + for _item_input_properties in self.input_properties: + _items.append(_item_input_properties.to_dict() if _item_input_properties is not None else None) + _dict['input_properties'] = _items + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if domain (nullable) is None + # and model_fields_set contains the field + if self.domain is None and "domain" in self.model_fields_set: + _dict['domain'] = None + + # set to None if entity_type (nullable) is None + # and model_fields_set contains the field + if self.entity_type is None and "entity_type" in self.model_fields_set: + _dict['entity_type'] = None + + # set to None if input_properties (nullable) is None + # and model_fields_set contains the field + if self.input_properties is None and "input_properties" in self.model_fields_set: + _dict['input_properties'] = None + + # set to None if managed_by (nullable) is None + # and model_fields_set contains the field + if self.managed_by is None and "managed_by" in self.model_fields_set: + _dict['managed_by'] = None + + # set to None if output_schema (nullable) is None + # and model_fields_set contains the field + if self.output_schema is None and "output_schema" in self.model_fields_set: + _dict['output_schema'] = None + + # set to None if vertical (nullable) is None + # and model_fields_set contains the field + if self.vertical is None and "vertical" in self.model_fields_set: + _dict['vertical'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FullTemplatePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "domain": obj.get("domain"), + "entity_type": obj.get("entity_type"), + "feature_flags": TemplateFeatureFlagsPublicV1.from_dict(obj["feature_flags"]) if obj.get("feature_flags") is not None else None, + "input_properties": [TemplateInputPropertyPublicV1.from_dict(_item) for _item in obj["input_properties"]] if obj.get("input_properties") is not None else None, + "is_public": obj.get("is_public"), + "managed_by": obj.get("managed_by"), + "name": obj.get("name"), + "output_schema": obj.get("output_schema"), + "vertical": obj.get("vertical") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/funding_round.py b/candidate/generated/nimble_client/models/funding_round.py new file mode 100644 index 0000000..b0e2c83 --- /dev/null +++ b/candidate/generated/nimble_client/models/funding_round.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.amount import Amount +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FundingRound(BaseModel): + """ + FundingRound + """ # noqa: E501 + amount: Optional[Amount] = None + var_date: Optional[StrictStr] = Field(default=None, description="ISO date, YYYY-MM-DD", alias="date") + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["amount", "date", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FundingRound from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of amount + if self.amount: + _dict['amount'] = self.amount.to_dict() + # set to None if amount (nullable) is None + # and model_fields_set contains the field + if self.amount is None and "amount" in self.model_fields_set: + _dict['amount'] = None + + # set to None if var_date (nullable) is None + # and model_fields_set contains the field + if self.var_date is None and "var_date" in self.model_fields_set: + _dict['date'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FundingRound from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "amount": Amount.from_dict(obj["amount"]) if obj.get("amount") is not None else None, + "date": obj.get("date"), + "name": obj.get("name") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/funding_total.py b/candidate/generated/nimble_client/models/funding_total.py new file mode 100644 index 0000000..1ccfdf3 --- /dev/null +++ b/candidate/generated/nimble_client/models/funding_total.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +FUNDINGTOTAL_ANY_OF_SCHEMAS = ["float", "int"] + +class FundingTotal(BaseModel): + """ + USD + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: float + anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, int]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "float", "int" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = FundingTotal.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in FundingTotal with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into FundingTotal with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/gateway_def033cecba0ba3d1d3_text_run_trust.py b/candidate/generated/nimble_client/models/gateway_def033cecba0ba3d1d3_text_run_trust.py new file mode 100644 index 0000000..a36b70d --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def033cecba0ba3d1d3_text_run_trust.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def74786d0cba87c515_trust_source import GatewayDef74786d0cba87c515TrustSource +from nimble_client.models.gateway_def_fb397fec4dcf2a13_text_claim_trust import GatewayDefFb397fec4dcf2a13TextClaimTrust +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef033cecba0ba3d1d3TextRunTrust(BaseModel): + """ + Trust metadata for a prose answer: run-level confidence plus per-claim citations. + """ # noqa: E501 + claims: List[GatewayDefFb397fec4dcf2a13TextClaimTrust] = Field(description="Per-claim trust, keyed by callout markers in the answer text.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Overall confidence in the answer.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + sources: List[GatewayDef74786d0cba87c515TrustSource] = Field(description="Sources consulted while producing the answer.") + __properties: ClassVar[List[str]] = ["claims", "confidence", "reasoning", "sources"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef033cecba0ba3d1d3TextRunTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in claims (list) + _items = [] + if self.claims: + for _item_claims in self.claims: + _items.append(_item_claims.to_dict() if _item_claims is not None else None) + _dict['claims'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef033cecba0ba3d1d3TextRunTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "claims": [GatewayDefFb397fec4dcf2a13TextClaimTrust.from_dict(_item) for _item in obj["claims"]] if obj.get("claims") is not None else None, + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "sources": [GatewayDef74786d0cba87c515TrustSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def07f3b31eb3e5e2cb_trust_confidence.py b/candidate/generated/nimble_client/models/gateway_def07f3b31eb3e5e2cb_trust_confidence.py new file mode 100644 index 0000000..525284c --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def07f3b31eb3e5e2cb_trust_confidence.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class GatewayDef07f3b31eb3e5e2cbTrustConfidence(str, Enum): + """ + GatewayDef07f3b31eb3e5e2cbTrustConfidence + """ + + """ + allowed enum values + """ + HIGH = 'high' + MEDIUM = 'medium' + LOW = 'low' + PRE_EXISTING = 'pre_existing' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GatewayDef07f3b31eb3e5e2cbTrustConfidence from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/gateway_def07f55f9a59071b48_json_claim_trust.py b/candidate/generated/nimble_client/models/gateway_def07f55f9a59071b48_json_claim_trust.py new file mode 100644 index 0000000..570d6b9 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def07f55f9a59071b48_json_claim_trust.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def_f23bf5d9e6e07ed3_trust_citation import GatewayDefF23bf5d9e6e07ed3TrustCitation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef07f55f9a59071b48JsonClaimTrust(BaseModel): + """ + Trust metadata for one value in a structured (JSON) answer, keyed by JSON path. + """ # noqa: E501 + citations: List[GatewayDefF23bf5d9e6e07ed3TrustCitation] = Field(description="Citations backing this value.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Confidence in this value.") + path: StrictStr = Field(description="JSON path of the value in the structured output this claim refers to.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + __properties: ClassVar[List[str]] = ["citations", "confidence", "path", "reasoning"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef07f55f9a59071b48JsonClaimTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in citations (list) + _items = [] + if self.citations: + for _item_citations in self.citations: + _items.append(_item_citations.to_dict() if _item_citations is not None else None) + _dict['citations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef07f55f9a59071b48JsonClaimTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "citations": [GatewayDefF23bf5d9e6e07ed3TrustCitation.from_dict(_item) for _item in obj["citations"]] if obj.get("citations") is not None else None, + "confidence": obj.get("confidence"), + "path": obj.get("path"), + "reasoning": obj.get("reasoning") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def0ce4e48f62cadb20_task_run_progress_stats_event.py b/candidate/generated/nimble_client/models/gateway_def0ce4e48f62cadb20_task_run_progress_stats_event.py new file mode 100644 index 0000000..95e46ee --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def0ce4e48f62cadb20_task_run_progress_stats_event.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def386b2024130bc052_task_run_source_stats import GatewayDef386b2024130bc052TaskRunSourceStats +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef0ce4e48f62cadb20TaskRunProgressStatsEvent(BaseModel): + """ + Point-in-time snapshot of source counts across all parallel search agents. + """ # noqa: E501 + source_stats: GatewayDef386b2024130bc052TaskRunSourceStats + type: Optional[StrictStr] = 'task_run.progress_stats' + __properties: ClassVar[List[str]] = ["source_stats", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['task_run.progress_stats']): + raise ValueError("must be one of enum values ('task_run.progress_stats')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef0ce4e48f62cadb20TaskRunProgressStatsEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of source_stats + if self.source_stats: + _dict['source_stats'] = self.source_stats.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef0ce4e48f62cadb20TaskRunProgressStatsEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "source_stats": GatewayDef386b2024130bc052TaskRunSourceStats.from_dict(obj["source_stats"]) if obj.get("source_stats") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'task_run.progress_stats' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def1d511972aa34af3c_source_category.py b/candidate/generated/nimble_client/models/gateway_def1d511972aa34af3c_source_category.py new file mode 100644 index 0000000..ab9525c --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def1d511972aa34af3c_source_category.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class GatewayDef1d511972aa34af3cSourceCategory(str, Enum): + """ + What *kind* of source this is (classified by the compress LLM), independent of TrustSourceType (how authoritative it is for a specific claim). Deliberately uses \"official\" rather than \"primary\" so the two axes can never collide. Also doubles as the sub-question's ``source_intent`` (what kind of source a question *needs*) — the two concepts overlap enough that a single enum lets ``classify_source_importance`` compare \"what we got\" against \"what we asked for\" directly. ``description`` is the operational definition of the category, written against *what the page is*, not what the question wanted — the classifier's judging criteria. + """ + + """ + allowed enum values + """ + OFFICIAL = 'official' + NEWS = 'news' + SOCIAL = 'social' + ACADEMIC = 'academic' + AGGREGATOR = 'aggregator' + MARKETPLACE = 'marketplace' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GatewayDef1d511972aa34af3cSourceCategory from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/gateway_def21e0e16cb4d7d291_task_run_text_output.py b/candidate/generated/nimble_client/models/gateway_def21e0e16cb4d7d291_task_run_text_output.py new file mode 100644 index 0000000..f8c0330 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def21e0e16cb4d7d291_task_run_text_output.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def30520b8ccd213fdc_text_run_trust import GatewayDef30520b8ccd213fdcTextRunTrust +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef21e0e16cb4d7d291TaskRunTextOutput(BaseModel): + """ + Text output from a completed task. + """ # noqa: E501 + content: StrictStr = Field(description="The final prose answer.") + sources: Optional[List[GatewayDef3a5c7c6bfa027c89TaskRunOutputSource]] = Field(default=None, description="Sources the output cites, deduplicated by URL in citation order. Always present, including when trust is off (`trust: null`); `trust.sources` adds primary/secondary classification on full_trust runs.") + trust: Optional[GatewayDef30520b8ccd213fdcTextRunTrust] + type: Optional[StrictStr] = 'text' + __properties: ClassVar[List[str]] = ["content", "sources", "trust", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['text']): + raise ValueError("must be one of enum values ('text')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef21e0e16cb4d7d291TaskRunTextOutput from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of trust + if self.trust: + _dict['trust'] = self.trust.to_dict() + # set to None if trust (nullable) is None + # and model_fields_set contains the field + if self.trust is None and "trust" in self.model_fields_set: + _dict['trust'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef21e0e16cb4d7d291TaskRunTextOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": obj.get("content"), + "sources": [GatewayDef3a5c7c6bfa027c89TaskRunOutputSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "trust": GatewayDef30520b8ccd213fdcTextRunTrust.from_dict(obj["trust"]) if obj.get("trust") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'text' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def2e37feaa5480a045_task_run_json_output.py b/candidate/generated/nimble_client/models/gateway_def2e37feaa5480a045_task_run_json_output.py new file mode 100644 index 0000000..096432d --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def2e37feaa5480a045_task_run_json_output.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.content import Content +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from nimble_client.models.gateway_def_a7c1b2a8ffcc3b45_json_run_trust import GatewayDefA7c1b2a8ffcc3b45JsonRunTrust +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef2e37feaa5480a045TaskRunJsonOutput(BaseModel): + """ + Structured JSON output from a completed task, produced when task_spec.output_schema.type is 'json'. + """ # noqa: E501 + content: Content + sources: Optional[List[GatewayDef3a5c7c6bfa027c89TaskRunOutputSource]] = Field(default=None, description="Sources the output cites, deduplicated by URL in citation order. Always present, including when trust is off (`trust: null`); `trust.sources` adds primary/secondary classification on full_trust runs.") + trust: Optional[GatewayDefA7c1b2a8ffcc3b45JsonRunTrust] + type: Optional[StrictStr] = 'json' + __properties: ClassVar[List[str]] = ["content", "sources", "trust", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['json']): + raise ValueError("must be one of enum values ('json')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef2e37feaa5480a045TaskRunJsonOutput from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict['content'] = self.content.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of trust + if self.trust: + _dict['trust'] = self.trust.to_dict() + # set to None if trust (nullable) is None + # and model_fields_set contains the field + if self.trust is None and "trust" in self.model_fields_set: + _dict['trust'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef2e37feaa5480a045TaskRunJsonOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": Content.from_dict(obj["content"]) if obj.get("content") is not None else None, + "sources": [GatewayDef3a5c7c6bfa027c89TaskRunOutputSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "trust": GatewayDefA7c1b2a8ffcc3b45JsonRunTrust.from_dict(obj["trust"]) if obj.get("trust") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'json' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def30520b8ccd213fdc_text_run_trust.py b/candidate/generated/nimble_client/models/gateway_def30520b8ccd213fdc_text_run_trust.py new file mode 100644 index 0000000..fcb516a --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def30520b8ccd213fdc_text_run_trust.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def3b1480fbbf8bec18_text_claim_trust import GatewayDef3b1480fbbf8bec18TextClaimTrust +from nimble_client.models.gateway_def_ce9019f9e67ae903_trust_source import GatewayDefCe9019f9e67ae903TrustSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef30520b8ccd213fdcTextRunTrust(BaseModel): + """ + Trust metadata for a prose answer: run-level confidence plus per-claim citations. + """ # noqa: E501 + claims: List[GatewayDef3b1480fbbf8bec18TextClaimTrust] = Field(description="Per-claim trust, keyed by callout markers in the answer text.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Overall confidence in the answer.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + sources: List[GatewayDefCe9019f9e67ae903TrustSource] = Field(description="Sources consulted while producing the answer.") + __properties: ClassVar[List[str]] = ["claims", "confidence", "reasoning", "sources"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef30520b8ccd213fdcTextRunTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in claims (list) + _items = [] + if self.claims: + for _item_claims in self.claims: + _items.append(_item_claims.to_dict() if _item_claims is not None else None) + _dict['claims'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef30520b8ccd213fdcTextRunTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "claims": [GatewayDef3b1480fbbf8bec18TextClaimTrust.from_dict(_item) for _item in obj["claims"]] if obj.get("claims") is not None else None, + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "sources": [GatewayDefCe9019f9e67ae903TrustSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def386b2024130bc052_task_run_source_stats.py b/candidate/generated/nimble_client/models/gateway_def386b2024130bc052_task_run_source_stats.py new file mode 100644 index 0000000..2cedc26 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def386b2024130bc052_task_run_source_stats.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef386b2024130bc052TaskRunSourceStats(BaseModel): + """ + GatewayDef386b2024130bc052TaskRunSourceStats + """ # noqa: E501 + num_sources_considered: Optional[StrictInt] = 0 + num_sources_read: Optional[StrictInt] = 0 + sources_read_sample: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["num_sources_considered", "num_sources_read", "sources_read_sample"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef386b2024130bc052TaskRunSourceStats from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef386b2024130bc052TaskRunSourceStats from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "num_sources_considered": obj.get("num_sources_considered") if obj.get("num_sources_considered") is not None else 0, + "num_sources_read": obj.get("num_sources_read") if obj.get("num_sources_read") is not None else 0, + "sources_read_sample": obj.get("sources_read_sample") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def3a5c7c6bfa027c89_task_run_output_source.py b/candidate/generated/nimble_client/models/gateway_def3a5c7c6bfa027c89_task_run_output_source.py new file mode 100644 index 0000000..5115aef --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def3a5c7c6bfa027c89_task_run_output_source.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef3a5c7c6bfa027c89TaskRunOutputSource(BaseModel): + """ + A source the output cites. Present in every trust mode, unlike ``trust.sources``. + """ # noqa: E501 + title: Optional[StrictStr] = None + url: StrictStr + __properties: ClassVar[List[str]] = ["title", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef3a5c7c6bfa027c89TaskRunOutputSource from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef3a5c7c6bfa027c89TaskRunOutputSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def3b1480fbbf8bec18_text_claim_trust.py b/candidate/generated/nimble_client/models/gateway_def3b1480fbbf8bec18_text_claim_trust.py new file mode 100644 index 0000000..62d3778 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def3b1480fbbf8bec18_text_claim_trust.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def977107e4b1c6ce11_trust_citation import GatewayDef977107e4b1c6ce11TrustCitation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef3b1480fbbf8bec18TextClaimTrust(BaseModel): + """ + Trust metadata for one claim in a prose answer, keyed by callout marker. + """ # noqa: E501 + callout: StrictInt = Field(description="Callout marker number referencing this claim in the answer text.") + citations: List[GatewayDef977107e4b1c6ce11TrustCitation] = Field(description="Citations backing this claim.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Confidence in this claim.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + __properties: ClassVar[List[str]] = ["callout", "citations", "confidence", "reasoning"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef3b1480fbbf8bec18TextClaimTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in citations (list) + _items = [] + if self.citations: + for _item_citations in self.citations: + _items.append(_item_citations.to_dict() if _item_citations is not None else None) + _dict['citations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef3b1480fbbf8bec18TextClaimTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callout": obj.get("callout"), + "citations": [GatewayDef977107e4b1c6ce11TrustCitation.from_dict(_item) for _item in obj["citations"]] if obj.get("citations") is not None else None, + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def4f3b7ab2bb4e1911_task_run_progress_msg_event.py b/candidate/generated/nimble_client/models/gateway_def4f3b7ab2bb4e1911_task_run_progress_msg_event.py new file mode 100644 index 0000000..e7d7ff4 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def4f3b7ab2bb4e1911_task_run_progress_msg_event.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent(BaseModel): + """ + Reasoning message emitted during execution (exec_status / plan / tool). + """ # noqa: E501 + message: StrictStr + timestamp: StrictStr + type: StrictStr = Field(description="Which reasoning phase this message reports on.") + __properties: ClassVar[List[str]] = ["message", "timestamp", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['task_run.progress_msg.exec_status', 'task_run.progress_msg.plan', 'task_run.progress_msg.tool']): + raise ValueError("must be one of enum values ('task_run.progress_msg.exec_status', 'task_run.progress_msg.plan', 'task_run.progress_msg.tool')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message"), + "timestamp": obj.get("timestamp"), + "type": obj.get("type") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def54179423f3a3b0a8_json_claim_trust.py b/candidate/generated/nimble_client/models/gateway_def54179423f3a3b0a8_json_claim_trust.py new file mode 100644 index 0000000..e453ccd --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def54179423f3a3b0a8_json_claim_trust.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def977107e4b1c6ce11_trust_citation import GatewayDef977107e4b1c6ce11TrustCitation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef54179423f3a3b0a8JsonClaimTrust(BaseModel): + """ + Trust metadata for one value in a structured (JSON) answer, keyed by JSON path. + """ # noqa: E501 + citations: List[GatewayDef977107e4b1c6ce11TrustCitation] = Field(description="Citations backing this value.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Confidence in this value.") + path: StrictStr = Field(description="JSON path of the value in the structured output this claim refers to.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + __properties: ClassVar[List[str]] = ["citations", "confidence", "path", "reasoning"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef54179423f3a3b0a8JsonClaimTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in citations (list) + _items = [] + if self.citations: + for _item_citations in self.citations: + _items.append(_item_citations.to_dict() if _item_citations is not None else None) + _dict['citations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef54179423f3a3b0a8JsonClaimTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "citations": [GatewayDef977107e4b1c6ce11TrustCitation.from_dict(_item) for _item in obj["citations"]] if obj.get("citations") is not None else None, + "confidence": obj.get("confidence"), + "path": obj.get("path"), + "reasoning": obj.get("reasoning") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def6651fbad4f19182d_task_run_status_value.py b/candidate/generated/nimble_client/models/gateway_def6651fbad4f19182d_task_run_status_value.py new file mode 100644 index 0000000..c8b3d12 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def6651fbad4f19182d_task_run_status_value.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class GatewayDef6651fbad4f19182dTaskRunStatusValue(str, Enum): + """ + Lowercase status values used in API responses (distinct from the DB-level TaskRunStatus enum). + """ + + """ + allowed enum values + """ + QUEUED = 'queued' + RUNNING = 'running' + COMPLETED = 'completed' + FAILED = 'failed' + CANCELLED = 'cancelled' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GatewayDef6651fbad4f19182dTaskRunStatusValue from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/gateway_def6d6a3bc063952be8_task_run_state_event.py b/candidate/generated/nimble_client/models/gateway_def6d6a3bc063952be8_task_run_state_event.py new file mode 100644 index 0000000..aad4dda --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def6d6a3bc063952be8_task_run_state_event.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def_d1833882d7d67018_task_run_state_event_run import GatewayDefD1833882d7d67018TaskRunStateEventRun +from nimble_client.models.output import Output +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef6d6a3bc063952be8TaskRunStateEvent(BaseModel): + """ + Run status transition, published on start/completion/failure/cancellation. + """ # noqa: E501 + output: Optional[Output] = None + run: GatewayDefD1833882d7d67018TaskRunStateEventRun + type: Optional[StrictStr] = 'task_run.state' + __properties: ClassVar[List[str]] = ["output", "run", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['task_run.state']): + raise ValueError("must be one of enum values ('task_run.state')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef6d6a3bc063952be8TaskRunStateEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of output + if self.output: + _dict['output'] = self.output.to_dict() + # override the default output from pydantic by calling `to_dict()` of run + if self.run: + _dict['run'] = self.run.to_dict() + # set to None if output (nullable) is None + # and model_fields_set contains the field + if self.output is None and "output" in self.model_fields_set: + _dict['output'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef6d6a3bc063952be8TaskRunStateEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "output": Output.from_dict(obj["output"]) if obj.get("output") is not None else None, + "run": GatewayDefD1833882d7d67018TaskRunStateEventRun.from_dict(obj["run"]) if obj.get("run") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'task_run.state' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def74786d0cba87c515_trust_source.py b/candidate/generated/nimble_client/models/gateway_def74786d0cba87c515_trust_source.py new file mode 100644 index 0000000..c17d539 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def74786d0cba87c515_trust_source.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def1d511972aa34af3c_source_category import GatewayDef1d511972aa34af3cSourceCategory +from nimble_client.models.gateway_def7feddd7d853a299b_trust_source_type import GatewayDef7feddd7d853a299bTrustSourceType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef74786d0cba87c515TrustSource(BaseModel): + """ + A source consulted while producing the answer. + """ # noqa: E501 + extract_template_name: Optional[StrictStr] = Field(default=None, description="Extract template used to read the source, when one was used.") + source_category: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source: official, news, social, academic, aggregator, marketplace, or other.") + source_intent: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source the underlying question asked for.") + title: Optional[StrictStr] = Field(default=None, description="Title of the source page.") + type: GatewayDef7feddd7d853a299bTrustSourceType = Field(description="How authoritative the source is: 'primary' or 'secondary'.") + url: StrictStr = Field(description="URL of the source page.") + __properties: ClassVar[List[str]] = ["extract_template_name", "source_category", "source_intent", "title", "type", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef74786d0cba87c515TrustSource from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if extract_template_name (nullable) is None + # and model_fields_set contains the field + if self.extract_template_name is None and "extract_template_name" in self.model_fields_set: + _dict['extract_template_name'] = None + + # set to None if source_category (nullable) is None + # and model_fields_set contains the field + if self.source_category is None and "source_category" in self.model_fields_set: + _dict['source_category'] = None + + # set to None if source_intent (nullable) is None + # and model_fields_set contains the field + if self.source_intent is None and "source_intent" in self.model_fields_set: + _dict['source_intent'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef74786d0cba87c515TrustSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "extract_template_name": obj.get("extract_template_name"), + "source_category": obj.get("source_category"), + "source_intent": obj.get("source_intent"), + "title": obj.get("title"), + "type": obj.get("type"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def7feddd7d853a299b_trust_source_type.py b/candidate/generated/nimble_client/models/gateway_def7feddd7d853a299b_trust_source_type.py new file mode 100644 index 0000000..f0b58d3 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def7feddd7d853a299b_trust_source_type.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class GatewayDef7feddd7d853a299bTrustSourceType(str, Enum): + """ + GatewayDef7feddd7d853a299bTrustSourceType + """ + + """ + allowed enum values + """ + PRIMARY = 'primary' + SECONDARY = 'secondary' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GatewayDef7feddd7d853a299bTrustSourceType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/gateway_def936b662c6aa9dee9_task_run_state_event_run.py b/candidate/generated/nimble_client/models/gateway_def936b662c6aa9dee9_task_run_state_event_run.py new file mode 100644 index 0000000..bf83854 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def936b662c6aa9dee9_task_run_state_event_run.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.effort import Effort +from nimble_client.models.gateway_def6651fbad4f19182d_task_run_status_value import GatewayDef6651fbad4f19182dTaskRunStatusValue +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef936b662c6aa9dee9TaskRunStateEventRun(BaseModel): + """ + The 'run' snapshot embedded in a task_run.state event. Deliberately smaller than TaskRunResponse: this is published from inside the execution graph, which doesn't have interaction_id, prompt, or web_search_agent_id in scope — only these fields. + """ # noqa: E501 + created_at: StrictStr + effort: Effort + id: StrictStr + is_active: StrictBool + metadata: Optional[Dict[str, Any]] = None + status: GatewayDef6651fbad4f19182dTaskRunStatusValue + taskgroup_id: Optional[StrictStr] = None + warnings: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["created_at", "effort", "id", "is_active", "metadata", "status", "taskgroup_id", "warnings"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef936b662c6aa9dee9TaskRunStateEventRun from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if taskgroup_id (nullable) is None + # and model_fields_set contains the field + if self.taskgroup_id is None and "taskgroup_id" in self.model_fields_set: + _dict['taskgroup_id'] = None + + # set to None if warnings (nullable) is None + # and model_fields_set contains the field + if self.warnings is None and "warnings" in self.model_fields_set: + _dict['warnings'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef936b662c6aa9dee9TaskRunStateEventRun from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "effort": obj.get("effort"), + "id": obj.get("id"), + "is_active": obj.get("is_active"), + "metadata": obj.get("metadata"), + "status": obj.get("status"), + "taskgroup_id": obj.get("taskgroup_id"), + "warnings": obj.get("warnings") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def977107e4b1c6ce11_trust_citation.py b/candidate/generated/nimble_client/models/gateway_def977107e4b1c6ce11_trust_citation.py new file mode 100644 index 0000000..42fbee3 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def977107e4b1c6ce11_trust_citation.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def1d511972aa34af3c_source_category import GatewayDef1d511972aa34af3cSourceCategory +from nimble_client.models.gateway_def7feddd7d853a299b_trust_source_type import GatewayDef7feddd7d853a299bTrustSourceType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDef977107e4b1c6ce11TrustCitation(BaseModel): + """ + A citation backing a specific claim in the answer. + """ # noqa: E501 + excerpts: Optional[List[StrictStr]] = Field(default=None, description="Verbatim excerpts supporting the claim.") + extract_template_name: Optional[StrictStr] = Field(default=None, description="Extract template used to read the source, when one was used.") + source_category: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source: official, news, social, academic, aggregator, marketplace, or other.") + source_intent: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source the underlying question asked for.") + source_type: Optional[GatewayDef7feddd7d853a299bTrustSourceType] = Field(default=None, description="How authoritative the source is: 'primary' or 'secondary'.") + title: Optional[StrictStr] = Field(default=None, description="Title of the cited page.") + url: StrictStr = Field(description="URL of the cited page.") + __properties: ClassVar[List[str]] = ["excerpts", "extract_template_name", "source_category", "source_intent", "source_type", "title", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDef977107e4b1c6ce11TrustCitation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if excerpts (nullable) is None + # and model_fields_set contains the field + if self.excerpts is None and "excerpts" in self.model_fields_set: + _dict['excerpts'] = None + + # set to None if extract_template_name (nullable) is None + # and model_fields_set contains the field + if self.extract_template_name is None and "extract_template_name" in self.model_fields_set: + _dict['extract_template_name'] = None + + # set to None if source_category (nullable) is None + # and model_fields_set contains the field + if self.source_category is None and "source_category" in self.model_fields_set: + _dict['source_category'] = None + + # set to None if source_intent (nullable) is None + # and model_fields_set contains the field + if self.source_intent is None and "source_intent" in self.model_fields_set: + _dict['source_intent'] = None + + # set to None if source_type (nullable) is None + # and model_fields_set contains the field + if self.source_type is None and "source_type" in self.model_fields_set: + _dict['source_type'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDef977107e4b1c6ce11TrustCitation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "excerpts": obj.get("excerpts"), + "extract_template_name": obj.get("extract_template_name"), + "source_category": obj.get("source_category"), + "source_intent": obj.get("source_intent"), + "source_type": obj.get("source_type"), + "title": obj.get("title"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_a7c1b2a8ffcc3b45_json_run_trust.py b/candidate/generated/nimble_client/models/gateway_def_a7c1b2a8ffcc3b45_json_run_trust.py new file mode 100644 index 0000000..9939b1a --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_a7c1b2a8ffcc3b45_json_run_trust.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def07f55f9a59071b48_json_claim_trust import GatewayDef07f55f9a59071b48JsonClaimTrust +from nimble_client.models.gateway_def74786d0cba87c515_trust_source import GatewayDef74786d0cba87c515TrustSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefA7c1b2a8ffcc3b45JsonRunTrust(BaseModel): + """ + Trust metadata for a structured answer: run-level confidence plus per-value citations. + """ # noqa: E501 + claims: List[GatewayDef07f55f9a59071b48JsonClaimTrust] = Field(description="Per-value trust, keyed by JSON path in the structured output.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Overall confidence in the answer.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + sources: List[GatewayDef74786d0cba87c515TrustSource] = Field(description="Sources consulted while producing the answer.") + __properties: ClassVar[List[str]] = ["claims", "confidence", "reasoning", "sources"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefA7c1b2a8ffcc3b45JsonRunTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in claims (list) + _items = [] + if self.claims: + for _item_claims in self.claims: + _items.append(_item_claims.to_dict() if _item_claims is not None else None) + _dict['claims'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefA7c1b2a8ffcc3b45JsonRunTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "claims": [GatewayDef07f55f9a59071b48JsonClaimTrust.from_dict(_item) for _item in obj["claims"]] if obj.get("claims") is not None else None, + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "sources": [GatewayDef74786d0cba87c515TrustSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_bc5dc0ea1fc57012_task_run_text_output.py b/candidate/generated/nimble_client/models/gateway_def_bc5dc0ea1fc57012_task_run_text_output.py new file mode 100644 index 0000000..0098904 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_bc5dc0ea1fc57012_task_run_text_output.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def033cecba0ba3d1d3_text_run_trust import GatewayDef033cecba0ba3d1d3TextRunTrust +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefBc5dc0ea1fc57012TaskRunTextOutput(BaseModel): + """ + Text output from a completed task. + """ # noqa: E501 + content: StrictStr = Field(description="The final prose answer.") + sources: Optional[List[GatewayDef3a5c7c6bfa027c89TaskRunOutputSource]] = Field(default=None, description="Sources the output cites, deduplicated by URL in citation order. Always present, including when trust is off (`trust: null`); `trust.sources` adds primary/secondary classification on full_trust runs.") + trust: Optional[GatewayDef033cecba0ba3d1d3TextRunTrust] + type: Optional[StrictStr] = 'text' + __properties: ClassVar[List[str]] = ["content", "sources", "trust", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['text']): + raise ValueError("must be one of enum values ('text')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefBc5dc0ea1fc57012TaskRunTextOutput from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of trust + if self.trust: + _dict['trust'] = self.trust.to_dict() + # set to None if trust (nullable) is None + # and model_fields_set contains the field + if self.trust is None and "trust" in self.model_fields_set: + _dict['trust'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefBc5dc0ea1fc57012TaskRunTextOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": obj.get("content"), + "sources": [GatewayDef3a5c7c6bfa027c89TaskRunOutputSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "trust": GatewayDef033cecba0ba3d1d3TextRunTrust.from_dict(obj["trust"]) if obj.get("trust") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'text' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_c0fe0f39c374a83b_task_run_progress_stats_event.py b/candidate/generated/nimble_client/models/gateway_def_c0fe0f39c374a83b_task_run_progress_stats_event.py new file mode 100644 index 0000000..24b7be6 --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_c0fe0f39c374a83b_task_run_progress_stats_event.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def386b2024130bc052_task_run_source_stats import GatewayDef386b2024130bc052TaskRunSourceStats +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent(BaseModel): + """ + Point-in-time snapshot of source counts across all parallel search agents. + """ # noqa: E501 + source_stats: GatewayDef386b2024130bc052TaskRunSourceStats + type: Optional[StrictStr] = 'task_run.progress_stats' + __properties: ClassVar[List[str]] = ["source_stats", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['task_run.progress_stats']): + raise ValueError("must be one of enum values ('task_run.progress_stats')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of source_stats + if self.source_stats: + _dict['source_stats'] = self.source_stats.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "source_stats": GatewayDef386b2024130bc052TaskRunSourceStats.from_dict(obj["source_stats"]) if obj.get("source_stats") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'task_run.progress_stats' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_ce9019f9e67ae903_trust_source.py b/candidate/generated/nimble_client/models/gateway_def_ce9019f9e67ae903_trust_source.py new file mode 100644 index 0000000..870cbbb --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_ce9019f9e67ae903_trust_source.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def1d511972aa34af3c_source_category import GatewayDef1d511972aa34af3cSourceCategory +from nimble_client.models.gateway_def7feddd7d853a299b_trust_source_type import GatewayDef7feddd7d853a299bTrustSourceType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefCe9019f9e67ae903TrustSource(BaseModel): + """ + A source consulted while producing the answer. + """ # noqa: E501 + extract_template_name: Optional[StrictStr] = Field(default=None, description="Extract template used to read the source, when one was used.") + source_category: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source: official, news, social, academic, aggregator, marketplace, or other.") + source_intent: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source the underlying question asked for.") + title: Optional[StrictStr] = Field(default=None, description="Title of the source page.") + type: GatewayDef7feddd7d853a299bTrustSourceType = Field(description="How authoritative the source is: 'primary' or 'secondary'.") + url: StrictStr = Field(description="URL of the source page.") + __properties: ClassVar[List[str]] = ["extract_template_name", "source_category", "source_intent", "title", "type", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefCe9019f9e67ae903TrustSource from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if extract_template_name (nullable) is None + # and model_fields_set contains the field + if self.extract_template_name is None and "extract_template_name" in self.model_fields_set: + _dict['extract_template_name'] = None + + # set to None if source_category (nullable) is None + # and model_fields_set contains the field + if self.source_category is None and "source_category" in self.model_fields_set: + _dict['source_category'] = None + + # set to None if source_intent (nullable) is None + # and model_fields_set contains the field + if self.source_intent is None and "source_intent" in self.model_fields_set: + _dict['source_intent'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefCe9019f9e67ae903TrustSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "extract_template_name": obj.get("extract_template_name"), + "source_category": obj.get("source_category"), + "source_intent": obj.get("source_intent"), + "title": obj.get("title"), + "type": obj.get("type"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_d1833882d7d67018_task_run_state_event_run.py b/candidate/generated/nimble_client/models/gateway_def_d1833882d7d67018_task_run_state_event_run.py new file mode 100644 index 0000000..0e02d2b --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_d1833882d7d67018_task_run_state_event_run.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.effort import Effort +from nimble_client.models.gateway_def6651fbad4f19182d_task_run_status_value import GatewayDef6651fbad4f19182dTaskRunStatusValue +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefD1833882d7d67018TaskRunStateEventRun(BaseModel): + """ + The 'run' snapshot embedded in a task_run.state event. Deliberately smaller than TaskRunResponse: this is published from inside the execution graph, which doesn't have interaction_id, prompt, or web_search_agent_id in scope — only these fields. + """ # noqa: E501 + created_at: StrictStr + effort: Effort + id: StrictStr + is_active: StrictBool + metadata: Optional[Dict[str, Any]] = None + status: GatewayDef6651fbad4f19182dTaskRunStatusValue + taskgroup_id: Optional[StrictStr] = None + warnings: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["created_at", "effort", "id", "is_active", "metadata", "status", "taskgroup_id", "warnings"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefD1833882d7d67018TaskRunStateEventRun from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if taskgroup_id (nullable) is None + # and model_fields_set contains the field + if self.taskgroup_id is None and "taskgroup_id" in self.model_fields_set: + _dict['taskgroup_id'] = None + + # set to None if warnings (nullable) is None + # and model_fields_set contains the field + if self.warnings is None and "warnings" in self.model_fields_set: + _dict['warnings'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefD1833882d7d67018TaskRunStateEventRun from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "effort": obj.get("effort"), + "id": obj.get("id"), + "is_active": obj.get("is_active"), + "metadata": obj.get("metadata"), + "status": obj.get("status"), + "taskgroup_id": obj.get("taskgroup_id"), + "warnings": obj.get("warnings") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_dc279d13fafb2038_task_run_json_output.py b/candidate/generated/nimble_client/models/gateway_def_dc279d13fafb2038_task_run_json_output.py new file mode 100644 index 0000000..76cf7dd --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_dc279d13fafb2038_task_run_json_output.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.content import Content +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from nimble_client.models.gateway_def_eb0114a225123d8d_json_run_trust import GatewayDefEb0114a225123d8dJsonRunTrust +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefDc279d13fafb2038TaskRunJsonOutput(BaseModel): + """ + Structured JSON output from a completed task, produced when task_spec.output_schema.type is 'json'. + """ # noqa: E501 + content: Content + sources: Optional[List[GatewayDef3a5c7c6bfa027c89TaskRunOutputSource]] = Field(default=None, description="Sources the output cites, deduplicated by URL in citation order. Always present, including when trust is off (`trust: null`); `trust.sources` adds primary/secondary classification on full_trust runs.") + trust: Optional[GatewayDefEb0114a225123d8dJsonRunTrust] + type: Optional[StrictStr] = 'json' + __properties: ClassVar[List[str]] = ["content", "sources", "trust", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['json']): + raise ValueError("must be one of enum values ('json')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefDc279d13fafb2038TaskRunJsonOutput from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict['content'] = self.content.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of trust + if self.trust: + _dict['trust'] = self.trust.to_dict() + # set to None if trust (nullable) is None + # and model_fields_set contains the field + if self.trust is None and "trust" in self.model_fields_set: + _dict['trust'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefDc279d13fafb2038TaskRunJsonOutput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": Content.from_dict(obj["content"]) if obj.get("content") is not None else None, + "sources": [GatewayDef3a5c7c6bfa027c89TaskRunOutputSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "trust": GatewayDefEb0114a225123d8dJsonRunTrust.from_dict(obj["trust"]) if obj.get("trust") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'json' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_eb0114a225123d8d_json_run_trust.py b/candidate/generated/nimble_client/models/gateway_def_eb0114a225123d8d_json_run_trust.py new file mode 100644 index 0000000..60e47ba --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_eb0114a225123d8d_json_run_trust.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def54179423f3a3b0a8_json_claim_trust import GatewayDef54179423f3a3b0a8JsonClaimTrust +from nimble_client.models.gateway_def_ce9019f9e67ae903_trust_source import GatewayDefCe9019f9e67ae903TrustSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefEb0114a225123d8dJsonRunTrust(BaseModel): + """ + Trust metadata for a structured answer: run-level confidence plus per-value citations. + """ # noqa: E501 + claims: List[GatewayDef54179423f3a3b0a8JsonClaimTrust] = Field(description="Per-value trust, keyed by JSON path in the structured output.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Overall confidence in the answer.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + sources: List[GatewayDefCe9019f9e67ae903TrustSource] = Field(description="Sources consulted while producing the answer.") + __properties: ClassVar[List[str]] = ["claims", "confidence", "reasoning", "sources"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefEb0114a225123d8dJsonRunTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in claims (list) + _items = [] + if self.claims: + for _item_claims in self.claims: + _items.append(_item_claims.to_dict() if _item_claims is not None else None) + _dict['claims'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefEb0114a225123d8dJsonRunTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "claims": [GatewayDef54179423f3a3b0a8JsonClaimTrust.from_dict(_item) for _item in obj["claims"]] if obj.get("claims") is not None else None, + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "sources": [GatewayDefCe9019f9e67ae903TrustSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_f23bf5d9e6e07ed3_trust_citation.py b/candidate/generated/nimble_client/models/gateway_def_f23bf5d9e6e07ed3_trust_citation.py new file mode 100644 index 0000000..81d9cfd --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_f23bf5d9e6e07ed3_trust_citation.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def1d511972aa34af3c_source_category import GatewayDef1d511972aa34af3cSourceCategory +from nimble_client.models.gateway_def7feddd7d853a299b_trust_source_type import GatewayDef7feddd7d853a299bTrustSourceType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefF23bf5d9e6e07ed3TrustCitation(BaseModel): + """ + A citation backing a specific claim in the answer. + """ # noqa: E501 + excerpts: Optional[List[StrictStr]] = Field(default=None, description="Verbatim excerpts supporting the claim.") + extract_template_name: Optional[StrictStr] = Field(default=None, description="Extract template used to read the source, when one was used.") + source_category: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source: official, news, social, academic, aggregator, marketplace, or other.") + source_intent: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source the underlying question asked for.") + source_type: Optional[GatewayDef7feddd7d853a299bTrustSourceType] = Field(default=None, description="How authoritative the source is: 'primary' or 'secondary'.") + title: Optional[StrictStr] = Field(default=None, description="Title of the cited page.") + url: StrictStr = Field(description="URL of the cited page.") + __properties: ClassVar[List[str]] = ["excerpts", "extract_template_name", "source_category", "source_intent", "source_type", "title", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefF23bf5d9e6e07ed3TrustCitation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if excerpts (nullable) is None + # and model_fields_set contains the field + if self.excerpts is None and "excerpts" in self.model_fields_set: + _dict['excerpts'] = None + + # set to None if extract_template_name (nullable) is None + # and model_fields_set contains the field + if self.extract_template_name is None and "extract_template_name" in self.model_fields_set: + _dict['extract_template_name'] = None + + # set to None if source_category (nullable) is None + # and model_fields_set contains the field + if self.source_category is None and "source_category" in self.model_fields_set: + _dict['source_category'] = None + + # set to None if source_intent (nullable) is None + # and model_fields_set contains the field + if self.source_intent is None and "source_intent" in self.model_fields_set: + _dict['source_intent'] = None + + # set to None if source_type (nullable) is None + # and model_fields_set contains the field + if self.source_type is None and "source_type" in self.model_fields_set: + _dict['source_type'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefF23bf5d9e6e07ed3TrustCitation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "excerpts": obj.get("excerpts"), + "extract_template_name": obj.get("extract_template_name"), + "source_category": obj.get("source_category"), + "source_intent": obj.get("source_intent"), + "source_type": obj.get("source_type"), + "title": obj.get("title"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_fb397fec4dcf2a13_text_claim_trust.py b/candidate/generated/nimble_client/models/gateway_def_fb397fec4dcf2a13_text_claim_trust.py new file mode 100644 index 0000000..1660d9f --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_fb397fec4dcf2a13_text_claim_trust.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.gateway_def_f23bf5d9e6e07ed3_trust_citation import GatewayDefF23bf5d9e6e07ed3TrustCitation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefFb397fec4dcf2a13TextClaimTrust(BaseModel): + """ + Trust metadata for one claim in a prose answer, keyed by callout marker. + """ # noqa: E501 + callout: StrictInt = Field(description="Callout marker number referencing this claim in the answer text.") + citations: List[GatewayDefF23bf5d9e6e07ed3TrustCitation] = Field(description="Citations backing this claim.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Confidence in this claim.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + __properties: ClassVar[List[str]] = ["callout", "citations", "confidence", "reasoning"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefFb397fec4dcf2a13TextClaimTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in citations (list) + _items = [] + if self.citations: + for _item_citations in self.citations: + _items.append(_item_citations.to_dict() if _item_citations is not None else None) + _dict['citations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefFb397fec4dcf2a13TextClaimTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callout": obj.get("callout"), + "citations": [GatewayDefF23bf5d9e6e07ed3TrustCitation.from_dict(_item) for _item in obj["citations"]] if obj.get("citations") is not None else None, + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/gateway_def_fd08b460e1d38459_task_run_state_event.py b/candidate/generated/nimble_client/models/gateway_def_fd08b460e1d38459_task_run_state_event.py new file mode 100644 index 0000000..744362e --- /dev/null +++ b/candidate/generated/nimble_client/models/gateway_def_fd08b460e1d38459_task_run_state_event.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def936b662c6aa9dee9_task_run_state_event_run import GatewayDef936b662c6aa9dee9TaskRunStateEventRun +from nimble_client.models.output1 import Output1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GatewayDefFd08b460e1d38459TaskRunStateEvent(BaseModel): + """ + Run status transition, published on start/completion/failure/cancellation. + """ # noqa: E501 + output: Optional[Output1] = None + run: GatewayDef936b662c6aa9dee9TaskRunStateEventRun + type: Optional[StrictStr] = 'task_run.state' + __properties: ClassVar[List[str]] = ["output", "run", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['task_run.state']): + raise ValueError("must be one of enum values ('task_run.state')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GatewayDefFd08b460e1d38459TaskRunStateEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of output + if self.output: + _dict['output'] = self.output.to_dict() + # override the default output from pydantic by calling `to_dict()` of run + if self.run: + _dict['run'] = self.run.to_dict() + # set to None if output (nullable) is None + # and model_fields_set contains the field + if self.output is None and "output" in self.model_fields_set: + _dict['output'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GatewayDefFd08b460e1d38459TaskRunStateEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "output": Output1.from_dict(obj["output"]) if obj.get("output") is not None else None, + "run": GatewayDef936b662c6aa9dee9TaskRunStateEventRun.from_dict(obj["run"]) if obj.get("run") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'task_run.state' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/get_cookies_action.py b/candidate/generated/nimble_client/models/get_cookies_action.py new file mode 100644 index 0000000..14fa76c --- /dev/null +++ b/candidate/generated/nimble_client/models/get_cookies_action.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.get_cookies_action_get_cookies import GetCookiesActionGetCookies +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GetCookiesAction(BaseModel): + """ + Retrieve browser cookies + """ # noqa: E501 + get_cookies: GetCookiesActionGetCookies + __properties: ClassVar[List[str]] = ["get_cookies"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetCookiesAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of get_cookies + if self.get_cookies: + _dict['get_cookies'] = self.get_cookies.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetCookiesAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "get_cookies": GetCookiesActionGetCookies.from_dict(obj["get_cookies"]) if obj.get("get_cookies") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/get_cookies_action_get_cookies.py b/candidate/generated/nimble_client/models/get_cookies_action_get_cookies.py new file mode 100644 index 0000000..b879bdf --- /dev/null +++ b/candidate/generated/nimble_client/models/get_cookies_action_get_cookies.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.get_cookies_action_get_cookies_one_of import GetCookiesActionGetCookiesOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +GETCOOKIESACTIONGETCOOKIES_ONE_OF_SCHEMAS = ["GetCookiesActionGetCookiesOneOf", "bool"] + +class GetCookiesActionGetCookies(BaseModel): + """ + GetCookiesActionGetCookies + """ + # data type: bool + oneof_schema_1_validator: Optional[StrictBool] = None + # data type: GetCookiesActionGetCookiesOneOf + oneof_schema_2_validator: Optional[GetCookiesActionGetCookiesOneOf] = None + actual_instance: Optional[Union[GetCookiesActionGetCookiesOneOf, bool]] = None + one_of_schemas: Set[str] = { "GetCookiesActionGetCookiesOneOf", "bool" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = GetCookiesActionGetCookies.model_construct() + error_messages = [] + match = 0 + # validate data type: bool + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: GetCookiesActionGetCookiesOneOf + if not isinstance(v, GetCookiesActionGetCookiesOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `GetCookiesActionGetCookiesOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in GetCookiesActionGetCookies with oneOf schemas: GetCookiesActionGetCookiesOneOf, bool. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in GetCookiesActionGetCookies with oneOf schemas: GetCookiesActionGetCookiesOneOf, bool. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into bool + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GetCookiesActionGetCookiesOneOf + try: + instance.actual_instance = GetCookiesActionGetCookiesOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into GetCookiesActionGetCookies with oneOf schemas: GetCookiesActionGetCookiesOneOf, bool. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into GetCookiesActionGetCookies with oneOf schemas: GetCookiesActionGetCookiesOneOf, bool. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], GetCookiesActionGetCookiesOneOf, bool]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/get_cookies_action_get_cookies_one_of.py b/candidate/generated/nimble_client/models/get_cookies_action_get_cookies_one_of.py new file mode 100644 index 0000000..0489fab --- /dev/null +++ b/candidate/generated/nimble_client/models/get_cookies_action_get_cookies_one_of.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GetCookiesActionGetCookiesOneOf(BaseModel): + """ + GetCookiesActionGetCookiesOneOf + """ # noqa: E501 + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["required", "skip"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetCookiesActionGetCookiesOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetCookiesActionGetCookiesOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/get_domain_knowledge_driver400_response.py b/candidate/generated/nimble_client/models/get_domain_knowledge_driver400_response.py new file mode 100644 index 0000000..c833e72 --- /dev/null +++ b/candidate/generated/nimble_client/models/get_domain_knowledge_driver400_response.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GetDomainKnowledgeDriver400Response(BaseModel): + """ + GetDomainKnowledgeDriver400Response + """ # noqa: E501 + msg: Optional[StrictStr] = Field(description="Cursor for pagination.") + status: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["msg", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['failed']): + raise ValueError("must be one of enum values ('failed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetDomainKnowledgeDriver400Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if msg (nullable) is None + # and model_fields_set contains the field + if self.msg is None and "msg" in self.model_fields_set: + _dict['msg'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetDomainKnowledgeDriver400Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "msg": obj.get("msg"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/goto_action.py b/candidate/generated/nimble_client/models/goto_action.py new file mode 100644 index 0000000..5bde69c --- /dev/null +++ b/candidate/generated/nimble_client/models/goto_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.goto_action_goto import GotoActionGoto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GotoAction(BaseModel): + """ + Navigate to a URL + """ # noqa: E501 + goto: GotoActionGoto + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["goto"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GotoAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of goto + if self.goto: + _dict['goto'] = self.goto.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GotoAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "goto": GotoActionGoto.from_dict(obj["goto"]) if obj.get("goto") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/goto_action_goto.py b/candidate/generated/nimble_client/models/goto_action_goto.py new file mode 100644 index 0000000..5024ef1 --- /dev/null +++ b/candidate/generated/nimble_client/models/goto_action_goto.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.goto_action_goto_one_of import GotoActionGotoOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +GOTOACTIONGOTO_ONE_OF_SCHEMAS = ["GotoActionGotoOneOf", "str"] + +class GotoActionGoto(BaseModel): + """ + GotoActionGoto + """ + # data type: str + oneof_schema_1_validator: Optional[StrictStr] = Field(default=None, description="URL for downloading the task results.") + # data type: GotoActionGotoOneOf + oneof_schema_2_validator: Optional[GotoActionGotoOneOf] = None + actual_instance: Optional[Union[GotoActionGotoOneOf, str]] = None + one_of_schemas: Set[str] = { "GotoActionGotoOneOf", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = GotoActionGoto.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: GotoActionGotoOneOf + if not isinstance(v, GotoActionGotoOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `GotoActionGotoOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in GotoActionGoto with oneOf schemas: GotoActionGotoOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in GotoActionGoto with oneOf schemas: GotoActionGotoOneOf, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into str + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GotoActionGotoOneOf + try: + instance.actual_instance = GotoActionGotoOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into GotoActionGoto with oneOf schemas: GotoActionGotoOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into GotoActionGoto with oneOf schemas: GotoActionGotoOneOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], GotoActionGotoOneOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/goto_action_goto_one_of.py b/candidate/generated/nimble_client/models/goto_action_goto_one_of.py new file mode 100644 index 0000000..d3b57b7 --- /dev/null +++ b/candidate/generated/nimble_client/models/goto_action_goto_one_of.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GotoActionGotoOneOf(BaseModel): + """ + GotoActionGotoOneOf + """ # noqa: E501 + referer: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=15000, description="Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.") + url: Optional[StrictStr] = Field(description="URL for downloading the task results.") + wait_until: Optional[StrictStr] = 'load' + __properties: ClassVar[List[str]] = ["referer", "required", "skip", "timeout", "url", "wait_until"] + + @field_validator('wait_until') + def wait_until_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['load', 'domcontentloaded', 'networkidle0', 'networkidle2']): + raise ValueError("must be one of enum values ('load', 'domcontentloaded', 'networkidle0', 'networkidle2')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GotoActionGotoOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + # set to None if referer (nullable) is None + # and model_fields_set contains the field + if self.referer is None and "referer" in self.model_fields_set: + _dict['referer'] = None + + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GotoActionGotoOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "referer": obj.get("referer"), + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "timeout": obj.get("timeout") if obj.get("timeout") is not None else 15000, + "url": obj.get("url"), + "wait_until": obj.get("wait_until") if obj.get("wait_until") is not None else 'load' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/http_validation_error.py b/candidate/generated/nimble_client/models/http_validation_error.py new file mode 100644 index 0000000..6914bab --- /dev/null +++ b/candidate/generated/nimble_client/models/http_validation_error.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.validation_error import ValidationError +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HTTPValidationError(BaseModel): + """ + HTTPValidationError + """ # noqa: E501 + detail: Optional[List[ValidationError]] = None + __properties: ClassVar[List[str]] = ["detail"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HTTPValidationError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in detail (list) + _items = [] + if self.detail: + for _item_detail in self.detail: + _items.append(_item_detail.to_dict() if _item_detail is not None else None) + _dict['detail'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HTTPValidationError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "detail": [ValidationError.from_dict(_item) for _item in obj["detail"]] if obj.get("detail") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/input_data.py b/candidate/generated/nimble_client/models/input_data.py new file mode 100644 index 0000000..dddb5ee --- /dev/null +++ b/candidate/generated/nimble_client/models/input_data.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, List, Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +INPUTDATA_ANY_OF_SCHEMAS = ["Dict[str, object]", "List[Dict[str, object]]"] + +class InputData(BaseModel): + """ + Existing records to ENRICH: a list of partial rows, or a single object, mirroring output_schema's shape. + """ + + # data type: List[Dict[str, object]] + anyof_schema_1_validator: Optional[List[Dict[str, Any]]] = None + # data type: Dict[str, object] + anyof_schema_2_validator: Optional[Dict[str, Any]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Dict[str, object], List[Dict[str, object]]]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "Dict[str, object]", "List[Dict[str, object]]" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = InputData.model_construct() + error_messages = [] + # validate data type: List[Dict[str, object]] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: Dict[str, object] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in InputData with anyOf schemas: Dict[str, object], List[Dict[str, object]]. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into List[Dict[str, object]] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into Dict[str, object] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into InputData with anyOf schemas: Dict[str, object], List[Dict[str, object]]. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, object], List[Dict[str, object]]]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/job_context_public_v1.py b/candidate/generated/nimble_client/models/job_context_public_v1.py new file mode 100644 index 0000000..34e93f4 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_context_public_v1.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.job_schedule_public_v1 import JobSchedulePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobContextPublicV1(BaseModel): + """ + Minimal job context embedded in a run detail. + """ # noqa: E501 + agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent this job runs.") + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly job name shown in the UI.") + id: Annotated[str, Field(strict=True)] = Field(description="Unique job identifier (job_).") + name: StrictStr = Field(description="Internal job name.") + schedule: Optional[JobSchedulePublicV1] = Field(default=None, description="Cron schedule controlling automatic runs.") + __properties: ClassVar[List[str]] = ["agent_name", "display_name", "id", "name", "schedule"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^job_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^job_[1-9][0-9]*$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobContextPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # set to None if agent_name (nullable) is None + # and model_fields_set contains the field + if self.agent_name is None and "agent_name" in self.model_fields_set: + _dict['agent_name'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if schedule (nullable) is None + # and model_fields_set contains the field + if self.schedule is None and "schedule" in self.model_fields_set: + _dict['schedule'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobContextPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "display_name": obj.get("display_name"), + "id": obj.get("id"), + "name": obj.get("name"), + "schedule": JobSchedulePublicV1.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_context_public_v2.py b/candidate/generated/nimble_client/models/job_context_public_v2.py new file mode 100644 index 0000000..0d6b371 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_context_public_v2.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.job_schedule_public_v2 import JobSchedulePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobContextPublicV2(BaseModel): + """ + Minimal job context embedded in a run detail. + """ # noqa: E501 + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly job name shown in the UI.") + extract_template_name: Optional[StrictStr] = Field(default=None, description="Name of the extract template this job runs.") + id: Annotated[str, Field(strict=True)] = Field(description="Unique job identifier (job_).") + name: StrictStr = Field(description="Internal job name.") + schedule: Optional[JobSchedulePublicV2] = Field(default=None, description="Cron schedule controlling automatic runs.") + __properties: ClassVar[List[str]] = ["display_name", "extract_template_name", "id", "name", "schedule"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^job_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^job_[1-9][0-9]*$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobContextPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if extract_template_name (nullable) is None + # and model_fields_set contains the field + if self.extract_template_name is None and "extract_template_name" in self.model_fields_set: + _dict['extract_template_name'] = None + + # set to None if schedule (nullable) is None + # and model_fields_set contains the field + if self.schedule is None and "schedule" in self.model_fields_set: + _dict['schedule'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobContextPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "display_name": obj.get("display_name"), + "extract_template_name": obj.get("extract_template_name"), + "id": obj.get("id"), + "name": obj.get("name"), + "schedule": JobSchedulePublicV2.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_destination_public_v1.py b/candidate/generated/nimble_client/models/job_destination_public_v1.py new file mode 100644 index 0000000..9d5fc8e --- /dev/null +++ b/candidate/generated/nimble_client/models/job_destination_public_v1.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobDestinationPublicV1(BaseModel): + """ + Where a job writes its results. + """ # noqa: E501 + format: Optional[StrictStr] = Field(default='parquet', description="Output file format.") + path: StrictStr = Field(description="Destination path the output is written to.") + type: StrictStr = Field(description="Destination kind: a local 'file' or an 's3' bucket.") + __properties: ClassVar[List[str]] = ["format", "path", "type"] + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['jsonl', 'csv', 'parquet']): + raise ValueError("must be one of enum values ('jsonl', 'csv', 'parquet')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['file', 's3']): + raise ValueError("must be one of enum values ('file', 's3')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobDestinationPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobDestinationPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "format": obj.get("format") if obj.get("format") is not None else 'parquet', + "path": obj.get("path"), + "type": obj.get("type") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_destination_public_v2.py b/candidate/generated/nimble_client/models/job_destination_public_v2.py new file mode 100644 index 0000000..b0c69f7 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_destination_public_v2.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobDestinationPublicV2(BaseModel): + """ + Where a job writes its results. + """ # noqa: E501 + format: Optional[StrictStr] = Field(default='parquet', description="Output file format.") + path: StrictStr = Field(description="Destination path the output is written to.") + type: StrictStr = Field(description="Destination kind: a local 'file' or an 's3' bucket.") + __properties: ClassVar[List[str]] = ["format", "path", "type"] + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['jsonl', 'csv', 'parquet']): + raise ValueError("must be one of enum values ('jsonl', 'csv', 'parquet')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['file', 's3']): + raise ValueError("must be one of enum values ('file', 's3')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobDestinationPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobDestinationPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "format": obj.get("format") if obj.get("format") is not None else 'parquet', + "path": obj.get("path"), + "type": obj.get("type") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_inputs_public_v1.py b/candidate/generated/nimble_client/models/job_inputs_public_v1.py new file mode 100644 index 0000000..0b6f50e --- /dev/null +++ b/candidate/generated/nimble_client/models/job_inputs_public_v1.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobInputsPublicV1(BaseModel): + """ + Configuration for the input data a job processes. + """ # noqa: E501 + data: Optional[List[Dict[str, Any]]] = Field(default=None, description="Inline list of input records. Used when type is 'inline'.") + file_path: Optional[StrictStr] = Field(default=None, description="Path to the input file; must start with 's3' or 'file_'. Used for 's3'/'file' types.") + node_data: Optional[Dict[str, List[Dict[str, Any]]]] = Field(default=None, description="Inline input records keyed by source node id, e.g. {'source_a': [{...}]}. Used when type is 'inline' on a dynamic-workflow job, which has one source node per input file. Mutually exclusive with 'data'.") + type: StrictStr = Field(description="How inputs are supplied: an 's3' bucket, 'inline' records, or an uploaded 'file'.") + __properties: ClassVar[List[str]] = ["data", "file_path", "node_data", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['s3', 'inline', 'file']): + raise ValueError("must be one of enum values ('s3', 'inline', 'file')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobInputsPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if file_path (nullable) is None + # and model_fields_set contains the field + if self.file_path is None and "file_path" in self.model_fields_set: + _dict['file_path'] = None + + # set to None if node_data (nullable) is None + # and model_fields_set contains the field + if self.node_data is None and "node_data" in self.model_fields_set: + _dict['node_data'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobInputsPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": obj.get("data"), + "file_path": obj.get("file_path"), + "node_data": obj.get("node_data"), + "type": obj.get("type") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_inputs_public_v2.py b/candidate/generated/nimble_client/models/job_inputs_public_v2.py new file mode 100644 index 0000000..856d276 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_inputs_public_v2.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobInputsPublicV2(BaseModel): + """ + Configuration for the input data a job processes. + """ # noqa: E501 + data: Optional[List[Dict[str, Any]]] = Field(default=None, description="Inline list of input records. Used when type is 'inline'.") + file_path: Optional[StrictStr] = Field(default=None, description="Path to the input file; must start with 's3' or 'file_'. Used for 's3'/'file' types.") + node_data: Optional[Dict[str, List[Dict[str, Any]]]] = Field(default=None, description="Inline input records keyed by source node id, e.g. {'source_a': [{...}]}. Used when type is 'inline' on a dynamic-workflow job, which has one source node per input file. Mutually exclusive with 'data'.") + type: StrictStr = Field(description="How inputs are supplied: an 's3' bucket, 'inline' records, or an uploaded 'file'.") + __properties: ClassVar[List[str]] = ["data", "file_path", "node_data", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['s3', 'inline', 'file']): + raise ValueError("must be one of enum values ('s3', 'inline', 'file')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobInputsPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if file_path (nullable) is None + # and model_fields_set contains the field + if self.file_path is None and "file_path" in self.model_fields_set: + _dict['file_path'] = None + + # set to None if node_data (nullable) is None + # and model_fields_set contains the field + if self.node_data is None and "node_data" in self.model_fields_set: + _dict['node_data'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobInputsPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": obj.get("data"), + "file_path": obj.get("file_path"), + "node_data": obj.get("node_data"), + "type": obj.get("type") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_list_filter_public_v2.py b/candidate/generated/nimble_client/models/job_list_filter_public_v2.py new file mode 100644 index 0000000..1321730 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_list_filter_public_v2.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobListFilterPublicV2(BaseModel): + """ + JobListFilterPublicV2 + """ # noqa: E501 + extract_template_name: Optional[StrictStr] = Field(default=None, description="Filter by extract template name.") + q: Optional[StrictStr] = Field(default=None, description="Search by name or display name.") + __properties: ClassVar[List[str]] = ["extract_template_name", "q"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobListFilterPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if extract_template_name (nullable) is None + # and model_fields_set contains the field + if self.extract_template_name is None and "extract_template_name" in self.model_fields_set: + _dict['extract_template_name'] = None + + # set to None if q (nullable) is None + # and model_fields_set contains the field + if self.q is None and "q" in self.model_fields_set: + _dict['q'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobListFilterPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "extract_template_name": obj.get("extract_template_name"), + "q": obj.get("q") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_list_public_v1.py b/candidate/generated/nimble_client/models/job_list_public_v1.py new file mode 100644 index 0000000..de326d1 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_list_public_v1.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.job_public_v1 import JobPublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobListPublicV1(BaseModel): + """ + A page of jobs. + """ # noqa: E501 + items: List[JobPublicV1] = Field(description="Jobs on this page.") + page: Optional[StrictInt] = Field(default=1, description="Current page number.") + per_page: Optional[StrictInt] = Field(default=20, description="Number of items per page.") + total: StrictInt = Field(description="Total number of jobs matching the query.") + __properties: ClassVar[List[str]] = ["items", "page", "per_page", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobListPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobListPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [JobPublicV1.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "page": obj.get("page") if obj.get("page") is not None else 1, + "per_page": obj.get("per_page") if obj.get("per_page") is not None else 20, + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_public_v1.py b/candidate/generated/nimble_client/models/job_public_v1.py new file mode 100644 index 0000000..d9f7ce5 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_public_v1.py @@ -0,0 +1,191 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.job_destination_public_v1 import JobDestinationPublicV1 +from nimble_client.models.job_inputs_public_v1 import JobInputsPublicV1 +from nimble_client.models.job_schedule_public_v1 import JobSchedulePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobPublicV1(BaseModel): + """ + A configured job: an agent plus its schedule, inputs, and destination. + """ # noqa: E501 + agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent this job runs.") + created_at: Optional[datetime] = Field(default=None, description="When the job was created.") + description: Optional[StrictStr] = Field(default=None, description="Free-text description of the job.") + destination: Optional[JobDestinationPublicV1] = Field(default=None, description="Where the job writes its results.") + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly job name shown in the UI.") + id: Annotated[str, Field(strict=True)] = Field(description="Unique job identifier (job_).") + inputs: Optional[JobInputsPublicV1] = Field(default=None, description="Input data configuration for the job.") + last_run_at: Optional[datetime] = Field(default=None, description="Timestamp of the most recent run.") + last_run_status: Optional[StrictStr] = Field(default=None, description="Status of the most recent run.") + name: StrictStr = Field(description="Job name.") + schedule: Optional[JobSchedulePublicV1] = Field(default=None, description="Cron schedule controlling automatic runs.") + updated_at: Optional[datetime] = Field(default=None, description="When the job was last updated.") + __properties: ClassVar[List[str]] = ["agent_name", "created_at", "description", "destination", "display_name", "id", "inputs", "last_run_at", "last_run_status", "name", "schedule", "updated_at"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^job_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^job_[1-9][0-9]*$/") + return value + + @field_validator('last_run_status') + def last_run_status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING']): + raise ValueError("must be one of enum values ('PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of destination + if self.destination: + _dict['destination'] = self.destination.to_dict() + # override the default output from pydantic by calling `to_dict()` of inputs + if self.inputs: + _dict['inputs'] = self.inputs.to_dict() + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # set to None if agent_name (nullable) is None + # and model_fields_set contains the field + if self.agent_name is None and "agent_name" in self.model_fields_set: + _dict['agent_name'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if destination (nullable) is None + # and model_fields_set contains the field + if self.destination is None and "destination" in self.model_fields_set: + _dict['destination'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if inputs (nullable) is None + # and model_fields_set contains the field + if self.inputs is None and "inputs" in self.model_fields_set: + _dict['inputs'] = None + + # set to None if last_run_at (nullable) is None + # and model_fields_set contains the field + if self.last_run_at is None and "last_run_at" in self.model_fields_set: + _dict['last_run_at'] = None + + # set to None if last_run_status (nullable) is None + # and model_fields_set contains the field + if self.last_run_status is None and "last_run_status" in self.model_fields_set: + _dict['last_run_status'] = None + + # set to None if schedule (nullable) is None + # and model_fields_set contains the field + if self.schedule is None and "schedule" in self.model_fields_set: + _dict['schedule'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "destination": JobDestinationPublicV1.from_dict(obj["destination"]) if obj.get("destination") is not None else None, + "display_name": obj.get("display_name"), + "id": obj.get("id"), + "inputs": JobInputsPublicV1.from_dict(obj["inputs"]) if obj.get("inputs") is not None else None, + "last_run_at": obj.get("last_run_at"), + "last_run_status": obj.get("last_run_status"), + "name": obj.get("name"), + "schedule": JobSchedulePublicV1.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None, + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_public_v2.py b/candidate/generated/nimble_client/models/job_public_v2.py new file mode 100644 index 0000000..294bedb --- /dev/null +++ b/candidate/generated/nimble_client/models/job_public_v2.py @@ -0,0 +1,191 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.job_destination_public_v2 import JobDestinationPublicV2 +from nimble_client.models.job_inputs_public_v2 import JobInputsPublicV2 +from nimble_client.models.job_schedule_public_v2 import JobSchedulePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobPublicV2(BaseModel): + """ + A configured job: an agent plus its schedule, inputs, and destination. + """ # noqa: E501 + created_at: Optional[datetime] = Field(default=None, description="When the job was created.") + description: Optional[StrictStr] = Field(default=None, description="Free-text description of the job.") + destination: Optional[JobDestinationPublicV2] = Field(default=None, description="Where the job writes its results.") + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly job name shown in the UI.") + extract_template_name: Optional[StrictStr] = Field(default=None, description="Name of the extract template this job runs.") + id: Annotated[str, Field(strict=True)] = Field(description="Unique job identifier (job_).") + inputs: Optional[JobInputsPublicV2] = Field(default=None, description="Input data configuration for the job.") + last_run_at: Optional[datetime] = Field(default=None, description="Timestamp of the most recent run.") + last_run_status: Optional[StrictStr] = Field(default=None, description="Status of the most recent run.") + name: StrictStr = Field(description="Job name.") + schedule: Optional[JobSchedulePublicV2] = Field(default=None, description="Cron schedule controlling automatic runs.") + updated_at: Optional[datetime] = Field(default=None, description="When the job was last updated.") + __properties: ClassVar[List[str]] = ["created_at", "description", "destination", "display_name", "extract_template_name", "id", "inputs", "last_run_at", "last_run_status", "name", "schedule", "updated_at"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^job_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^job_[1-9][0-9]*$/") + return value + + @field_validator('last_run_status') + def last_run_status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING']): + raise ValueError("must be one of enum values ('PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of destination + if self.destination: + _dict['destination'] = self.destination.to_dict() + # override the default output from pydantic by calling `to_dict()` of inputs + if self.inputs: + _dict['inputs'] = self.inputs.to_dict() + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if destination (nullable) is None + # and model_fields_set contains the field + if self.destination is None and "destination" in self.model_fields_set: + _dict['destination'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if extract_template_name (nullable) is None + # and model_fields_set contains the field + if self.extract_template_name is None and "extract_template_name" in self.model_fields_set: + _dict['extract_template_name'] = None + + # set to None if inputs (nullable) is None + # and model_fields_set contains the field + if self.inputs is None and "inputs" in self.model_fields_set: + _dict['inputs'] = None + + # set to None if last_run_at (nullable) is None + # and model_fields_set contains the field + if self.last_run_at is None and "last_run_at" in self.model_fields_set: + _dict['last_run_at'] = None + + # set to None if last_run_status (nullable) is None + # and model_fields_set contains the field + if self.last_run_status is None and "last_run_status" in self.model_fields_set: + _dict['last_run_status'] = None + + # set to None if schedule (nullable) is None + # and model_fields_set contains the field + if self.schedule is None and "schedule" in self.model_fields_set: + _dict['schedule'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "destination": JobDestinationPublicV2.from_dict(obj["destination"]) if obj.get("destination") is not None else None, + "display_name": obj.get("display_name"), + "extract_template_name": obj.get("extract_template_name"), + "id": obj.get("id"), + "inputs": JobInputsPublicV2.from_dict(obj["inputs"]) if obj.get("inputs") is not None else None, + "last_run_at": obj.get("last_run_at"), + "last_run_status": obj.get("last_run_status"), + "name": obj.get("name"), + "schedule": JobSchedulePublicV2.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None, + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_cancel_response_public_v1.py b/candidate/generated/nimble_client/models/job_run_cancel_response_public_v1.py new file mode 100644 index 0000000..1a85996 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_cancel_response_public_v1.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunCancelResponsePublicV1(BaseModel): + """ + Result of cancelling a run. + """ # noqa: E501 + id: Annotated[str, Field(strict=True)] = Field(description="Identifier of the cancelled run.") + status: StrictStr = Field(description="Run status after cancellation.") + __properties: ClassVar[List[str]] = ["id", "status"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^run_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^run_[1-9][0-9]*$/") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING']): + raise ValueError("must be one of enum values ('PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunCancelResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunCancelResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_cancel_response_public_v2.py b/candidate/generated/nimble_client/models/job_run_cancel_response_public_v2.py new file mode 100644 index 0000000..222e295 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_cancel_response_public_v2.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunCancelResponsePublicV2(BaseModel): + """ + Result of cancelling a run. + """ # noqa: E501 + id: Annotated[str, Field(strict=True)] = Field(description="Identifier of the cancelled run.") + status: StrictStr = Field(description="Run status after cancellation.") + __properties: ClassVar[List[str]] = ["id", "status"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^run_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^run_[1-9][0-9]*$/") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING']): + raise ValueError("must be one of enum values ('PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunCancelResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunCancelResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_detail_public_v1.py b/candidate/generated/nimble_client/models/job_run_detail_public_v1.py new file mode 100644 index 0000000..7e4a841 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_detail_public_v1.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.job_context_public_v1 import JobContextPublicV1 +from nimble_client.models.job_run_error_public_v1 import JobRunErrorPublicV1 +from nimble_client.models.job_run_summary_public_v1 import JobRunSummaryPublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunDetailPublicV1(BaseModel): + """ + Full detail for a single run. + """ # noqa: E501 + created_at: datetime = Field(description="When the run was created.") + error: Optional[JobRunErrorPublicV1] = Field(default=None, description="Error details when the run failed.") + finished_at: Optional[datetime] = Field(default=None, description="When the run finished.") + id: Annotated[str, Field(strict=True)] = Field(description="Unique run identifier (run_).") + inputs_sample: Optional[List[Any]] = Field(default=None, description="Sample of the run's input records.") + job: JobContextPublicV1 = Field(description="Context of the job this run belongs to.") + started_at: Optional[datetime] = Field(default=None, description="When the run started executing.") + status: StrictStr = Field(description="Current run status.") + summary: Optional[JobRunSummaryPublicV1] = Field(default=None, description="Aggregate metrics for the run.") + triggered_by: StrictStr = Field(description="What triggered the run: 'schedule' or 'manual'.") + __properties: ClassVar[List[str]] = ["created_at", "error", "finished_at", "id", "inputs_sample", "job", "started_at", "status", "summary", "triggered_by"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^run_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^run_[1-9][0-9]*$/") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING']): + raise ValueError("must be one of enum values ('PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING')") + return value + + @field_validator('triggered_by') + def triggered_by_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['schedule', 'manual']): + raise ValueError("must be one of enum values ('schedule', 'manual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunDetailPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of error + if self.error: + _dict['error'] = self.error.to_dict() + # override the default output from pydantic by calling `to_dict()` of job + if self.job: + _dict['job'] = self.job.to_dict() + # override the default output from pydantic by calling `to_dict()` of summary + if self.summary: + _dict['summary'] = self.summary.to_dict() + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if finished_at (nullable) is None + # and model_fields_set contains the field + if self.finished_at is None and "finished_at" in self.model_fields_set: + _dict['finished_at'] = None + + # set to None if inputs_sample (nullable) is None + # and model_fields_set contains the field + if self.inputs_sample is None and "inputs_sample" in self.model_fields_set: + _dict['inputs_sample'] = None + + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict['started_at'] = None + + # set to None if summary (nullable) is None + # and model_fields_set contains the field + if self.summary is None and "summary" in self.model_fields_set: + _dict['summary'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunDetailPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "error": JobRunErrorPublicV1.from_dict(obj["error"]) if obj.get("error") is not None else None, + "finished_at": obj.get("finished_at"), + "id": obj.get("id"), + "inputs_sample": obj.get("inputs_sample"), + "job": JobContextPublicV1.from_dict(obj["job"]) if obj.get("job") is not None else None, + "started_at": obj.get("started_at"), + "status": obj.get("status"), + "summary": JobRunSummaryPublicV1.from_dict(obj["summary"]) if obj.get("summary") is not None else None, + "triggered_by": obj.get("triggered_by") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_detail_public_v2.py b/candidate/generated/nimble_client/models/job_run_detail_public_v2.py new file mode 100644 index 0000000..938c729 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_detail_public_v2.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.job_context_public_v2 import JobContextPublicV2 +from nimble_client.models.job_run_error_public_v2 import JobRunErrorPublicV2 +from nimble_client.models.job_run_summary_public_v2 import JobRunSummaryPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunDetailPublicV2(BaseModel): + """ + Full detail for a single run. + """ # noqa: E501 + created_at: datetime = Field(description="When the run was created.") + error: Optional[JobRunErrorPublicV2] = Field(default=None, description="Error details when the run failed.") + finished_at: Optional[datetime] = Field(default=None, description="When the run finished.") + id: Annotated[str, Field(strict=True)] = Field(description="Unique run identifier (run_).") + inputs_sample: Optional[List[Any]] = Field(default=None, description="Sample of the run's input records.") + job: JobContextPublicV2 = Field(description="Context of the job this run belongs to.") + started_at: Optional[datetime] = Field(default=None, description="When the run started executing.") + status: StrictStr = Field(description="Current run status.") + summary: Optional[JobRunSummaryPublicV2] = Field(default=None, description="Aggregate metrics for the run.") + triggered_by: StrictStr = Field(description="What triggered the run: 'schedule' or 'manual'.") + __properties: ClassVar[List[str]] = ["created_at", "error", "finished_at", "id", "inputs_sample", "job", "started_at", "status", "summary", "triggered_by"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^run_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^run_[1-9][0-9]*$/") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING']): + raise ValueError("must be one of enum values ('PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING')") + return value + + @field_validator('triggered_by') + def triggered_by_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['schedule', 'manual']): + raise ValueError("must be one of enum values ('schedule', 'manual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunDetailPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of error + if self.error: + _dict['error'] = self.error.to_dict() + # override the default output from pydantic by calling `to_dict()` of job + if self.job: + _dict['job'] = self.job.to_dict() + # override the default output from pydantic by calling `to_dict()` of summary + if self.summary: + _dict['summary'] = self.summary.to_dict() + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if finished_at (nullable) is None + # and model_fields_set contains the field + if self.finished_at is None and "finished_at" in self.model_fields_set: + _dict['finished_at'] = None + + # set to None if inputs_sample (nullable) is None + # and model_fields_set contains the field + if self.inputs_sample is None and "inputs_sample" in self.model_fields_set: + _dict['inputs_sample'] = None + + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict['started_at'] = None + + # set to None if summary (nullable) is None + # and model_fields_set contains the field + if self.summary is None and "summary" in self.model_fields_set: + _dict['summary'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunDetailPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "error": JobRunErrorPublicV2.from_dict(obj["error"]) if obj.get("error") is not None else None, + "finished_at": obj.get("finished_at"), + "id": obj.get("id"), + "inputs_sample": obj.get("inputs_sample"), + "job": JobContextPublicV2.from_dict(obj["job"]) if obj.get("job") is not None else None, + "started_at": obj.get("started_at"), + "status": obj.get("status"), + "summary": JobRunSummaryPublicV2.from_dict(obj["summary"]) if obj.get("summary") is not None else None, + "triggered_by": obj.get("triggered_by") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_error_public_v1.py b/candidate/generated/nimble_client/models/job_run_error_public_v1.py new file mode 100644 index 0000000..d8c4071 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_error_public_v1.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunErrorPublicV1(BaseModel): + """ + Error details for a failed run. + """ # noqa: E501 + errors_sample: Optional[List[Dict[str, Any]]] = Field(default=None, description="Sample of individual error records from the run.") + message: Optional[StrictStr] = Field(default=None, description="Human-readable error message.") + step: Optional[StrictStr] = Field(default=None, description="Pipeline step where the error occurred.") + __properties: ClassVar[List[str]] = ["errors_sample", "message", "step"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunErrorPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if errors_sample (nullable) is None + # and model_fields_set contains the field + if self.errors_sample is None and "errors_sample" in self.model_fields_set: + _dict['errors_sample'] = None + + # set to None if message (nullable) is None + # and model_fields_set contains the field + if self.message is None and "message" in self.model_fields_set: + _dict['message'] = None + + # set to None if step (nullable) is None + # and model_fields_set contains the field + if self.step is None and "step" in self.model_fields_set: + _dict['step'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunErrorPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "errors_sample": obj.get("errors_sample"), + "message": obj.get("message"), + "step": obj.get("step") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_error_public_v2.py b/candidate/generated/nimble_client/models/job_run_error_public_v2.py new file mode 100644 index 0000000..99d32fe --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_error_public_v2.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunErrorPublicV2(BaseModel): + """ + Error details for a failed run. + """ # noqa: E501 + errors_sample: Optional[List[Dict[str, Any]]] = Field(default=None, description="Sample of individual error records from the run.") + message: Optional[StrictStr] = Field(default=None, description="Human-readable error message.") + step: Optional[StrictStr] = Field(default=None, description="Pipeline step where the error occurred.") + __properties: ClassVar[List[str]] = ["errors_sample", "message", "step"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunErrorPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if errors_sample (nullable) is None + # and model_fields_set contains the field + if self.errors_sample is None and "errors_sample" in self.model_fields_set: + _dict['errors_sample'] = None + + # set to None if message (nullable) is None + # and model_fields_set contains the field + if self.message is None and "message" in self.model_fields_set: + _dict['message'] = None + + # set to None if step (nullable) is None + # and model_fields_set contains the field + if self.step is None and "step" in self.model_fields_set: + _dict['step'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunErrorPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "errors_sample": obj.get("errors_sample"), + "message": obj.get("message"), + "step": obj.get("step") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_list_filter_public_v2.py b/candidate/generated/nimble_client/models/job_run_list_filter_public_v2.py new file mode 100644 index 0000000..916c94e --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_list_filter_public_v2.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunListFilterPublicV2(BaseModel): + """ + JobRunListFilterPublicV2 + """ # noqa: E501 + status: Optional[StrictStr] = Field(default=None, description="Filter by status.") + __properties: ClassVar[List[str]] = ["status"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunListFilterPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunListFilterPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_list_public_v1.py b/candidate/generated/nimble_client/models/job_run_list_public_v1.py new file mode 100644 index 0000000..b639a3f --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_list_public_v1.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.job_run_public_v1 import JobRunPublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunListPublicV1(BaseModel): + """ + A page of job runs. + """ # noqa: E501 + items: List[JobRunPublicV1] = Field(description="Runs on this page.") + page: Optional[StrictInt] = Field(default=1, description="Current page number.") + per_page: Optional[StrictInt] = Field(default=20, description="Number of items per page.") + total: StrictInt = Field(description="Total number of runs matching the query.") + __properties: ClassVar[List[str]] = ["items", "page", "per_page", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunListPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunListPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [JobRunPublicV1.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "page": obj.get("page") if obj.get("page") is not None else 1, + "per_page": obj.get("per_page") if obj.get("per_page") is not None else 20, + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_public_v1.py b/candidate/generated/nimble_client/models/job_run_public_v1.py new file mode 100644 index 0000000..cfbd1de --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_public_v1.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunPublicV1(BaseModel): + """ + A single execution of a job. + """ # noqa: E501 + created_at: datetime = Field(description="When the run was created.") + finished_at: Optional[datetime] = Field(default=None, description="When the run finished.") + id: Annotated[str, Field(strict=True)] = Field(description="Unique run identifier (run_).") + input_count: Optional[StrictInt] = Field(default=None, description="Number of input records processed.") + job_id: Annotated[str, Field(strict=True)] = Field(description="Identifier of the job this run belongs to.") + result_count: Optional[StrictInt] = Field(default=None, description="Number of result records produced.") + started_at: Optional[datetime] = Field(default=None, description="When the run started executing.") + status: StrictStr = Field(description="Current run status.") + triggered_by: StrictStr = Field(description="What triggered the run: 'schedule' or 'manual'.") + __properties: ClassVar[List[str]] = ["created_at", "finished_at", "id", "input_count", "job_id", "result_count", "started_at", "status", "triggered_by"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^run_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^run_[1-9][0-9]*$/") + return value + + @field_validator('job_id', mode="before") + def job_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^job_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^job_[1-9][0-9]*$/") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING']): + raise ValueError("must be one of enum values ('PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING')") + return value + + @field_validator('triggered_by') + def triggered_by_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['schedule', 'manual']): + raise ValueError("must be one of enum values ('schedule', 'manual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if finished_at (nullable) is None + # and model_fields_set contains the field + if self.finished_at is None and "finished_at" in self.model_fields_set: + _dict['finished_at'] = None + + # set to None if input_count (nullable) is None + # and model_fields_set contains the field + if self.input_count is None and "input_count" in self.model_fields_set: + _dict['input_count'] = None + + # set to None if result_count (nullable) is None + # and model_fields_set contains the field + if self.result_count is None and "result_count" in self.model_fields_set: + _dict['result_count'] = None + + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict['started_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "finished_at": obj.get("finished_at"), + "id": obj.get("id"), + "input_count": obj.get("input_count"), + "job_id": obj.get("job_id"), + "result_count": obj.get("result_count"), + "started_at": obj.get("started_at"), + "status": obj.get("status"), + "triggered_by": obj.get("triggered_by") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_public_v2.py b/candidate/generated/nimble_client/models/job_run_public_v2.py new file mode 100644 index 0000000..4bbc229 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_public_v2.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunPublicV2(BaseModel): + """ + A single execution of a job. + """ # noqa: E501 + created_at: datetime = Field(description="When the run was created.") + finished_at: Optional[datetime] = Field(default=None, description="When the run finished.") + id: Annotated[str, Field(strict=True)] = Field(description="Unique run identifier (run_).") + input_count: Optional[StrictInt] = Field(default=None, description="Number of input records processed.") + job_id: Annotated[str, Field(strict=True)] = Field(description="Identifier of the job this run belongs to.") + result_count: Optional[StrictInt] = Field(default=None, description="Number of result records produced.") + started_at: Optional[datetime] = Field(default=None, description="When the run started executing.") + status: StrictStr = Field(description="Current run status.") + triggered_by: StrictStr = Field(description="What triggered the run: 'schedule' or 'manual'.") + __properties: ClassVar[List[str]] = ["created_at", "finished_at", "id", "input_count", "job_id", "result_count", "started_at", "status", "triggered_by"] + + @field_validator('id', mode="before") + def id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^run_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^run_[1-9][0-9]*$/") + return value + + @field_validator('job_id', mode="before") + def job_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if isinstance(value, str) and not re.match(r"^job_[1-9][0-9]*$", value): + raise ValueError(r"must validate the regular expression /^job_[1-9][0-9]*$/") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING']): + raise ValueError("must be one of enum values ('PENDING', 'RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'TIMEOUT', 'WARNING')") + return value + + @field_validator('triggered_by') + def triggered_by_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['schedule', 'manual']): + raise ValueError("must be one of enum values ('schedule', 'manual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if finished_at (nullable) is None + # and model_fields_set contains the field + if self.finished_at is None and "finished_at" in self.model_fields_set: + _dict['finished_at'] = None + + # set to None if input_count (nullable) is None + # and model_fields_set contains the field + if self.input_count is None and "input_count" in self.model_fields_set: + _dict['input_count'] = None + + # set to None if result_count (nullable) is None + # and model_fields_set contains the field + if self.result_count is None and "result_count" in self.model_fields_set: + _dict['result_count'] = None + + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict['started_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "finished_at": obj.get("finished_at"), + "id": obj.get("id"), + "input_count": obj.get("input_count"), + "job_id": obj.get("job_id"), + "result_count": obj.get("result_count"), + "started_at": obj.get("started_at"), + "status": obj.get("status"), + "triggered_by": obj.get("triggered_by") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_summary_public_v1.py b/candidate/generated/nimble_client/models/job_run_summary_public_v1.py new file mode 100644 index 0000000..0a97187 --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_summary_public_v1.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunSummaryPublicV1(BaseModel): + """ + Aggregate metrics for a run. + """ # noqa: E501 + input_count: Optional[StrictInt] = Field(default=None, description="Number of input records processed.") + match_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Fraction of inputs that produced a result (result_count / input_count), from 0.0 to 1.0.") + result_count: Optional[StrictInt] = Field(default=None, description="Number of result records produced.") + __properties: ClassVar[List[str]] = ["input_count", "match_rate", "result_count"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunSummaryPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if input_count (nullable) is None + # and model_fields_set contains the field + if self.input_count is None and "input_count" in self.model_fields_set: + _dict['input_count'] = None + + # set to None if match_rate (nullable) is None + # and model_fields_set contains the field + if self.match_rate is None and "match_rate" in self.model_fields_set: + _dict['match_rate'] = None + + # set to None if result_count (nullable) is None + # and model_fields_set contains the field + if self.result_count is None and "result_count" in self.model_fields_set: + _dict['result_count'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunSummaryPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "input_count": obj.get("input_count"), + "match_rate": obj.get("match_rate"), + "result_count": obj.get("result_count") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_run_summary_public_v2.py b/candidate/generated/nimble_client/models/job_run_summary_public_v2.py new file mode 100644 index 0000000..24f5acc --- /dev/null +++ b/candidate/generated/nimble_client/models/job_run_summary_public_v2.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobRunSummaryPublicV2(BaseModel): + """ + Aggregate metrics for a run. + """ # noqa: E501 + input_count: Optional[StrictInt] = Field(default=None, description="Number of input records processed.") + match_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Fraction of inputs that produced a result (result_count / input_count), from 0.0 to 1.0.") + result_count: Optional[StrictInt] = Field(default=None, description="Number of result records produced.") + __properties: ClassVar[List[str]] = ["input_count", "match_rate", "result_count"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobRunSummaryPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if input_count (nullable) is None + # and model_fields_set contains the field + if self.input_count is None and "input_count" in self.model_fields_set: + _dict['input_count'] = None + + # set to None if match_rate (nullable) is None + # and model_fields_set contains the field + if self.match_rate is None and "match_rate" in self.model_fields_set: + _dict['match_rate'] = None + + # set to None if result_count (nullable) is None + # and model_fields_set contains the field + if self.result_count is None and "result_count" in self.model_fields_set: + _dict['result_count'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobRunSummaryPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "input_count": obj.get("input_count"), + "match_rate": obj.get("match_rate"), + "result_count": obj.get("result_count") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_schedule_public_v1.py b/candidate/generated/nimble_client/models/job_schedule_public_v1.py new file mode 100644 index 0000000..a037eeb --- /dev/null +++ b/candidate/generated/nimble_client/models/job_schedule_public_v1.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobSchedulePublicV1(BaseModel): + """ + Cron-based schedule controlling when a job runs automatically. + """ # noqa: E501 + cron: StrictStr = Field(description="Cron expression defining when the job runs.") + enabled: StrictBool = Field(description="Whether the schedule is currently active.") + __properties: ClassVar[List[str]] = ["cron", "enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobSchedulePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobSchedulePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cron": obj.get("cron"), + "enabled": obj.get("enabled") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/job_schedule_public_v2.py b/candidate/generated/nimble_client/models/job_schedule_public_v2.py new file mode 100644 index 0000000..524dc4a --- /dev/null +++ b/candidate/generated/nimble_client/models/job_schedule_public_v2.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JobSchedulePublicV2(BaseModel): + """ + Cron-based schedule controlling when a job runs automatically. + """ # noqa: E501 + cron: StrictStr = Field(description="Cron expression defining when the job runs.") + enabled: StrictBool = Field(description="Whether the schedule is currently active.") + __properties: ClassVar[List[str]] = ["cron", "enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JobSchedulePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JobSchedulePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cron": obj.get("cron"), + "enabled": obj.get("enabled") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/json_claim_trust.py b/candidate/generated/nimble_client/models/json_claim_trust.py new file mode 100644 index 0000000..2c46fb2 --- /dev/null +++ b/candidate/generated/nimble_client/models/json_claim_trust.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.trust_citation import TrustCitation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JsonClaimTrust(BaseModel): + """ + Trust metadata for one value in a structured (JSON) answer, keyed by JSON path. + """ # noqa: E501 + citations: List[TrustCitation] = Field(description="Citations backing this value.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Confidence in this value.") + path: StrictStr = Field(description="JSON path of the value in the structured output this claim refers to.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + __properties: ClassVar[List[str]] = ["citations", "confidence", "path", "reasoning"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JsonClaimTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in citations (list) + _items = [] + if self.citations: + for _item_citations in self.citations: + _items.append(_item_citations.to_dict() if _item_citations is not None else None) + _dict['citations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JsonClaimTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "citations": [TrustCitation.from_dict(_item) for _item in obj["citations"]] if obj.get("citations") is not None else None, + "confidence": obj.get("confidence"), + "path": obj.get("path"), + "reasoning": obj.get("reasoning") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/json_patch_op.py b/candidate/generated/nimble_client/models/json_patch_op.py new file mode 100644 index 0000000..d007ea7 --- /dev/null +++ b/candidate/generated/nimble_client/models/json_patch_op.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JsonPatchOp(BaseModel): + """ + A single JSON Patch operation per RFC 6902. + """ # noqa: E501 + var_from: Optional[StrictStr] = Field(default=None, alias="from") + op: StrictStr + path: StrictStr + value: Optional[Any] = None + __properties: ClassVar[List[str]] = ["from", "op", "path", "value"] + + @field_validator('op') + def op_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['add', 'remove', 'replace', 'move', 'copy', 'test']): + raise ValueError("must be one of enum values ('add', 'remove', 'replace', 'move', 'copy', 'test')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JsonPatchOp from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of value + if self.value: + _dict['value'] = self.value.to_dict() + # set to None if var_from (nullable) is None + # and model_fields_set contains the field + if self.var_from is None and "var_from" in self.model_fields_set: + _dict['from'] = None + + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['value'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JsonPatchOp from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "from": obj.get("from"), + "op": obj.get("op"), + "path": obj.get("path"), + "value": AnyOf.from_dict(obj["value"]) if obj.get("value") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/json_run_trust.py b/candidate/generated/nimble_client/models/json_run_trust.py new file mode 100644 index 0000000..a778c46 --- /dev/null +++ b/candidate/generated/nimble_client/models/json_run_trust.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.json_claim_trust import JsonClaimTrust +from nimble_client.models.trust_source import TrustSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class JsonRunTrust(BaseModel): + """ + Trust metadata for a structured answer: run-level confidence plus per-value citations. + """ # noqa: E501 + claims: List[JsonClaimTrust] = Field(description="Per-value trust, keyed by JSON path in the structured output.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Overall confidence in the answer.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + sources: List[TrustSource] = Field(description="Sources consulted while producing the answer.") + __properties: ClassVar[List[str]] = ["claims", "confidence", "reasoning", "sources"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JsonRunTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in claims (list) + _items = [] + if self.claims: + for _item_claims in self.claims: + _items.append(_item_claims.to_dict() if _item_claims is not None else None) + _dict['claims'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JsonRunTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "claims": [JsonClaimTrust.from_dict(_item) for _item in obj["claims"]] if obj.get("claims") is not None else None, + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "sources": [TrustSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_extract_template_response_public_v2.py b/candidate/generated/nimble_client/models/list_response_extract_template_response_public_v2.py new file mode 100644 index 0000000..8be4990 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_extract_template_response_public_v2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.extract_template_response_public_v2 import ExtractTemplateResponsePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseExtractTemplateResponsePublicV2(BaseModel): + """ + ListResponseExtractTemplateResponsePublicV2 + """ # noqa: E501 + items: List[ExtractTemplateResponsePublicV2] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseExtractTemplateResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseExtractTemplateResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [ExtractTemplateResponsePublicV2.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_extract_template_version_response_public_v2.py b/candidate/generated/nimble_client/models/list_response_extract_template_version_response_public_v2.py new file mode 100644 index 0000000..034bc50 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_extract_template_version_response_public_v2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.extract_template_version_response_public_v2 import ExtractTemplateVersionResponsePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseExtractTemplateVersionResponsePublicV2(BaseModel): + """ + ListResponseExtractTemplateVersionResponsePublicV2 + """ # noqa: E501 + items: List[ExtractTemplateVersionResponsePublicV2] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseExtractTemplateVersionResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseExtractTemplateVersionResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [ExtractTemplateVersionResponsePublicV2.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_job_public_v2.py b/candidate/generated/nimble_client/models/list_response_job_public_v2.py new file mode 100644 index 0000000..ffd6597 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_job_public_v2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.job_public_v2 import JobPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseJobPublicV2(BaseModel): + """ + ListResponseJobPublicV2 + """ # noqa: E501 + items: List[JobPublicV2] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseJobPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseJobPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [JobPublicV2.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_job_run_public_v2.py b/candidate/generated/nimble_client/models/list_response_job_run_public_v2.py new file mode 100644 index 0000000..9505973 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_job_run_public_v2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.job_run_public_v2 import JobRunPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseJobRunPublicV2(BaseModel): + """ + ListResponseJobRunPublicV2 + """ # noqa: E501 + items: List[JobRunPublicV2] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseJobRunPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseJobRunPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [JobRunPublicV2.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_task_run_response_public_v1.py b/candidate/generated/nimble_client/models/list_response_task_run_response_public_v1.py new file mode 100644 index 0000000..87c2e31 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_task_run_response_public_v1.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.task_run_response_public_v1 import TaskRunResponsePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseTaskRunResponsePublicV1(BaseModel): + """ + ListResponseTaskRunResponsePublicV1 + """ # noqa: E501 + items: List[TaskRunResponsePublicV1] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseTaskRunResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseTaskRunResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [TaskRunResponsePublicV1.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_task_run_response_public_v2.py b/candidate/generated/nimble_client/models/list_response_task_run_response_public_v2.py new file mode 100644 index 0000000..f883159 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_task_run_response_public_v2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.task_run_response_public_v2 import TaskRunResponsePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseTaskRunResponsePublicV2(BaseModel): + """ + ListResponseTaskRunResponsePublicV2 + """ # noqa: E501 + items: List[TaskRunResponsePublicV2] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseTaskRunResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseTaskRunResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [TaskRunResponsePublicV2.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_web_search_agent_response_public_v1.py b/candidate/generated/nimble_client/models/list_response_web_search_agent_response_public_v1.py new file mode 100644 index 0000000..47ffb65 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_web_search_agent_response_public_v1.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.web_search_agent_response_public_v1 import WebSearchAgentResponsePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseWebSearchAgentResponsePublicV1(BaseModel): + """ + ListResponseWebSearchAgentResponsePublicV1 + """ # noqa: E501 + items: List[WebSearchAgentResponsePublicV1] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseWebSearchAgentResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseWebSearchAgentResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [WebSearchAgentResponsePublicV1.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_web_search_agent_response_public_v2.py b/candidate/generated/nimble_client/models/list_response_web_search_agent_response_public_v2.py new file mode 100644 index 0000000..7cf1ad4 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_web_search_agent_response_public_v2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.web_search_agent_response_public_v2 import WebSearchAgentResponsePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseWebSearchAgentResponsePublicV2(BaseModel): + """ + ListResponseWebSearchAgentResponsePublicV2 + """ # noqa: E501 + items: List[WebSearchAgentResponsePublicV2] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseWebSearchAgentResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseWebSearchAgentResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [WebSearchAgentResponsePublicV2.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_web_search_agent_template_response_public_v1.py b/candidate/generated/nimble_client/models/list_response_web_search_agent_template_response_public_v1.py new file mode 100644 index 0000000..86a5566 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_web_search_agent_template_response_public_v1.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.web_search_agent_template_response_public_v1 import WebSearchAgentTemplateResponsePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseWebSearchAgentTemplateResponsePublicV1(BaseModel): + """ + ListResponseWebSearchAgentTemplateResponsePublicV1 + """ # noqa: E501 + items: List[WebSearchAgentTemplateResponsePublicV1] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseWebSearchAgentTemplateResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseWebSearchAgentTemplateResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [WebSearchAgentTemplateResponsePublicV1.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/list_response_web_search_agent_template_response_public_v2.py b/candidate/generated/nimble_client/models/list_response_web_search_agent_template_response_public_v2.py new file mode 100644 index 0000000..1164801 --- /dev/null +++ b/candidate/generated/nimble_client/models/list_response_web_search_agent_template_response_public_v2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from nimble_client.models.web_search_agent_template_response_public_v2 import WebSearchAgentTemplateResponsePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ListResponseWebSearchAgentTemplateResponsePublicV2(BaseModel): + """ + ListResponseWebSearchAgentTemplateResponsePublicV2 + """ # noqa: E501 + items: List[WebSearchAgentTemplateResponsePublicV2] = Field(description="Items returned in this page.") + limit: StrictInt = Field(description="Maximum number of items returned.") + offset: StrictInt = Field(description="Number of items skipped before this page.") + total: StrictInt = Field(description="Total number of items matching the query.") + __properties: ClassVar[List[str]] = ["items", "limit", "offset", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListResponseWebSearchAgentTemplateResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + _items.append(_item_items.to_dict() if _item_items is not None else None) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListResponseWebSearchAgentTemplateResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [WebSearchAgentTemplateResponsePublicV2.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "limit": obj.get("limit"), + "offset": obj.get("offset"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/location_inner.py b/candidate/generated/nimble_client/models/location_inner.py new file mode 100644 index 0000000..8398b94 --- /dev/null +++ b/candidate/generated/nimble_client/models/location_inner.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +LOCATIONINNER_ANY_OF_SCHEMAS = ["int", "str"] + +class LocationInner(BaseModel): + """ + LocationInner + """ + + # data type: str + anyof_schema_1_validator: Optional[StrictStr] = None + # data type: int + anyof_schema_2_validator: Optional[StrictInt] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[int, str]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "int", "str" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = LocationInner.model_construct() + error_messages = [] + # validate data type: str + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: int + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in LocationInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into str + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into int + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into LocationInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/managed_by.py b/candidate/generated/nimble_client/models/managed_by.py new file mode 100644 index 0000000..9d2971e --- /dev/null +++ b/candidate/generated/nimble_client/models/managed_by.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ManagedBy(str, Enum): + """ + ManagedBy + """ + + """ + allowed enum values + """ + NIMBLE = 'nimble' + COMMUNITY = 'community' + SELF_MANAGED = 'self_managed' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ManagedBy from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/map_payload.py b/candidate/generated/nimble_client/models/map_payload.py new file mode 100644 index 0000000..056d719 --- /dev/null +++ b/candidate/generated/nimble_client/models/map_payload.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MapPayload(BaseModel): + """ + Request body model for the /map endpoint + """ # noqa: E501 + country: Optional[StrictStr] = Field(default=None, description="Country code for geolocation and proxy selection") + domain_filter: Optional[StrictStr] = Field(default='all', description="Includes subdomains of the main domain in the mapping process.") + limit: Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]] = Field(default=5000, description="Maximum number of links to return.") + locale: Optional[StrictStr] = Field(default=None, description="Locale for browser language and region settings") + sitemap: Optional[StrictStr] = Field(default='include', description="Sitemap and other methods will be used together to find URLs.") + url: StrictStr = Field(description="Url to map.") + __properties: ClassVar[List[str]] = ["country", "domain_filter", "limit", "locale", "sitemap", "url"] + + @field_validator('country') + def country_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW']): + raise ValueError("must be one of enum values ('AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW')") + return value + + @field_validator('domain_filter') + def domain_filter_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['domain', 'subdomain', 'all']): + raise ValueError("must be one of enum values ('domain', 'subdomain', 'all')") + return value + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto']): + raise ValueError("must be one of enum values ('aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto')") + return value + + @field_validator('sitemap') + def sitemap_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['skip', 'include', 'only']): + raise ValueError("must be one of enum values ('skip', 'include', 'only')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MapPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MapPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "domain_filter": obj.get("domain_filter") if obj.get("domain_filter") is not None else 'all', + "limit": obj.get("limit") if obj.get("limit") is not None else 5000, + "locale": obj.get("locale"), + "sitemap": obj.get("sitemap") if obj.get("sitemap") is not None else 'include', + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/map_response.py b/candidate/generated/nimble_client/models/map_response.py new file mode 100644 index 0000000..04eba5c --- /dev/null +++ b/candidate/generated/nimble_client/models/map_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.map_response_links_inner import MapResponseLinksInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MapResponse(BaseModel): + """ + Response schema for map requests. + """ # noqa: E501 + links: List[MapResponseLinksInner] = Field(description="Array of mapped links with optional titles and descriptions.") + success: StrictBool = Field(description="Indicates if the map request was successful.") + task_id: StrictStr = Field(description="Unique identifier for the map task.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["links", "success", "task_id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MapResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in links (list) + _items = [] + if self.links: + for _item_links in self.links: + _items.append(_item_links.to_dict() if _item_links is not None else None) + _dict['links'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MapResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "links": [MapResponseLinksInner.from_dict(_item) for _item in obj["links"]] if obj.get("links") is not None else None, + "success": obj.get("success"), + "task_id": obj.get("task_id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/map_response_links_inner.py b/candidate/generated/nimble_client/models/map_response_links_inner.py new file mode 100644 index 0000000..9a91cb6 --- /dev/null +++ b/candidate/generated/nimble_client/models/map_response_links_inner.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MapResponseLinksInner(BaseModel): + """ + MapResponseLinksInner + """ # noqa: E501 + description: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + title: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + url: Optional[StrictStr] = Field(description="URL for downloading the task results.") + __properties: ClassVar[List[str]] = ["description", "title", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MapResponseLinksInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MapResponseLinksInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "title": obj.get("title"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/media_async_payload.py b/candidate/generated/nimble_client/models/media_async_payload.py new file mode 100644 index 0000000..89516b6 --- /dev/null +++ b/candidate/generated/nimble_client/models/media_async_payload.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.media_async_payload_all_of_media_extractor_options import MediaAsyncPayloadAllOfMediaExtractorOptions +from nimble_client.models.media_async_payload_all_of_storage import MediaAsyncPayloadAllOfStorage +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MediaAsyncPayload(BaseModel): + """ + MediaAsyncPayload + """ # noqa: E501 + country: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + expected_mime_types: Optional[List[StrictStr]] = None + locale: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + media_extractor: Optional[StrictStr] = None + media_extractor_options: Optional[MediaAsyncPayloadAllOfMediaExtractorOptions] = None + storage: Optional[MediaAsyncPayloadAllOfStorage] = None + url: Optional[StrictStr] = Field(description="URL for downloading the task results.") + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["country", "expected_mime_types", "locale", "media_extractor", "media_extractor_options", "storage", "url", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('media_extractor') + def media_extractor_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['yt-dlp']): + raise ValueError("must be one of enum values ('yt-dlp')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MediaAsyncPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of media_extractor_options + if self.media_extractor_options: + _dict['media_extractor_options'] = self.media_extractor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() + # set to None if country (nullable) is None + # and model_fields_set contains the field + if self.country is None and "country" in self.model_fields_set: + _dict['country'] = None + + # set to None if locale (nullable) is None + # and model_fields_set contains the field + if self.locale is None and "locale" in self.model_fields_set: + _dict['locale'] = None + + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MediaAsyncPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "expected_mime_types": obj.get("expected_mime_types"), + "locale": obj.get("locale"), + "media_extractor": obj.get("media_extractor"), + "media_extractor_options": MediaAsyncPayloadAllOfMediaExtractorOptions.from_dict(obj["media_extractor_options"]) if obj.get("media_extractor_options") is not None else None, + "storage": MediaAsyncPayloadAllOfStorage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "url": obj.get("url"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/media_async_payload_all_of_media_extractor_options.py b/candidate/generated/nimble_client/models/media_async_payload_all_of_media_extractor_options.py new file mode 100644 index 0000000..7523108 --- /dev/null +++ b/candidate/generated/nimble_client/models/media_async_payload_all_of_media_extractor_options.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MediaAsyncPayloadAllOfMediaExtractorOptions(BaseModel): + """ + MediaAsyncPayloadAllOfMediaExtractorOptions + """ # noqa: E501 + format: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + __properties: ClassVar[List[str]] = ["format"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MediaAsyncPayloadAllOfMediaExtractorOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MediaAsyncPayloadAllOfMediaExtractorOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "format": obj.get("format") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/media_async_payload_all_of_storage.py b/candidate/generated/nimble_client/models/media_async_payload_all_of_storage.py new file mode 100644 index 0000000..602e8da --- /dev/null +++ b/candidate/generated/nimble_client/models/media_async_payload_all_of_storage.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MediaAsyncPayloadAllOfStorage(BaseModel): + """ + MediaAsyncPayloadAllOfStorage + """ # noqa: E501 + object_name: Optional[StrictStr] = None + type: Optional[StrictStr] = 's3' + url: StrictStr + __properties: ClassVar[List[str]] = ["object_name", "type", "url"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['s3', 'gcs', 'do', 'oci']): + raise ValueError("must be one of enum values ('s3', 'gcs', 'do', 'oci')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MediaAsyncPayloadAllOfStorage from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MediaAsyncPayloadAllOfStorage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object_name": obj.get("object_name"), + "type": obj.get("type") if obj.get("type") is not None else 's3', + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/media_async_response.py b/candidate/generated/nimble_client/models/media_async_response.py new file mode 100644 index 0000000..2772aa5 --- /dev/null +++ b/candidate/generated/nimble_client/models/media_async_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from nimble_client.models.extract_async_response_task import ExtractAsyncResponseTask +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MediaAsyncResponse(BaseModel): + """ + Response when an async media download task is created successfully. + """ # noqa: E501 + status: StrictStr = Field(description="Status indicating the async task was created successfully.") + task: ExtractAsyncResponseTask + __properties: ClassVar[List[str]] = ["status", "task"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success']): + raise ValueError("must be one of enum values ('success')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MediaAsyncResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of task + if self.task: + _dict['task'] = self.task.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MediaAsyncResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "task": ExtractAsyncResponseTask.from_dict(obj["task"]) if obj.get("task") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/media_payload.py b/candidate/generated/nimble_client/models/media_payload.py new file mode 100644 index 0000000..57b4831 --- /dev/null +++ b/candidate/generated/nimble_client/models/media_payload.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.media_async_payload_all_of_storage import MediaAsyncPayloadAllOfStorage +from nimble_client.models.media_payload_media_extractor_options import MediaPayloadMediaExtractorOptions +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MediaPayload(BaseModel): + """ + MediaPayload + """ # noqa: E501 + country: Optional[StrictStr] = None + expected_mime_types: Optional[List[StrictStr]] = None + locale: Optional[StrictStr] = None + media_extractor: Optional[StrictStr] = None + media_extractor_options: Optional[MediaPayloadMediaExtractorOptions] = None + storage: Optional[MediaAsyncPayloadAllOfStorage] = None + url: StrictStr + __properties: ClassVar[List[str]] = ["country", "expected_mime_types", "locale", "media_extractor", "media_extractor_options", "storage", "url"] + + @field_validator('media_extractor') + def media_extractor_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['yt-dlp']): + raise ValueError("must be one of enum values ('yt-dlp')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MediaPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of media_extractor_options + if self.media_extractor_options: + _dict['media_extractor_options'] = self.media_extractor_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MediaPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "expected_mime_types": obj.get("expected_mime_types"), + "locale": obj.get("locale"), + "media_extractor": obj.get("media_extractor"), + "media_extractor_options": MediaPayloadMediaExtractorOptions.from_dict(obj["media_extractor_options"]) if obj.get("media_extractor_options") is not None else None, + "storage": MediaAsyncPayloadAllOfStorage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/media_payload_media_extractor_options.py b/candidate/generated/nimble_client/models/media_payload_media_extractor_options.py new file mode 100644 index 0000000..82d9020 --- /dev/null +++ b/candidate/generated/nimble_client/models/media_payload_media_extractor_options.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MediaPayloadMediaExtractorOptions(BaseModel): + """ + MediaPayloadMediaExtractorOptions + """ # noqa: E501 + format: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + __properties: ClassVar[List[str]] = ["format"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MediaPayloadMediaExtractorOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MediaPayloadMediaExtractorOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "format": obj.get("format") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/metadata.py b/candidate/generated/nimble_client/models/metadata.py new file mode 100644 index 0000000..649b27c --- /dev/null +++ b/candidate/generated/nimble_client/models/metadata.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.serp_metadata import SERPMetadata +from nimble_client.models.wsa_metadata import WSAMetadata +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +METADATA_ANY_OF_SCHEMAS = ["SERPMetadata", "WSAMetadata"] + +class Metadata(BaseModel): + """ + Metadata + """ + + # data type: SERPMetadata + anyof_schema_1_validator: Optional[SERPMetadata] = None + # data type: WSAMetadata + anyof_schema_2_validator: Optional[WSAMetadata] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[SERPMetadata, WSAMetadata]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "SERPMetadata", "WSAMetadata" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Metadata.model_construct() + error_messages = [] + # validate data type: SERPMetadata + if not isinstance(v, SERPMetadata): + error_messages.append(f"Error! Input type `{type(v)}` is not `SERPMetadata`") + else: + return v + + # validate data type: WSAMetadata + if not isinstance(v, WSAMetadata): + error_messages.append(f"Error! Input type `{type(v)}` is not `WSAMetadata`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Metadata with anyOf schemas: SERPMetadata, WSAMetadata. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[SERPMetadata] = None + try: + instance.actual_instance = SERPMetadata.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[WSAMetadata] = None + try: + instance.actual_instance = WSAMetadata.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Metadata with anyOf schemas: SERPMetadata, WSAMetadata. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], SERPMetadata, WSAMetadata]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/metadata_filter_public_v2.py b/candidate/generated/nimble_client/models/metadata_filter_public_v2.py new file mode 100644 index 0000000..9b32e10 --- /dev/null +++ b/candidate/generated/nimble_client/models/metadata_filter_public_v2.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MetadataFilterPublicV2(BaseModel): + """ + MetadataFilterPublicV2 + """ # noqa: E501 + category: Optional[StrictStr] = Field(default=None, description="Category metadata value to match.") + data_source: Optional[StrictStr] = Field(default=None, description="Data source metadata value to match.") + description: Optional[StrictStr] = Field(default=None, description="Description metadata value to match.") + display_name: Optional[StrictStr] = Field(default=None, description="Display name metadata value to match.") + domain: Optional[StrictStr] = Field(default=None, description="Domain metadata value to match.") + entity_type: Optional[StrictStr] = Field(default=None, description="Entity type metadata value to match.") + vertical: Optional[StrictStr] = Field(default=None, description="Vertical metadata value to match.") + __properties: ClassVar[List[str]] = ["category", "data_source", "description", "display_name", "domain", "entity_type", "vertical"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MetadataFilterPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if category (nullable) is None + # and model_fields_set contains the field + if self.category is None and "category" in self.model_fields_set: + _dict['category'] = None + + # set to None if data_source (nullable) is None + # and model_fields_set contains the field + if self.data_source is None and "data_source" in self.model_fields_set: + _dict['data_source'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if domain (nullable) is None + # and model_fields_set contains the field + if self.domain is None and "domain" in self.model_fields_set: + _dict['domain'] = None + + # set to None if entity_type (nullable) is None + # and model_fields_set contains the field + if self.entity_type is None and "entity_type" in self.model_fields_set: + _dict['entity_type'] = None + + # set to None if vertical (nullable) is None + # and model_fields_set contains the field + if self.vertical is None and "vertical" in self.model_fields_set: + _dict['vertical'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetadataFilterPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category"), + "data_source": obj.get("data_source"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "domain": obj.get("domain"), + "entity_type": obj.get("entity_type"), + "vertical": obj.get("vertical") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/output.py b/candidate/generated/nimble_client/models/output.py new file mode 100644 index 0000000..8f4ac1c --- /dev/null +++ b/candidate/generated/nimble_client/models/output.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.gateway_def21e0e16cb4d7d291_task_run_text_output import GatewayDef21e0e16cb4d7d291TaskRunTextOutput +from nimble_client.models.gateway_def_dc279d13fafb2038_task_run_json_output import GatewayDefDc279d13fafb2038TaskRunJsonOutput +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +OUTPUT_ANY_OF_SCHEMAS = ["GatewayDef21e0e16cb4d7d291TaskRunTextOutput", "GatewayDefDc279d13fafb2038TaskRunJsonOutput"] + +class Output(BaseModel): + """ + Output + """ + + # data type: GatewayDef21e0e16cb4d7d291TaskRunTextOutput + anyof_schema_1_validator: Optional[GatewayDef21e0e16cb4d7d291TaskRunTextOutput] = None + # data type: GatewayDefDc279d13fafb2038TaskRunJsonOutput + anyof_schema_2_validator: Optional[GatewayDefDc279d13fafb2038TaskRunJsonOutput] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[GatewayDef21e0e16cb4d7d291TaskRunTextOutput, GatewayDefDc279d13fafb2038TaskRunJsonOutput]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "GatewayDef21e0e16cb4d7d291TaskRunTextOutput", "GatewayDefDc279d13fafb2038TaskRunJsonOutput" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = Output.model_construct() + error_messages = [] + # validate data type: GatewayDef21e0e16cb4d7d291TaskRunTextOutput + if not isinstance(v, GatewayDef21e0e16cb4d7d291TaskRunTextOutput): + error_messages.append(f"Error! Input type `{type(v)}` is not `GatewayDef21e0e16cb4d7d291TaskRunTextOutput`") + else: + return v + + # validate data type: GatewayDefDc279d13fafb2038TaskRunJsonOutput + if not isinstance(v, GatewayDefDc279d13fafb2038TaskRunJsonOutput): + error_messages.append(f"Error! Input type `{type(v)}` is not `GatewayDefDc279d13fafb2038TaskRunJsonOutput`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Output with anyOf schemas: GatewayDef21e0e16cb4d7d291TaskRunTextOutput, GatewayDefDc279d13fafb2038TaskRunJsonOutput. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # anyof_schema_1_validator: Optional[GatewayDef21e0e16cb4d7d291TaskRunTextOutput] = None + try: + instance.actual_instance = GatewayDef21e0e16cb4d7d291TaskRunTextOutput.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[GatewayDefDc279d13fafb2038TaskRunJsonOutput] = None + try: + instance.actual_instance = GatewayDefDc279d13fafb2038TaskRunJsonOutput.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Output with anyOf schemas: GatewayDef21e0e16cb4d7d291TaskRunTextOutput, GatewayDefDc279d13fafb2038TaskRunJsonOutput. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], GatewayDef21e0e16cb4d7d291TaskRunTextOutput, GatewayDefDc279d13fafb2038TaskRunJsonOutput]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/output1.py b/candidate/generated/nimble_client/models/output1.py new file mode 100644 index 0000000..95fa3e5 --- /dev/null +++ b/candidate/generated/nimble_client/models/output1.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.gateway_def2e37feaa5480a045_task_run_json_output import GatewayDef2e37feaa5480a045TaskRunJsonOutput +from nimble_client.models.gateway_def_bc5dc0ea1fc57012_task_run_text_output import GatewayDefBc5dc0ea1fc57012TaskRunTextOutput +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +OUTPUT1_ANY_OF_SCHEMAS = ["GatewayDef2e37feaa5480a045TaskRunJsonOutput", "GatewayDefBc5dc0ea1fc57012TaskRunTextOutput"] + +class Output1(BaseModel): + """ + Output1 + """ + + # data type: GatewayDefBc5dc0ea1fc57012TaskRunTextOutput + anyof_schema_1_validator: Optional[GatewayDefBc5dc0ea1fc57012TaskRunTextOutput] = None + # data type: GatewayDef2e37feaa5480a045TaskRunJsonOutput + anyof_schema_2_validator: Optional[GatewayDef2e37feaa5480a045TaskRunJsonOutput] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[GatewayDef2e37feaa5480a045TaskRunJsonOutput, GatewayDefBc5dc0ea1fc57012TaskRunTextOutput]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "GatewayDef2e37feaa5480a045TaskRunJsonOutput", "GatewayDefBc5dc0ea1fc57012TaskRunTextOutput" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = Output1.model_construct() + error_messages = [] + # validate data type: GatewayDefBc5dc0ea1fc57012TaskRunTextOutput + if not isinstance(v, GatewayDefBc5dc0ea1fc57012TaskRunTextOutput): + error_messages.append(f"Error! Input type `{type(v)}` is not `GatewayDefBc5dc0ea1fc57012TaskRunTextOutput`") + else: + return v + + # validate data type: GatewayDef2e37feaa5480a045TaskRunJsonOutput + if not isinstance(v, GatewayDef2e37feaa5480a045TaskRunJsonOutput): + error_messages.append(f"Error! Input type `{type(v)}` is not `GatewayDef2e37feaa5480a045TaskRunJsonOutput`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Output1 with anyOf schemas: GatewayDef2e37feaa5480a045TaskRunJsonOutput, GatewayDefBc5dc0ea1fc57012TaskRunTextOutput. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # anyof_schema_1_validator: Optional[GatewayDefBc5dc0ea1fc57012TaskRunTextOutput] = None + try: + instance.actual_instance = GatewayDefBc5dc0ea1fc57012TaskRunTextOutput.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[GatewayDef2e37feaa5480a045TaskRunJsonOutput] = None + try: + instance.actual_instance = GatewayDef2e37feaa5480a045TaskRunJsonOutput.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Output1 with anyOf schemas: GatewayDef2e37feaa5480a045TaskRunJsonOutput, GatewayDefBc5dc0ea1fc57012TaskRunTextOutput. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], GatewayDef2e37feaa5480a045TaskRunJsonOutput, GatewayDefBc5dc0ea1fc57012TaskRunTextOutput]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/output2.py b/candidate/generated/nimble_client/models/output2.py new file mode 100644 index 0000000..91c7a85 --- /dev/null +++ b/candidate/generated/nimble_client/models/output2.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.task_run_json_output_public_v1 import TaskRunJsonOutputPublicV1 +from nimble_client.models.task_run_text_output_public_v1 import TaskRunTextOutputPublicV1 +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +OUTPUT2_ANY_OF_SCHEMAS = ["TaskRunJsonOutputPublicV1", "TaskRunTextOutputPublicV1"] + +class Output2(BaseModel): + """ + Output from the completed task. + """ + + # data type: TaskRunTextOutputPublicV1 + anyof_schema_1_validator: Optional[TaskRunTextOutputPublicV1] = None + # data type: TaskRunJsonOutputPublicV1 + anyof_schema_2_validator: Optional[TaskRunJsonOutputPublicV1] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[TaskRunJsonOutputPublicV1, TaskRunTextOutputPublicV1]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "TaskRunJsonOutputPublicV1", "TaskRunTextOutputPublicV1" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Output2.model_construct() + error_messages = [] + # validate data type: TaskRunTextOutputPublicV1 + if not isinstance(v, TaskRunTextOutputPublicV1): + error_messages.append(f"Error! Input type `{type(v)}` is not `TaskRunTextOutputPublicV1`") + else: + return v + + # validate data type: TaskRunJsonOutputPublicV1 + if not isinstance(v, TaskRunJsonOutputPublicV1): + error_messages.append(f"Error! Input type `{type(v)}` is not `TaskRunJsonOutputPublicV1`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Output2 with anyOf schemas: TaskRunJsonOutputPublicV1, TaskRunTextOutputPublicV1. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[TaskRunTextOutputPublicV1] = None + try: + instance.actual_instance = TaskRunTextOutputPublicV1.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[TaskRunJsonOutputPublicV1] = None + try: + instance.actual_instance = TaskRunJsonOutputPublicV1.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Output2 with anyOf schemas: TaskRunJsonOutputPublicV1, TaskRunTextOutputPublicV1. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], TaskRunJsonOutputPublicV1, TaskRunTextOutputPublicV1]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/output3.py b/candidate/generated/nimble_client/models/output3.py new file mode 100644 index 0000000..a04b73a --- /dev/null +++ b/candidate/generated/nimble_client/models/output3.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.task_run_json_output_public_v2 import TaskRunJsonOutputPublicV2 +from nimble_client.models.task_run_text_output_public_v2 import TaskRunTextOutputPublicV2 +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +OUTPUT3_ANY_OF_SCHEMAS = ["TaskRunJsonOutputPublicV2", "TaskRunTextOutputPublicV2"] + +class Output3(BaseModel): + """ + Output from the completed task. + """ + + # data type: TaskRunTextOutputPublicV2 + anyof_schema_1_validator: Optional[TaskRunTextOutputPublicV2] = None + # data type: TaskRunJsonOutputPublicV2 + anyof_schema_2_validator: Optional[TaskRunJsonOutputPublicV2] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[TaskRunJsonOutputPublicV2, TaskRunTextOutputPublicV2]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "TaskRunJsonOutputPublicV2", "TaskRunTextOutputPublicV2" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Output3.model_construct() + error_messages = [] + # validate data type: TaskRunTextOutputPublicV2 + if not isinstance(v, TaskRunTextOutputPublicV2): + error_messages.append(f"Error! Input type `{type(v)}` is not `TaskRunTextOutputPublicV2`") + else: + return v + + # validate data type: TaskRunJsonOutputPublicV2 + if not isinstance(v, TaskRunJsonOutputPublicV2): + error_messages.append(f"Error! Input type `{type(v)}` is not `TaskRunJsonOutputPublicV2`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Output3 with anyOf schemas: TaskRunJsonOutputPublicV2, TaskRunTextOutputPublicV2. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[TaskRunTextOutputPublicV2] = None + try: + instance.actual_instance = TaskRunTextOutputPublicV2.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[TaskRunJsonOutputPublicV2] = None + try: + instance.actual_instance = TaskRunJsonOutputPublicV2.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Output3 with anyOf schemas: TaskRunJsonOutputPublicV2, TaskRunTextOutputPublicV2. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], TaskRunJsonOutputPublicV2, TaskRunTextOutputPublicV2]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/parsing_error_result.py b/candidate/generated/nimble_client/models/parsing_error_result.py new file mode 100644 index 0000000..796f6d1 --- /dev/null +++ b/candidate/generated/nimble_client/models/parsing_error_result.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ParsingErrorResult(BaseModel): + """ + ParsingErrorResult + """ # noqa: E501 + error: StrictStr + status: StrictStr + __properties: ClassVar[List[str]] = ["error", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['error']): + raise ValueError("must be one of enum values ('error')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParsingErrorResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParsingErrorResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/parsing_success_result.py b/candidate/generated/nimble_client/models/parsing_success_result.py new file mode 100644 index 0000000..fabad35 --- /dev/null +++ b/candidate/generated/nimble_client/models/parsing_success_result.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ParsingSuccessResult(BaseModel): + """ + ParsingSuccessResult + """ # noqa: E501 + entities: Dict[str, Any] + status: StrictStr + __properties: ClassVar[List[str]] = ["entities", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success']): + raise ValueError("must be one of enum values ('success')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParsingSuccessResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParsingSuccessResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "entities": obj.get("entities"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/parsing_type.py b/candidate/generated/nimble_client/models/parsing_type.py new file mode 100644 index 0000000..92eecf6 --- /dev/null +++ b/candidate/generated/nimble_client/models/parsing_type.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ParsingType(str, Enum): + """ + Enum representing the parsing types supported by Nimble + """ + + """ + allowed enum values + """ + PLAIN_TEXT = 'plain_text' + MARKDOWN = 'markdown' + SIMPLIFIED_HTML = 'simplified_html' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ParsingType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/press_action.py b/candidate/generated/nimble_client/models/press_action.py new file mode 100644 index 0000000..484330b --- /dev/null +++ b/candidate/generated/nimble_client/models/press_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.press_action_press import PressActionPress +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PressAction(BaseModel): + """ + Press a keyboard key + """ # noqa: E501 + press: PressActionPress + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["press"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PressAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of press + if self.press: + _dict['press'] = self.press.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PressAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "press": PressActionPress.from_dict(obj["press"]) if obj.get("press") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/press_action_press.py b/candidate/generated/nimble_client/models/press_action_press.py new file mode 100644 index 0000000..6e84937 --- /dev/null +++ b/candidate/generated/nimble_client/models/press_action_press.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.press_action_press_one_of import PressActionPressOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +PRESSACTIONPRESS_ONE_OF_SCHEMAS = ["PressActionPressOneOf", "str"] + +class PressActionPress(BaseModel): + """ + PressActionPress + """ + # data type: str + oneof_schema_1_validator: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + # data type: PressActionPressOneOf + oneof_schema_2_validator: Optional[PressActionPressOneOf] = None + actual_instance: Optional[Union[PressActionPressOneOf, str]] = None + one_of_schemas: Set[str] = { "PressActionPressOneOf", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = PressActionPress.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: PressActionPressOneOf + if not isinstance(v, PressActionPressOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `PressActionPressOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in PressActionPress with oneOf schemas: PressActionPressOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in PressActionPress with oneOf schemas: PressActionPressOneOf, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into str + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into PressActionPressOneOf + try: + instance.actual_instance = PressActionPressOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into PressActionPress with oneOf schemas: PressActionPressOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into PressActionPress with oneOf schemas: PressActionPressOneOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], PressActionPressOneOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/press_action_press_one_of.py b/candidate/generated/nimble_client/models/press_action_press_one_of.py new file mode 100644 index 0000000..2353760 --- /dev/null +++ b/candidate/generated/nimble_client/models/press_action_press_one_of.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.duration import Duration +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PressActionPressOneOf(BaseModel): + """ + PressActionPressOneOf + """ # noqa: E501 + delay: Optional[Duration] = None + key: Optional[StrictStr] = Field(description="Cursor for pagination.") + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + __properties: ClassVar[List[str]] = ["delay", "key", "required", "skip"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PressActionPressOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of delay + if self.delay: + _dict['delay'] = self.delay.to_dict() + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + # set to None if key (nullable) is None + # and model_fields_set contains the field + if self.key is None and "key" in self.model_fields_set: + _dict['key'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PressActionPressOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "delay": Duration.from_dict(obj["delay"]) if obj.get("delay") is not None else None, + "key": obj.get("key"), + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/privacy_filter_public_v1.py b/candidate/generated/nimble_client/models/privacy_filter_public_v1.py new file mode 100644 index 0000000..8503b0a --- /dev/null +++ b/candidate/generated/nimble_client/models/privacy_filter_public_v1.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class PrivacyFilterPublicV1(str, Enum): + """ + PrivacyFilterPublicV1 + """ + + """ + allowed enum values + """ + PUBLIC = 'public' + PRIVATE = 'private' + ALL = 'all' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of PrivacyFilterPublicV1 from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/privacy_filter_public_v2.py b/candidate/generated/nimble_client/models/privacy_filter_public_v2.py new file mode 100644 index 0000000..60fff71 --- /dev/null +++ b/candidate/generated/nimble_client/models/privacy_filter_public_v2.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class PrivacyFilterPublicV2(str, Enum): + """ + PrivacyFilterPublicV2 + """ + + """ + allowed enum values + """ + PUBLIC = 'public' + PRIVATE = 'private' + ALL = 'all' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of PrivacyFilterPublicV2 from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/privacy_level_public_v2.py b/candidate/generated/nimble_client/models/privacy_level_public_v2.py new file mode 100644 index 0000000..eb61d7b --- /dev/null +++ b/candidate/generated/nimble_client/models/privacy_level_public_v2.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class PrivacyLevelPublicV2(str, Enum): + """ + PrivacyLevelPublicV2 + """ + + """ + allowed enum values + """ + PUBLIC = 'public' + PRIVATE = 'private' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of PrivacyLevelPublicV2 from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/request.py b/candidate/generated/nimble_client/models/request.py new file mode 100644 index 0000000..b81ab66 --- /dev/null +++ b/candidate/generated/nimble_client/models/request.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.create_extract_template_generation_request_public_v2 import CreateExtractTemplateGenerationRequestPublicV2 +from nimble_client.models.create_extract_template_refinement_request_public_v2 import CreateExtractTemplateRefinementRequestPublicV2 +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +REQUEST_ANY_OF_SCHEMAS = ["CreateExtractTemplateGenerationRequestPublicV2", "CreateExtractTemplateRefinementRequestPublicV2"] + +class Request(BaseModel): + """ + Request + """ + + # data type: CreateExtractTemplateGenerationRequestPublicV2 + anyof_schema_1_validator: Optional[CreateExtractTemplateGenerationRequestPublicV2] = None + # data type: CreateExtractTemplateRefinementRequestPublicV2 + anyof_schema_2_validator: Optional[CreateExtractTemplateRefinementRequestPublicV2] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[CreateExtractTemplateGenerationRequestPublicV2, CreateExtractTemplateRefinementRequestPublicV2]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "CreateExtractTemplateGenerationRequestPublicV2", "CreateExtractTemplateRefinementRequestPublicV2" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = Request.model_construct() + error_messages = [] + # validate data type: CreateExtractTemplateGenerationRequestPublicV2 + if not isinstance(v, CreateExtractTemplateGenerationRequestPublicV2): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateExtractTemplateGenerationRequestPublicV2`") + else: + return v + + # validate data type: CreateExtractTemplateRefinementRequestPublicV2 + if not isinstance(v, CreateExtractTemplateRefinementRequestPublicV2): + error_messages.append(f"Error! Input type `{type(v)}` is not `CreateExtractTemplateRefinementRequestPublicV2`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Request with anyOf schemas: CreateExtractTemplateGenerationRequestPublicV2, CreateExtractTemplateRefinementRequestPublicV2. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[CreateExtractTemplateGenerationRequestPublicV2] = None + try: + instance.actual_instance = CreateExtractTemplateGenerationRequestPublicV2.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[CreateExtractTemplateRefinementRequestPublicV2] = None + try: + instance.actual_instance = CreateExtractTemplateRefinementRequestPublicV2.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Request with anyOf schemas: CreateExtractTemplateGenerationRequestPublicV2, CreateExtractTemplateRefinementRequestPublicV2. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], CreateExtractTemplateGenerationRequestPublicV2, CreateExtractTemplateRefinementRequestPublicV2]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/response_get_run_result_public_v2_api_v2_public_web_search_agents_agent_id_runs_run_id_result_get.py b/candidate/generated/nimble_client/models/response_get_run_result_public_v2_api_v2_public_web_search_agents_agent_id_runs_run_id_result_get.py new file mode 100644 index 0000000..3c03640 --- /dev/null +++ b/candidate/generated/nimble_client/models/response_get_run_result_public_v2_api_v2_public_web_search_agents_agent_id_runs_run_id_result_get.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from nimble_client.models.task_run_failed_result_public_v2 import TaskRunFailedResultPublicV2 +from nimble_client.models.task_run_result_public_v2 import TaskRunResultPublicV2 +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +RESPONSEGETRUNRESULTPUBLICV2APIV2PUBLICWEBSEARCHAGENTSAGENTIDRUNSRUNIDRESULTGET_ANY_OF_SCHEMAS = ["TaskRunFailedResultPublicV2", "TaskRunResultPublicV2"] + +class ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet(BaseModel): + """ + ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet + """ + + # data type: TaskRunResultPublicV2 + anyof_schema_1_validator: Optional[TaskRunResultPublicV2] = None + # data type: TaskRunFailedResultPublicV2 + anyof_schema_2_validator: Optional[TaskRunFailedResultPublicV2] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[TaskRunFailedResultPublicV2, TaskRunResultPublicV2]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "TaskRunFailedResultPublicV2", "TaskRunResultPublicV2" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet.model_construct() + error_messages = [] + # validate data type: TaskRunResultPublicV2 + if not isinstance(v, TaskRunResultPublicV2): + error_messages.append(f"Error! Input type `{type(v)}` is not `TaskRunResultPublicV2`") + else: + return v + + # validate data type: TaskRunFailedResultPublicV2 + if not isinstance(v, TaskRunFailedResultPublicV2): + error_messages.append(f"Error! Input type `{type(v)}` is not `TaskRunFailedResultPublicV2`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet with anyOf schemas: TaskRunFailedResultPublicV2, TaskRunResultPublicV2. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[TaskRunResultPublicV2] = None + try: + instance.actual_instance = TaskRunResultPublicV2.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[TaskRunFailedResultPublicV2] = None + try: + instance.actual_instance = TaskRunFailedResultPublicV2.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into ResponseGetRunResultPublicV2ApiV2PublicWebSearchAgentsAgentIdRunsRunIdResultGet with anyOf schemas: TaskRunFailedResultPublicV2, TaskRunResultPublicV2. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], TaskRunFailedResultPublicV2, TaskRunResultPublicV2]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/result_model.py b/candidate/generated/nimble_client/models/result_model.py new file mode 100644 index 0000000..14c163a --- /dev/null +++ b/candidate/generated/nimble_client/models/result_model.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.company_entity import CompanyEntity +from nimble_client.models.metadata import Metadata +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ResultModel(BaseModel): + """ + Unified result model for all search types (SERP and WSA). This model provides a consistent structure for search results, with platform-specific data in additional_data and typed metadata. + """ # noqa: E501 + additional_data: Optional[Dict[str, Any]] = Field(default=None, description="Platform-specific fields (e.g., price, rating, publish_date). Omitted from response when no extra data.") + chunks: Optional[List[StrictStr]] = Field(default=None, description="Page content chunks most relevant to the query, most relevant first. Present only when cached-chunk enrichment is enabled for the account, and never for search_depth=deep; omitted otherwise. Only the leading results are enriched, and a result whose page could not be fetched in time keeps its snippet with no chunks, so this may be absent on some results of an otherwise enriched response.") + content: StrictStr + description: StrictStr + entities: Optional[List[CompanyEntity]] = Field(default=None, description="Structured data about what the result is about, such as the company with focus='company'. Omitted when there is none.") + metadata: Metadata + title: StrictStr + url: StrictStr + __properties: ClassVar[List[str]] = ["additional_data", "chunks", "content", "description", "entities", "metadata", "title", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResultModel from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in entities (list) + _items = [] + if self.entities: + for _item_entities in self.entities: + _items.append(_item_entities.to_dict() if _item_entities is not None else None) + _dict['entities'] = _items + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # set to None if additional_data (nullable) is None + # and model_fields_set contains the field + if self.additional_data is None and "additional_data" in self.model_fields_set: + _dict['additional_data'] = None + + # set to None if chunks (nullable) is None + # and model_fields_set contains the field + if self.chunks is None and "chunks" in self.model_fields_set: + _dict['chunks'] = None + + # set to None if entities (nullable) is None + # and model_fields_set contains the field + if self.entities is None and "entities" in self.model_fields_set: + _dict['entities'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResultModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "additional_data": obj.get("additional_data"), + "chunks": obj.get("chunks"), + "content": obj.get("content"), + "description": obj.get("description"), + "entities": [CompanyEntity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "title": obj.get("title"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/revenue_annual.py b/candidate/generated/nimble_client/models/revenue_annual.py new file mode 100644 index 0000000..9baeb04 --- /dev/null +++ b/candidate/generated/nimble_client/models/revenue_annual.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +REVENUEANNUAL_ANY_OF_SCHEMAS = ["float", "int"] + +class RevenueAnnual(BaseModel): + """ + USD + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: float + anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, int]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "float", "int" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = RevenueAnnual.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in RevenueAnnual with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into RevenueAnnual with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response.py b/candidate/generated/nimble_client/models/run_extract_template200_response.py new file mode 100644 index 0000000..c0805a4 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from nimble_client.models.run_extract_template200_response_data import RunExtractTemplate200ResponseData +from nimble_client.models.run_extract_template200_response_debug import RunExtractTemplate200ResponseDebug +from nimble_client.models.run_extract_template200_response_metadata import RunExtractTemplate200ResponseMetadata +from nimble_client.models.run_extract_template200_response_pagination import RunExtractTemplate200ResponsePagination +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200Response(BaseModel): + """ + RunExtractTemplate200Response + """ # noqa: E501 + data: RunExtractTemplate200ResponseData + debug: Optional[RunExtractTemplate200ResponseDebug] = None + metadata: RunExtractTemplate200ResponseMetadata + pagination: Optional[RunExtractTemplate200ResponsePagination] = None + status: StrictStr = Field(description="The status of the task.") + status_code: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The HTTP status code of the task.") + task_id: StrictStr = Field(description="Unique identifier for the task.") + url: StrictStr = Field(description="The final URL.") + warnings: Optional[List[StrictStr]] = Field(default=None, description="List of warnings generated during the task.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data", "debug", "metadata", "pagination", "status", "status_code", "task_id", "url", "warnings"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'skipped', 'fatal', 'error', 'postponed', 'ignored', 'rejected', 'blocked']): + raise ValueError("must be one of enum values ('success', 'skipped', 'fatal', 'error', 'postponed', 'ignored', 'rejected', 'blocked')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # override the default output from pydantic by calling `to_dict()` of debug + if self.debug: + _dict['debug'] = self.debug.to_dict() + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": RunExtractTemplate200ResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None, + "debug": RunExtractTemplate200ResponseDebug.from_dict(obj["debug"]) if obj.get("debug") is not None else None, + "metadata": RunExtractTemplate200ResponseMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "pagination": RunExtractTemplate200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "status": obj.get("status"), + "status_code": obj.get("status_code"), + "task_id": obj.get("task_id"), + "url": obj.get("url"), + "warnings": obj.get("warnings") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data.py new file mode 100644 index 0000000..351cd3a --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.extract200_response_data_parsing import Extract200ResponseDataParsing +from nimble_client.models.run_extract_template200_response_data_browser_actions import RunExtractTemplate200ResponseDataBrowserActions +from nimble_client.models.run_extract_template200_response_data_network_capture_inner import RunExtractTemplate200ResponseDataNetworkCaptureInner +from nimble_client.models.run_extract_template200_response_data_redirects_inner import RunExtractTemplate200ResponseDataRedirectsInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseData(BaseModel): + """ + RunExtractTemplate200ResponseData + """ # noqa: E501 + browser_actions: Optional[RunExtractTemplate200ResponseDataBrowserActions] = None + cookies: Optional[List[Any]] = Field(default=None, description="The cookies collected from browser actions during the task.") + eval: Optional[List[Any]] = Field(default=None, description="The evaluation results from browser actions during the task.") + fetch: Optional[List[Any]] = Field(default=None, description="The http requests from browser actions made during the task.") + headers: Optional[Dict[str, StrictStr]] = Field(default=None, description="The headers received during the task.") + html: Optional[StrictStr] = Field(default=None, description="The HTML content of the page.") + links: Optional[List[StrictStr]] = Field(default=None, description="List of all unique URLs found on the page.") + markdown: Optional[StrictStr] = Field(default=None, description="The Markdown version of the HTML content.") + network_capture: Optional[List[RunExtractTemplate200ResponseDataNetworkCaptureInner]] = Field(default=None, description="The network capture data collected during the task.") + pages_html: Optional[List[StrictStr]] = Field(default=None, description="Individual HTML content of each pagination page, before merging.") + parsing: Optional[Extract200ResponseDataParsing] = None + redirects: Optional[List[RunExtractTemplate200ResponseDataRedirectsInner]] = Field(default=None, description="The list of redirects that occurred during the task.") + screenshots: Optional[List[Any]] = Field(default=None, description="Screenshots taken during the task, from browser actions, or the screenshot format.") + __properties: ClassVar[List[str]] = ["browser_actions", "cookies", "eval", "fetch", "headers", "html", "links", "markdown", "network_capture", "pages_html", "parsing", "redirects", "screenshots"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "network_capture", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser_actions + if self.browser_actions: + _dict['browser_actions'] = self.browser_actions.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in network_capture (list) + _items = [] + if self.network_capture: + for _item_network_capture in self.network_capture: + _items.append(_item_network_capture.to_dict() if _item_network_capture is not None else None) + _dict['network_capture'] = _items + # override the default output from pydantic by calling `to_dict()` of parsing + if self.parsing: + _dict['parsing'] = self.parsing.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in redirects (list) + _items = [] + if self.redirects: + for _item_redirects in self.redirects: + _items.append(_item_redirects.to_dict() if _item_redirects is not None else None) + _dict['redirects'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "browser_actions": RunExtractTemplate200ResponseDataBrowserActions.from_dict(obj["browser_actions"]) if obj.get("browser_actions") is not None else None, + "cookies": obj.get("cookies"), + "eval": obj.get("eval"), + "fetch": obj.get("fetch"), + "headers": obj.get("headers"), + "html": obj.get("html"), + "links": obj.get("links"), + "markdown": obj.get("markdown"), + "network_capture": [RunExtractTemplate200ResponseDataNetworkCaptureInner.from_dict(_item) for _item in obj["network_capture"]] if obj.get("network_capture") is not None else None, + "pages_html": obj.get("pages_html"), + "parsing": Extract200ResponseDataParsing.from_dict(obj["parsing"]) if obj.get("parsing") is not None else None, + "redirects": [RunExtractTemplate200ResponseDataRedirectsInner.from_dict(_item) for _item in obj["redirects"]] if obj.get("redirects") is not None else None, + "screenshots": obj.get("screenshots") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data_browser_actions.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data_browser_actions.py new file mode 100644 index 0000000..2da7003 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data_browser_actions.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from nimble_client.models.run_extract_template200_response_data_browser_actions_results_inner import RunExtractTemplate200ResponseDataBrowserActionsResultsInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDataBrowserActions(BaseModel): + """ + Browser actions execution results. Present only when browser_actions were specified in the request. + """ # noqa: E501 + results: List[RunExtractTemplate200ResponseDataBrowserActionsResultsInner] + success: StrictBool + total_duration: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] + __properties: ClassVar[List[str]] = ["results", "success", "total_duration"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataBrowserActions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "results", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + _items.append(_item_results.to_dict() if _item_results is not None else None) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataBrowserActions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [RunExtractTemplate200ResponseDataBrowserActionsResultsInner.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "success": obj.get("success"), + "total_duration": obj.get("total_duration") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data_browser_actions_results_inner.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data_browser_actions_results_inner.py new file mode 100644 index 0000000..6c8efb7 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data_browser_actions_results_inner.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDataBrowserActionsResultsInner(BaseModel): + """ + RunExtractTemplate200ResponseDataBrowserActionsResultsInner + """ # noqa: E501 + duration: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] + error: Optional[StrictStr] = None + name: StrictStr + result: Optional[Any] = None + status: StrictStr + __properties: ClassVar[List[str]] = ["duration", "error", "name", "result", "status"] + + @field_validator('name') + def name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['goto', 'wait', 'wait_for_element', 'wait_for_navigation', 'click', 'fill', 'press', 'scroll', 'auto_scroll', 'screenshot', 'get_cookies', 'eval', 'fetch']): + raise ValueError("must be one of enum values ('goto', 'wait', 'wait_for_element', 'wait_for_navigation', 'click', 'fill', 'press', 'scroll', 'auto_scroll', 'screenshot', 'get_cookies', 'eval', 'fetch')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['no-run', 'in-progress', 'done', 'error', 'skipped']): + raise ValueError("must be one of enum values ('no-run', 'in-progress', 'done', 'error', 'skipped')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataBrowserActionsResultsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if result (nullable) is None + # and model_fields_set contains the field + if self.result is None and "result" in self.model_fields_set: + _dict['result'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataBrowserActionsResultsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "duration": obj.get("duration"), + "error": obj.get("error"), + "name": obj.get("name"), + "result": obj.get("result"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner.py new file mode 100644 index 0000000..4312008 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_filter import RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_results_inner import RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDataNetworkCaptureInner(BaseModel): + """ + RunExtractTemplate200ResponseDataNetworkCaptureInner + """ # noqa: E501 + error_message: Optional[StrictStr] = Field(default=None, alias="errorMessage") + filter: RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter + results: List[RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner] + __properties: ClassVar[List[str]] = ["errorMessage", "filter", "results"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of filter + if self.filter: + _dict['filter'] = self.filter.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + _items.append(_item_results.to_dict() if _item_results is not None else None) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "errorMessage": obj.get("errorMessage"), + "filter": RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None, + "results": [RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter.py new file mode 100644 index 0000000..bbe6f7a --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.extract200_response_data_network_capture_inner_filter_resource_type import Extract200ResponseDataNetworkCaptureInnerFilterResourceType +from nimble_client.models.extract200_response_data_network_capture_inner_filter_status_code import Extract200ResponseDataNetworkCaptureInnerFilterStatusCode +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_filter_url import RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter(BaseModel): + """ + RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter + """ # noqa: E501 + method: Optional[StrictStr] = None + resource_type: Optional[Extract200ResponseDataNetworkCaptureInnerFilterResourceType] = None + status_code: Optional[Extract200ResponseDataNetworkCaptureInnerFilterStatusCode] = None + url: Optional[RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl] = None + validation: StrictBool + wait_for_requests_count: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] + wait_for_requests_count_timeout: Optional[Union[Annotated[float, Field(le=300000, strict=True, gt=0)], Annotated[int, Field(le=300000, strict=True, gt=0)]]] = None + __properties: ClassVar[List[str]] = ["method", "resource_type", "status_code", "url", "validation", "wait_for_requests_count", "wait_for_requests_count_timeout"] + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH']): + raise ValueError("must be one of enum values ('GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of resource_type + if self.resource_type: + _dict['resource_type'] = self.resource_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of status_code + if self.status_code: + _dict['status_code'] = self.status_code.to_dict() + # override the default output from pydantic by calling `to_dict()` of url + if self.url: + _dict['url'] = self.url.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "method": obj.get("method"), + "resource_type": Extract200ResponseDataNetworkCaptureInnerFilterResourceType.from_dict(obj["resource_type"]) if obj.get("resource_type") is not None else None, + "status_code": Extract200ResponseDataNetworkCaptureInnerFilterStatusCode.from_dict(obj["status_code"]) if obj.get("status_code") is not None else None, + "url": RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl.from_dict(obj["url"]) if obj.get("url") is not None else None, + "validation": obj.get("validation") if obj.get("validation") is not None else False, + "wait_for_requests_count": obj.get("wait_for_requests_count") if obj.get("wait_for_requests_count") is not None else 0, + "wait_for_requests_count_timeout": obj.get("wait_for_requests_count_timeout") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter_url.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter_url.py new file mode 100644 index 0000000..67f61ab --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_filter_url.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl(BaseModel): + """ + RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl + """ # noqa: E501 + type: StrictStr + value: StrictStr + __properties: ClassVar[List[str]] = ["type", "value"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['exact', 'contains']): + raise ValueError("must be one of enum values ('exact', 'contains')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerFilterUrl from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") if obj.get("type") is not None else 'exact', + "value": obj.get("value") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner.py new file mode 100644 index 0000000..e183ba3 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_results_inner_request import RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest +from nimble_client.models.run_extract_template200_response_data_network_capture_inner_results_inner_response import RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner(BaseModel): + """ + RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner + """ # noqa: E501 + request: RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest + response: RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse + __properties: ClassVar[List[str]] = ["request", "response"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of request + if self.request: + _dict['request'] = self.request.to_dict() + # override the default output from pydantic by calling `to_dict()` of response + if self.response: + _dict['response'] = self.response.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "request": RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest.from_dict(obj["request"]) if obj.get("request") is not None else None, + "response": RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse.from_dict(obj["response"]) if obj.get("response") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_request.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_request.py new file mode 100644 index 0000000..d914bae --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_request.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest(BaseModel): + """ + RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest + """ # noqa: E501 + body: Optional[StrictStr] = None + headers: Dict[str, StrictStr] + method: StrictStr + resource_type: StrictStr = Field(description="Resource type for network capture filtering") + url: StrictStr + __properties: ClassVar[List[str]] = ["body", "headers", "method", "resource_type", "url"] + + @field_validator('resource_type') + def resource_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['document', 'stylesheet', 'image', 'media', 'font', 'script', 'texttrack', 'xhr', 'fetch', 'prefetch', 'eventsource', 'websocket', 'manifest', 'signedexchange', 'ping', 'cspviolationreport', 'preflight', 'other', 'fedcm']): + raise ValueError("must be one of enum values ('document', 'stylesheet', 'image', 'media', 'font', 'script', 'texttrack', 'xhr', 'fetch', 'prefetch', 'eventsource', 'websocket', 'manifest', 'signedexchange', 'ping', 'cspviolationreport', 'preflight', 'other', 'fedcm')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "body": obj.get("body"), + "headers": obj.get("headers"), + "method": obj.get("method"), + "resource_type": obj.get("resource_type"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_response.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_response.py new file mode 100644 index 0000000..0ae7a24 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data_network_capture_inner_results_inner_response.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse(BaseModel): + """ + RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse + """ # noqa: E501 + body: StrictStr + headers: Dict[str, StrictStr] + serialization: StrictStr + status: Union[StrictFloat, StrictInt] + status_text: StrictStr + __properties: ClassVar[List[str]] = ["body", "headers", "serialization", "status", "status_text"] + + @field_validator('serialization') + def serialization_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['none', 'base64']): + raise ValueError("must be one of enum values ('none', 'base64')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataNetworkCaptureInnerResultsInnerResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "body": obj.get("body"), + "headers": obj.get("headers"), + "serialization": obj.get("serialization"), + "status": obj.get("status"), + "status_text": obj.get("status_text") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_data_redirects_inner.py b/candidate/generated/nimble_client/models/run_extract_template200_response_data_redirects_inner.py new file mode 100644 index 0000000..7f4063b --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_data_redirects_inner.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDataRedirectsInner(BaseModel): + """ + RunExtractTemplate200ResponseDataRedirectsInner + """ # noqa: E501 + status_code: Union[Annotated[float, Field(le=599, strict=True, ge=100)], Annotated[int, Field(le=599, strict=True, ge=100)]] + url: StrictStr + __properties: ClassVar[List[str]] = ["status_code", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataRedirectsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDataRedirectsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status_code": obj.get("status_code"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_debug.py b/candidate/generated/nimble_client/models/run_extract_template200_response_debug.py new file mode 100644 index 0000000..c9ea276 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_debug.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseDebug(BaseModel): + """ + RunExtractTemplate200ResponseDebug + """ # noqa: E501 + performance_metrics: Optional[Dict[str, Union[StrictFloat, StrictInt]]] = Field(default=None, description="Performance metrics collected during the task.") + proxy_total_bytes_usage: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="Total bytes used by the proxy during the task.") + transformed_output: Optional[Any] = Field(default=None, description="The transformed output after applying any transformations.") + userbrowser: Optional[Any] = Field(default=None, description="The userbrowser instance using during the task.") + __properties: ClassVar[List[str]] = ["performance_metrics", "proxy_total_bytes_usage", "transformed_output", "userbrowser"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDebug from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if transformed_output (nullable) is None + # and model_fields_set contains the field + if self.transformed_output is None and "transformed_output" in self.model_fields_set: + _dict['transformed_output'] = None + + # set to None if userbrowser (nullable) is None + # and model_fields_set contains the field + if self.userbrowser is None and "userbrowser" in self.model_fields_set: + _dict['userbrowser'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseDebug from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "performance_metrics": obj.get("performance_metrics"), + "proxy_total_bytes_usage": obj.get("proxy_total_bytes_usage"), + "transformed_output": obj.get("transformed_output"), + "userbrowser": obj.get("userbrowser") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_metadata.py b/candidate/generated/nimble_client/models/run_extract_template200_response_metadata.py new file mode 100644 index 0000000..1e12957 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_metadata.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate200ResponseMetadata(BaseModel): + """ + RunExtractTemplate200ResponseMetadata + """ # noqa: E501 + agent: Optional[StrictStr] = Field(default=None, description="The name of the agent used for the query.") + driver: Optional[StrictStr] = Field(default=None, description="The driver used for the task.") + localization_id: Optional[StrictStr] = Field(default=None, description="The localization identifier for the query.") + query_duration: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The duration in milliseconds of the query processing.") + query_time: Optional[StrictStr] = Field(default=None, description="The time when the query was received.") + response_parameters: Optional[Any] = Field(default=None, description="Additional response parameters.") + tag: Optional[StrictStr] = Field(default=None, description="A tag associated with the query.") + __properties: ClassVar[List[str]] = ["agent", "driver", "localization_id", "query_duration", "query_time", "response_parameters", "tag"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if response_parameters (nullable) is None + # and model_fields_set contains the field + if self.response_parameters is None and "response_parameters" in self.model_fields_set: + _dict['response_parameters'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate200ResponseMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent": obj.get("agent"), + "driver": obj.get("driver"), + "localization_id": obj.get("localization_id"), + "query_duration": obj.get("query_duration"), + "query_time": obj.get("query_time"), + "response_parameters": obj.get("response_parameters"), + "tag": obj.get("tag") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template200_response_pagination.py b/candidate/generated/nimble_client/models/run_extract_template200_response_pagination.py new file mode 100644 index 0000000..4971150 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template200_response_pagination.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from nimble_client.models.extract200_response_pagination_any_of1_inner import Extract200ResponsePaginationAnyOf1Inner +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +RUNEXTRACTTEMPLATE200RESPONSEPAGINATION_ANY_OF_SCHEMAS = ["Extract200ResponsePaginationAnyOf1Inner", "List[Extract200ResponsePaginationAnyOf1Inner]"] + +class RunExtractTemplate200ResponsePagination(BaseModel): + """ + Pagination information if applicable. + """ + + # data type: Extract200ResponsePaginationAnyOf1Inner + anyof_schema_1_validator: Optional[Extract200ResponsePaginationAnyOf1Inner] = None + # data type: List[Extract200ResponsePaginationAnyOf1Inner] + anyof_schema_2_validator: Optional[List[Extract200ResponsePaginationAnyOf1Inner]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[Extract200ResponsePaginationAnyOf1Inner, List[Extract200ResponsePaginationAnyOf1Inner]]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "Extract200ResponsePaginationAnyOf1Inner", "List[Extract200ResponsePaginationAnyOf1Inner]" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = RunExtractTemplate200ResponsePagination.model_construct() + error_messages = [] + # validate data type: Extract200ResponsePaginationAnyOf1Inner + if not isinstance(v, Extract200ResponsePaginationAnyOf1Inner): + error_messages.append(f"Error! Input type `{type(v)}` is not `Extract200ResponsePaginationAnyOf1Inner`") + else: + return v + + # validate data type: List[Extract200ResponsePaginationAnyOf1Inner] + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in RunExtractTemplate200ResponsePagination with anyOf schemas: Extract200ResponsePaginationAnyOf1Inner, List[Extract200ResponsePaginationAnyOf1Inner]. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[Extract200ResponsePaginationAnyOf1Inner] = None + try: + instance.actual_instance = Extract200ResponsePaginationAnyOf1Inner.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[Extract200ResponsePaginationAnyOf1Inner] + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into RunExtractTemplate200ResponsePagination with anyOf schemas: Extract200ResponsePaginationAnyOf1Inner, List[Extract200ResponsePaginationAnyOf1Inner]. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Extract200ResponsePaginationAnyOf1Inner, List[Extract200ResponsePaginationAnyOf1Inner]]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/run_extract_template404_response.py b/candidate/generated/nimble_client/models/run_extract_template404_response.py new file mode 100644 index 0000000..c1eeaaf --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template404_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplate404Response(BaseModel): + """ + RunExtractTemplate404Response + """ # noqa: E501 + msg: StrictStr + status: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["msg", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['failed']): + raise ValueError("must be one of enum values ('failed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplate404Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplate404Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "msg": obj.get("msg"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template_async200_response.py b/candidate/generated/nimble_client/models/run_extract_template_async200_response.py new file mode 100644 index 0000000..41e292d --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template_async200_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplateAsync200Response(BaseModel): + """ + RunExtractTemplateAsync200Response + """ # noqa: E501 + status: StrictStr + task: Dict[str, Any] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["status", "task"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success']): + raise ValueError("must be one of enum values ('success')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplateAsync200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplateAsync200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "task": obj.get("task") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_extract_template_async_request.py b/candidate/generated/nimble_client/models/run_extract_template_async_request.py new file mode 100644 index 0000000..92e0663 --- /dev/null +++ b/candidate/generated/nimble_client/models/run_extract_template_async_request.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunExtractTemplateAsyncRequest(BaseModel): + """ + RunExtractTemplateAsyncRequest + """ # noqa: E501 + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="Response formats to include. All disabled by default.") + localization: Optional[StrictBool] = False + params: Dict[str, Any] + template: StrictStr + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["formats", "localization", "params", "template", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunExtractTemplateAsyncRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunExtractTemplateAsyncRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "formats": obj.get("formats"), + "localization": obj.get("localization") if obj.get("localization") is not None else False, + "params": obj.get("params"), + "template": obj.get("template"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/run_stats_public_v2.py b/candidate/generated/nimble_client/models/run_stats_public_v2.py new file mode 100644 index 0000000..41c5a7c --- /dev/null +++ b/candidate/generated/nimble_client/models/run_stats_public_v2.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RunStatsPublicV2(BaseModel): + """ + RunStatsPublicV2 + """ # noqa: E501 + extract_templates: StrictInt = Field(description="Times the agent ran a Nimble extract template to parse a page into structured fields.") + extracts: StrictInt = Field(description="Pages the agent fetched and extracted, including attempts that failed. Pages it already had in the run don't count.") + page_reads: StrictInt = Field(description="Times the agent read or searched through pages it had already extracted.") + scripts_run: StrictInt = Field(description="Scripts the agent wrote and ran to process what it collected.") + searches: StrictInt = Field(description="Web searches the agent ran: one per researched sub-question, plus any direct search calls.") + __properties: ClassVar[List[str]] = ["extract_templates", "extracts", "page_reads", "scripts_run", "searches"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunStatsPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunStatsPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "extract_templates": obj.get("extract_templates"), + "extracts": obj.get("extracts"), + "page_reads": obj.get("page_reads"), + "scripts_run": obj.get("scripts_run"), + "searches": obj.get("searches") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/safe_search.py b/candidate/generated/nimble_client/models/safe_search.py new file mode 100644 index 0000000..5603afe --- /dev/null +++ b/candidate/generated/nimble_client/models/safe_search.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SafeSearch(str, Enum): + """ + Adult-content filtering a `/search` request asks for (SRCH-227). Declared from least to most filtering (see app/services/safe_search.py). Omitted on a request means each provider's own default, not `off`. + """ + + """ + allowed enum values + """ + OFF = 'off' + MODERATE = 'moderate' + STRICT = 'strict' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SafeSearch from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/screenshot_action.py b/candidate/generated/nimble_client/models/screenshot_action.py new file mode 100644 index 0000000..6e4b3de --- /dev/null +++ b/candidate/generated/nimble_client/models/screenshot_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.screenshot_action_screenshot import ScreenshotActionScreenshot +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScreenshotAction(BaseModel): + """ + Capture a page screenshot + """ # noqa: E501 + screenshot: ScreenshotActionScreenshot + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["screenshot"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScreenshotAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of screenshot + if self.screenshot: + _dict['screenshot'] = self.screenshot.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScreenshotAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "screenshot": ScreenshotActionScreenshot.from_dict(obj["screenshot"]) if obj.get("screenshot") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/screenshot_action_screenshot.py b/candidate/generated/nimble_client/models/screenshot_action_screenshot.py new file mode 100644 index 0000000..3c749f9 --- /dev/null +++ b/candidate/generated/nimble_client/models/screenshot_action_screenshot.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.screenshot_action_screenshot_one_of import ScreenshotActionScreenshotOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +SCREENSHOTACTIONSCREENSHOT_ONE_OF_SCHEMAS = ["ScreenshotActionScreenshotOneOf", "bool"] + +class ScreenshotActionScreenshot(BaseModel): + """ + ScreenshotActionScreenshot + """ + # data type: bool + oneof_schema_1_validator: Optional[StrictBool] = None + # data type: ScreenshotActionScreenshotOneOf + oneof_schema_2_validator: Optional[ScreenshotActionScreenshotOneOf] = None + actual_instance: Optional[Union[ScreenshotActionScreenshotOneOf, bool]] = None + one_of_schemas: Set[str] = { "ScreenshotActionScreenshotOneOf", "bool" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = ScreenshotActionScreenshot.model_construct() + error_messages = [] + match = 0 + # validate data type: bool + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: ScreenshotActionScreenshotOneOf + if not isinstance(v, ScreenshotActionScreenshotOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScreenshotActionScreenshotOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in ScreenshotActionScreenshot with oneOf schemas: ScreenshotActionScreenshotOneOf, bool. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in ScreenshotActionScreenshot with oneOf schemas: ScreenshotActionScreenshotOneOf, bool. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into bool + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ScreenshotActionScreenshotOneOf + try: + instance.actual_instance = ScreenshotActionScreenshotOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into ScreenshotActionScreenshot with oneOf schemas: ScreenshotActionScreenshotOneOf, bool. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into ScreenshotActionScreenshot with oneOf schemas: ScreenshotActionScreenshotOneOf, bool. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ScreenshotActionScreenshotOneOf, bool]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/screenshot_action_screenshot_one_of.py b/candidate/generated/nimble_client/models/screenshot_action_screenshot_one_of.py new file mode 100644 index 0000000..d93583c --- /dev/null +++ b/candidate/generated/nimble_client/models/screenshot_action_screenshot_one_of.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScreenshotActionScreenshotOneOf(BaseModel): + """ + ScreenshotActionScreenshotOneOf + """ # noqa: E501 + format: Optional[StrictStr] = None + full_page: Optional[StrictBool] = None + quality: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = None + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + __properties: ClassVar[List[str]] = ["format", "full_page", "quality", "required", "skip"] + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['png', 'jpeg', 'webp']): + raise ValueError("must be one of enum values ('png', 'jpeg', 'webp')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScreenshotActionScreenshotOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScreenshotActionScreenshotOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "format": obj.get("format"), + "full_page": obj.get("full_page"), + "quality": obj.get("quality"), + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/scroll_action.py b/candidate/generated/nimble_client/models/scroll_action.py new file mode 100644 index 0000000..0c894da --- /dev/null +++ b/candidate/generated/nimble_client/models/scroll_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.scroll_action_scroll import ScrollActionScroll +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScrollAction(BaseModel): + """ + Scroll the page or an element + """ # noqa: E501 + scroll: ScrollActionScroll + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["scroll"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScrollAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of scroll + if self.scroll: + _dict['scroll'] = self.scroll.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScrollAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scroll": ScrollActionScroll.from_dict(obj["scroll"]) if obj.get("scroll") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/scroll_action_scroll.py b/candidate/generated/nimble_client/models/scroll_action_scroll.py new file mode 100644 index 0000000..d1ee0dc --- /dev/null +++ b/candidate/generated/nimble_client/models/scroll_action_scroll.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional, Union +from nimble_client.models.scroll_action_scroll_one_of import ScrollActionScrollOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +SCROLLACTIONSCROLL_ONE_OF_SCHEMAS = ["ScrollActionScrollOneOf", "float", "str"] + +class ScrollActionScroll(BaseModel): + """ + ScrollActionScroll + """ + # data type: float + oneof_schema_1_validator: Optional[Union[StrictFloat, StrictInt]] = None + # data type: str + oneof_schema_2_validator: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + # data type: ScrollActionScrollOneOf + oneof_schema_3_validator: Optional[ScrollActionScrollOneOf] = None + actual_instance: Optional[Union[ScrollActionScrollOneOf, float, str]] = None + one_of_schemas: Set[str] = { "ScrollActionScrollOneOf", "float", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = ScrollActionScroll.model_construct() + error_messages = [] + match = 0 + # validate data type: float + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: ScrollActionScrollOneOf + if not isinstance(v, ScrollActionScrollOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScrollActionScrollOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in ScrollActionScroll with oneOf schemas: ScrollActionScrollOneOf, float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in ScrollActionScroll with oneOf schemas: ScrollActionScrollOneOf, float, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into float + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ScrollActionScrollOneOf + try: + instance.actual_instance = ScrollActionScrollOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into ScrollActionScroll with oneOf schemas: ScrollActionScrollOneOf, float, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into ScrollActionScroll with oneOf schemas: ScrollActionScrollOneOf, float, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ScrollActionScrollOneOf, float, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/scroll_action_scroll_one_of.py b/candidate/generated/nimble_client/models/scroll_action_scroll_one_of.py new file mode 100644 index 0000000..c454cc3 --- /dev/null +++ b/candidate/generated/nimble_client/models/scroll_action_scroll_one_of.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.selector import Selector +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScrollActionScrollOneOf(BaseModel): + """ + ScrollActionScrollOneOf + """ # noqa: E501 + container: Optional[Selector] = None + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + to: Optional[Selector] = None + visible: Optional[StrictBool] = None + x: Optional[Union[StrictFloat, StrictInt]] = None + y: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["container", "required", "skip", "to", "visible", "x", "y"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScrollActionScrollOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of container + if self.container: + _dict['container'] = self.container.to_dict() + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + # override the default output from pydantic by calling `to_dict()` of to + if self.to: + _dict['to'] = self.to.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScrollActionScrollOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "container": Selector.from_dict(obj["container"]) if obj.get("container") is not None else None, + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "to": Selector.from_dict(obj["to"]) if obj.get("to") is not None else None, + "visible": obj.get("visible"), + "x": obj.get("x"), + "y": obj.get("y") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/sdk_string_variant7a06ddd6b0fd.py b/candidate/generated/nimble_client/models/sdk_string_variant7a06ddd6b0fd.py new file mode 100644 index 0000000..11de40b --- /dev/null +++ b/candidate/generated/nimble_client/models/sdk_string_variant7a06ddd6b0fd.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SdkStringVariant7a06ddd6b0fd(str, Enum): + """ + Resource type for network capture filtering + """ + + """ + allowed enum values + """ + DOCUMENT = 'document' + STYLESHEET = 'stylesheet' + IMAGE = 'image' + MEDIA = 'media' + FONT = 'font' + SCRIPT = 'script' + TEXTTRACK = 'texttrack' + XHR = 'xhr' + FETCH = 'fetch' + PREFETCH = 'prefetch' + EVENTSOURCE = 'eventsource' + WEBSOCKET = 'websocket' + MANIFEST = 'manifest' + SIGNEDEXCHANGE = 'signedexchange' + PING = 'ping' + CSPVIOLATIONREPORT = 'cspviolationreport' + PREFLIGHT = 'preflight' + OTHER = 'other' + FEDCM = 'fedcm' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SdkStringVariant7a06ddd6b0fd from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/search_depth.py b/candidate/generated/nimble_client/models/search_depth.py new file mode 100644 index 0000000..2edf3ec --- /dev/null +++ b/candidate/generated/nimble_client/models/search_depth.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SearchDepth(str, Enum): + """ + Controls content richness and latency of search results. - lite: Token-efficient metadata for high-volume pipelines (title, URL, description only) - standard: Rich content (~2K chars) optimized for AI agents + """ + + """ + allowed enum values + """ + LITE = 'lite' + STANDARD = 'standard' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SearchDepth from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/search_request.py b/candidate/generated/nimble_client/models/search_request.py new file mode 100644 index 0000000..14fb774 --- /dev/null +++ b/candidate/generated/nimble_client/models/search_request.py @@ -0,0 +1,174 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.focus import Focus +from nimble_client.models.parsing_type import ParsingType +from nimble_client.models.safe_search import SafeSearch +from nimble_client.models.search_depth import SearchDepth +from nimble_client.models.time_range import TimeRange +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchRequest(BaseModel): + """ + Request body model for the /search endpoint. + """ # noqa: E501 + content_type: Optional[List[StrictStr]] = Field(default=None, description="Filter by content type (only supported with focus=general). Supports semantic groups ('documents', 'spreadsheets', 'presentations') and specific formats ('pdf', 'docx', 'xlsx', etc.)") + country: Optional[StrictStr] = Field(default='US', description="Country code for geo-targeted results (e.g., 'US', 'GB', 'IL')") + deep_search: Optional[StrictBool] = Field(default=None, description="Deprecated. Use search_depth with full_content instead. true maps to 'lite' with full_content=true, false maps to 'lite'.") + end_date: Optional[StrictStr] = Field(default=None, description="Filter results before this date (format: YYYY-MM-DD or YYYY)") + exclude_domains: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field(default=None, description="List of domains to exclude from search results. Maximum 50 domains.") + focus: Optional[Focus] = None + full_content: Optional[StrictBool] = Field(default=False, description="Return full page content for each result, in addition to its title, url, and description. Works with either search_depth value. Higher recall and cost.") + include_domains: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field(default=None, description="List of domains to include in search results. Maximum 50 domains.") + locale: Optional[StrictStr] = Field(default='en', description="Language/locale code (e.g., 'en', 'fr', 'de')") + max_results: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = Field(default=10, description="Maximum number of results to return. Actual count may be lower depending on availability.") + max_subagents: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Maximum number of subagents to execute in parallel for WSA focus modes (shopping, social, geo). Ignored for SERP focus modes.") + output_format: Optional[ParsingType] = Field(default=None, description="Output format: plain_text, markdown, or simplified_html") + query: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Search query string") + safe_search: Optional[SafeSearch] = Field(default=None, description="Adult-content filtering: 'off', 'moderate' or 'strict'. When omitted, each search provider applies its own default. Your account may enforce a minimum level, in which case the stricter of the two applies and is reported back in the response. Filtering is best effort, not guaranteed. With search_depth='lite', 'moderate' applies the same filtering as 'strict'. A level above 'off' is rejected with focus 'serp', 'shopping', 'geo' or 'social', or with custom subagents. With search_depth='lite' it is also rejected with focus 'location', time_range='hour', some countries, and queries over 400 characters or 50 words including the domain filters a focus adds (focus 'academic' adds about 360 characters, so most academic queries are rejected).") + search_depth: Optional[SearchDepth] = Field(default=None, description="Content richness: 'lite' (titles, URLs, snippets) or 'standard' (rich content, default).") + start_date: Optional[StrictStr] = Field(default=None, description="Filter results after this date (format: YYYY-MM-DD or YYYY)") + time_range: Optional[TimeRange] = Field(default=None, description="Filter by recency: hour, day, week, month, or year. Cannot be combined with start_date/end_date.") + __properties: ClassVar[List[str]] = ["content_type", "country", "deep_search", "end_date", "exclude_domains", "focus", "full_content", "include_domains", "locale", "max_results", "max_subagents", "output_format", "query", "safe_search", "search_depth", "start_date", "time_range"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of focus + if self.focus: + _dict['focus'] = self.focus.to_dict() + # set to None if content_type (nullable) is None + # and model_fields_set contains the field + if self.content_type is None and "content_type" in self.model_fields_set: + _dict['content_type'] = None + + # set to None if deep_search (nullable) is None + # and model_fields_set contains the field + if self.deep_search is None and "deep_search" in self.model_fields_set: + _dict['deep_search'] = None + + # set to None if end_date (nullable) is None + # and model_fields_set contains the field + if self.end_date is None and "end_date" in self.model_fields_set: + _dict['end_date'] = None + + # set to None if exclude_domains (nullable) is None + # and model_fields_set contains the field + if self.exclude_domains is None and "exclude_domains" in self.model_fields_set: + _dict['exclude_domains'] = None + + # set to None if include_domains (nullable) is None + # and model_fields_set contains the field + if self.include_domains is None and "include_domains" in self.model_fields_set: + _dict['include_domains'] = None + + # set to None if safe_search (nullable) is None + # and model_fields_set contains the field + if self.safe_search is None and "safe_search" in self.model_fields_set: + _dict['safe_search'] = None + + # set to None if search_depth (nullable) is None + # and model_fields_set contains the field + if self.search_depth is None and "search_depth" in self.model_fields_set: + _dict['search_depth'] = None + + # set to None if start_date (nullable) is None + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: + _dict['start_date'] = None + + # set to None if time_range (nullable) is None + # and model_fields_set contains the field + if self.time_range is None and "time_range" in self.model_fields_set: + _dict['time_range'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content_type": obj.get("content_type"), + "country": obj.get("country") if obj.get("country") is not None else 'US', + "deep_search": obj.get("deep_search"), + "end_date": obj.get("end_date"), + "exclude_domains": obj.get("exclude_domains"), + "focus": Focus.from_dict(obj["focus"]) if obj.get("focus") is not None else None, + "full_content": obj.get("full_content") if obj.get("full_content") is not None else False, + "include_domains": obj.get("include_domains"), + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', + "max_results": obj.get("max_results") if obj.get("max_results") is not None else 10, + "max_subagents": obj.get("max_subagents") if obj.get("max_subagents") is not None else 3, + "output_format": obj.get("output_format"), + "query": obj.get("query"), + "safe_search": obj.get("safe_search"), + "search_depth": obj.get("search_depth"), + "start_date": obj.get("start_date"), + "time_range": obj.get("time_range") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/search_response.py b/candidate/generated/nimble_client/models/search_response.py new file mode 100644 index 0000000..bf8a64e --- /dev/null +++ b/candidate/generated/nimble_client/models/search_response.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.citation import Citation +from nimble_client.models.result_model import ResultModel +from nimble_client.models.safe_search import SafeSearch +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchResponse(BaseModel): + """ + Response model from SearchService with results and optional LLM answer. Note: request_id is always a valid UUID generated internally by the middleware, so no validation is needed. + """ # noqa: E501 + answer: Optional[StrictStr] = None + answer_citations: Optional[List[Citation]] = Field(default=None, description="Citations mapping citation markers to result indices") + request_id: StrictStr = Field(description="Unique identifier for this request (UUID)") + results: List[ResultModel] + safe_search: Optional[SafeSearch] = Field(default=None, description="The effective safe search level: the stricter of the requested level and any minimum your account enforces. Omitted when neither was set. With filtering on, empty results can mean every match was filtered out.") + serp_data: Optional[Dict[str, Any]] = Field(default=None, description="Cleaned SERP entities (e.g. KnowledgeGraph, TopStory, RelatedSearch). Only present for focus='serp'.") + total_results: StrictInt = Field(description="Number of results returned") + __properties: ClassVar[List[str]] = ["answer", "answer_citations", "request_id", "results", "safe_search", "serp_data", "total_results"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in answer_citations (list) + _items = [] + if self.answer_citations: + for _item_answer_citations in self.answer_citations: + _items.append(_item_answer_citations.to_dict() if _item_answer_citations is not None else None) + _dict['answer_citations'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + _items.append(_item_results.to_dict() if _item_results is not None else None) + _dict['results'] = _items + # set to None if answer (nullable) is None + # and model_fields_set contains the field + if self.answer is None and "answer" in self.model_fields_set: + _dict['answer'] = None + + # set to None if answer_citations (nullable) is None + # and model_fields_set contains the field + if self.answer_citations is None and "answer_citations" in self.model_fields_set: + _dict['answer_citations'] = None + + # set to None if safe_search (nullable) is None + # and model_fields_set contains the field + if self.safe_search is None and "safe_search" in self.model_fields_set: + _dict['safe_search'] = None + + # set to None if serp_data (nullable) is None + # and model_fields_set contains the field + if self.serp_data is None and "serp_data" in self.model_fields_set: + _dict['serp_data'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "answer": obj.get("answer"), + "answer_citations": [Citation.from_dict(_item) for _item in obj["answer_citations"]] if obj.get("answer_citations") is not None else None, + "request_id": obj.get("request_id"), + "results": [ResultModel.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "safe_search": obj.get("safe_search"), + "serp_data": obj.get("serp_data"), + "total_results": obj.get("total_results") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/selector.py b/candidate/generated/nimble_client/models/selector.py new file mode 100644 index 0000000..c3f541b --- /dev/null +++ b/candidate/generated/nimble_client/models/selector.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from typing_extensions import Annotated +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +SELECTOR_ONE_OF_SCHEMAS = ["List[str]", "str"] + +class Selector(BaseModel): + """ + CSS selector or array of alternative selectors. Use an array when you have multiple possible selectors for the same element. + """ + # data type: str + oneof_schema_1_validator: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + # data type: List[str] + oneof_schema_2_validator: Optional[Annotated[List[Annotated[str, Field(min_length=1, strict=True)]], Field(min_length=1)]] = None + actual_instance: Optional[Union[List[str], str]] = None + one_of_schemas: Set[str] = { "List[str]", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = Selector.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[str] + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in Selector with oneOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in Selector with oneOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into str + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[str] + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into Selector with oneOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into Selector with oneOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[str], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/serp_async_request.py b/candidate/generated/nimble_client/models/serp_async_request.py new file mode 100644 index 0000000..7c3185d --- /dev/null +++ b/candidate/generated/nimble_client/models/serp_async_request.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerpAsyncRequest(BaseModel): + """ + SerpAsyncRequest + """ # noqa: E501 + country: Optional[StrictStr] = Field(default=None, description="ISO Alpha-2 country code used to access the target search engine (e.g. US, DE, GB).") + device: Optional[StrictStr] = Field(default=None, description="Device type used for the search request.") + domain: Optional[StrictStr] = Field(default='com', description="Top-level domain for the search engine (e.g. \"com\", \"co.uk\", \"de\").") + locale: Optional[StrictStr] = Field(default=None, description="Locale used for the search request.") + location: Optional[StrictStr] = Field(default=None, description="Geo-location for the search (canonical Google location name).") + num_results: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = Field(default=None, description="Number of results to return (1–100).") + page: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]] = Field(default=None, description="The result page number for pagination.") + parse: Optional[StrictBool] = Field(default=True, description="When true, the SERP response is parsed into structured JSON.") + query: Optional[StrictStr] = Field(default=None, description="The search keyword or phrase to query.") + render: Optional[StrictBool] = Field(default=False, description="Whether to render the page in a browser before extracting.") + resolve_url: Optional[StrictBool] = Field(default=None, description="When true, search result links that point at a search-engine redirector are resolved to their final destination URLs. Best-effort within a time budget: links that cannot be resolved in time are returned unchanged.") + search_engine: StrictStr = Field(description="The search engine to query.") + show_hidden_results: Optional[StrictBool] = Field(default=None, description="When true, disables Google result filtering (filter=0) so omitted/duplicate and highly similar pages are also returned. Applies to Google search engines.") + zdr: Optional[StrictBool] = Field(default=None, description="Redact retained customer input. Async and batch require customer storage_url; execution context expires after the configured retention period.") + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["country", "device", "domain", "locale", "location", "num_results", "page", "parse", "query", "render", "resolve_url", "search_engine", "show_hidden_results", "zdr", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('search_engine') + def search_engine_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search']): + raise ValueError("must be one of enum values ('google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerpAsyncRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerpAsyncRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "device": obj.get("device"), + "domain": obj.get("domain") if obj.get("domain") is not None else 'com', + "locale": obj.get("locale"), + "location": obj.get("location"), + "num_results": obj.get("num_results"), + "page": obj.get("page"), + "parse": obj.get("parse") if obj.get("parse") is not None else True, + "query": obj.get("query"), + "render": obj.get("render") if obj.get("render") is not None else False, + "resolve_url": obj.get("resolve_url"), + "search_engine": obj.get("search_engine"), + "show_hidden_results": obj.get("show_hidden_results"), + "zdr": obj.get("zdr"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/serp_async_response.py b/candidate/generated/nimble_client/models/serp_async_response.py new file mode 100644 index 0000000..c3df511 --- /dev/null +++ b/candidate/generated/nimble_client/models/serp_async_response.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from nimble_client.models.extract_async_response_task import ExtractAsyncResponseTask +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerpAsyncResponse(BaseModel): + """ + Response when an async SERP task is created successfully. + """ # noqa: E501 + status: StrictStr = Field(description="Status indicating the async SERP task was created successfully.") + task: ExtractAsyncResponseTask + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["status", "task"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success']): + raise ValueError("must be one of enum values ('success')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerpAsyncResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of task + if self.task: + _dict['task'] = self.task.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerpAsyncResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "task": ExtractAsyncResponseTask.from_dict(obj["task"]) if obj.get("task") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/serp_batch_payload.py b/candidate/generated/nimble_client/models/serp_batch_payload.py new file mode 100644 index 0000000..9b2f7af --- /dev/null +++ b/candidate/generated/nimble_client/models/serp_batch_payload.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from nimble_client.models.serp_batch_payload_inputs_inner import SerpBatchPayloadInputsInner +from nimble_client.models.serp_batch_payload_shared_inputs import SerpBatchPayloadSharedInputs +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerpBatchPayload(BaseModel): + """ + SerpBatchPayload + """ # noqa: E501 + inputs: Annotated[List[SerpBatchPayloadInputsInner], Field(min_length=1)] = Field(description="Array of SERP requests. Each object can include search parameters and async/storage settings.") + shared_inputs: Optional[SerpBatchPayloadSharedInputs] = None + __properties: ClassVar[List[str]] = ["inputs", "shared_inputs"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerpBatchPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in inputs (list) + _items = [] + if self.inputs: + for _item_inputs in self.inputs: + _items.append(_item_inputs.to_dict() if _item_inputs is not None else None) + _dict['inputs'] = _items + # override the default output from pydantic by calling `to_dict()` of shared_inputs + if self.shared_inputs: + _dict['shared_inputs'] = self.shared_inputs.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerpBatchPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "inputs": [SerpBatchPayloadInputsInner.from_dict(_item) for _item in obj["inputs"]] if obj.get("inputs") is not None else None, + "shared_inputs": SerpBatchPayloadSharedInputs.from_dict(obj["shared_inputs"]) if obj.get("shared_inputs") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/serp_batch_payload_inputs_inner.py b/candidate/generated/nimble_client/models/serp_batch_payload_inputs_inner.py new file mode 100644 index 0000000..d655ceb --- /dev/null +++ b/candidate/generated/nimble_client/models/serp_batch_payload_inputs_inner.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerpBatchPayloadInputsInner(BaseModel): + """ + SerpBatchPayloadInputsInner + """ # noqa: E501 + country: Optional[StrictStr] = Field(default=None, description="ISO Alpha-2 country code used to access the target search engine (e.g. US, DE, GB).") + device: Optional[StrictStr] = Field(default=None, description="Device type used for the search request.") + domain: Optional[StrictStr] = Field(default='com', description="Top-level domain for the search engine (e.g. \"com\", \"co.uk\", \"de\").") + locale: Optional[StrictStr] = Field(default=None, description="Locale used for the search request.") + location: Optional[StrictStr] = Field(default=None, description="Geo-location for the search (canonical Google location name).") + num_results: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = Field(default=None, description="Number of results to return (1–100).") + page: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]] = Field(default=None, description="The result page number for pagination.") + parse: Optional[StrictBool] = Field(default=True, description="When true, the SERP response is parsed into structured JSON.") + query: Optional[StrictStr] = Field(default=None, description="The search keyword or phrase to query.") + render: Optional[StrictBool] = Field(default=False, description="Whether to render the page in a browser before extracting.") + resolve_url: Optional[StrictBool] = Field(default=None, description="When true, search result links that point at a search-engine redirector are resolved from the redirector's Location header without loading the destination page. Best-effort within a time budget: links that cannot be resolved in time are returned unchanged.") + search_engine: Optional[StrictStr] = Field(default=None, description="The search engine to query.") + show_hidden_results: Optional[StrictBool] = Field(default=None, description="When true, disables Google result filtering (filter=0) so omitted/duplicate and highly similar pages are also returned. Applies to Google search engines.") + zdr: Optional[StrictBool] = Field(default=None, description="Redact retained customer input. Async and batch require customer storage_url; execution context expires after the configured retention period.") + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["country", "device", "domain", "locale", "location", "num_results", "page", "parse", "query", "render", "resolve_url", "search_engine", "show_hidden_results", "zdr", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('search_engine') + def search_engine_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search']): + raise ValueError("must be one of enum values ('google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerpBatchPayloadInputsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerpBatchPayloadInputsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "device": obj.get("device"), + "domain": obj.get("domain") if obj.get("domain") is not None else 'com', + "locale": obj.get("locale"), + "location": obj.get("location"), + "num_results": obj.get("num_results"), + "page": obj.get("page"), + "parse": obj.get("parse") if obj.get("parse") is not None else True, + "query": obj.get("query"), + "render": obj.get("render") if obj.get("render") is not None else False, + "resolve_url": obj.get("resolve_url"), + "search_engine": obj.get("search_engine"), + "show_hidden_results": obj.get("show_hidden_results"), + "zdr": obj.get("zdr"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/serp_batch_payload_shared_inputs.py b/candidate/generated/nimble_client/models/serp_batch_payload_shared_inputs.py new file mode 100644 index 0000000..e4f08e3 --- /dev/null +++ b/candidate/generated/nimble_client/models/serp_batch_payload_shared_inputs.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerpBatchPayloadSharedInputs(BaseModel): + """ + Shared parameters applied to the entire batch. Can include search parameters and async/storage settings. + """ # noqa: E501 + country: Optional[StrictStr] = Field(default=None, description="ISO Alpha-2 country code used to access the target search engine (e.g. US, DE, GB).") + device: Optional[StrictStr] = Field(default=None, description="Device type used for the search request.") + domain: Optional[StrictStr] = Field(default='com', description="Top-level domain for the search engine (e.g. \"com\", \"co.uk\", \"de\").") + locale: Optional[StrictStr] = Field(default=None, description="Locale used for the search request.") + location: Optional[StrictStr] = Field(default=None, description="Geo-location for the search (canonical Google location name).") + num_results: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = Field(default=None, description="Number of results to return (1–100).") + page: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]] = Field(default=None, description="The result page number for pagination.") + parse: Optional[StrictBool] = Field(default=True, description="When true, the SERP response is parsed into structured JSON.") + query: Optional[StrictStr] = Field(default=None, description="The search keyword or phrase to query.") + render: Optional[StrictBool] = Field(default=False, description="Whether to render the page in a browser before extracting.") + resolve_url: Optional[StrictBool] = Field(default=None, description="When true, search result links that point at a search-engine redirector are resolved from the redirector's Location header without loading the destination page. Best-effort within a time budget: links that cannot be resolved in time are returned unchanged.") + search_engine: Optional[StrictStr] = Field(default=None, description="The search engine to query.") + show_hidden_results: Optional[StrictBool] = Field(default=None, description="When true, disables Google result filtering (filter=0) so omitted/duplicate and highly similar pages are also returned. Applies to Google search engines.") + zdr: Optional[StrictBool] = Field(default=None, description="Redact retained customer input. Async and batch require customer storage_url; execution context expires after the configured retention period.") + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["country", "device", "domain", "locale", "location", "num_results", "page", "parse", "query", "render", "resolve_url", "search_engine", "show_hidden_results", "zdr", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('search_engine') + def search_engine_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search']): + raise ValueError("must be one of enum values ('google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerpBatchPayloadSharedInputs from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerpBatchPayloadSharedInputs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "device": obj.get("device"), + "domain": obj.get("domain") if obj.get("domain") is not None else 'com', + "locale": obj.get("locale"), + "location": obj.get("location"), + "num_results": obj.get("num_results"), + "page": obj.get("page"), + "parse": obj.get("parse") if obj.get("parse") is not None else True, + "query": obj.get("query"), + "render": obj.get("render") if obj.get("render") is not None else False, + "resolve_url": obj.get("resolve_url"), + "search_engine": obj.get("search_engine"), + "show_hidden_results": obj.get("show_hidden_results"), + "zdr": obj.get("zdr"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/serp_batch_response.py b/candidate/generated/nimble_client/models/serp_batch_response.py new file mode 100644 index 0000000..d5abe8f --- /dev/null +++ b/candidate/generated/nimble_client/models/serp_batch_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from nimble_client.models.extract_batch_response_tasks_inner import ExtractBatchResponseTasksInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerpBatchResponse(BaseModel): + """ + Response when a batch of SERP tasks is created successfully. + """ # noqa: E501 + batch_id: StrictStr = Field(description="Unique identifier for the batch.") + batch_size: Union[StrictFloat, StrictInt] = Field(description="Number of tasks in the batch.") + tasks: List[ExtractBatchResponseTasksInner] = Field(description="List of created tasks.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["batch_id", "batch_size", "tasks"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerpBatchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in tasks (list) + _items = [] + if self.tasks: + for _item_tasks in self.tasks: + _items.append(_item_tasks.to_dict() if _item_tasks is not None else None) + _dict['tasks'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerpBatchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "batch_id": obj.get("batch_id"), + "batch_size": obj.get("batch_size"), + "tasks": [ExtractBatchResponseTasksInner.from_dict(_item) for _item in obj["tasks"]] if obj.get("tasks") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/serp_metadata.py b/candidate/generated/nimble_client/models/serp_metadata.py new file mode 100644 index 0000000..a4d5787 --- /dev/null +++ b/candidate/generated/nimble_client/models/serp_metadata.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SERPMetadata(BaseModel): + """ + Metadata for SERP-based search results (general, news, location). + """ # noqa: E501 + country: StrictStr + driver: Optional[StrictStr] = None + entity_type: StrictStr + locale: StrictStr + position: StrictInt + __properties: ClassVar[List[str]] = ["country", "driver", "entity_type", "locale", "position"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SERPMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if driver (nullable) is None + # and model_fields_set contains the field + if self.driver is None and "driver" in self.model_fields_set: + _dict['driver'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SERPMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "driver": obj.get("driver"), + "entity_type": obj.get("entity_type"), + "locale": obj.get("locale"), + "position": obj.get("position") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/serp_payload.py b/candidate/generated/nimble_client/models/serp_payload.py new file mode 100644 index 0000000..7af344a --- /dev/null +++ b/candidate/generated/nimble_client/models/serp_payload.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerpPayload(BaseModel): + """ + Request body model for the /serp endpoint + """ # noqa: E501 + country: Optional[StrictStr] = Field(default=None, description="ISO Alpha-2 country code used to access the target search engine (e.g. US, DE, GB).") + device: Optional[StrictStr] = Field(default=None, description="Device type used for the search request.") + domain: Optional[StrictStr] = Field(default='com', description="Top-level domain for the search engine (e.g. \"com\", \"co.uk\", \"de\").") + locale: Optional[StrictStr] = Field(default=None, description="Locale used for the search request.") + location: Optional[StrictStr] = Field(default=None, description="Geo-location for the search (canonical Google location name).") + num_results: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = Field(default=None, description="Number of results to return (1–100).") + page: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]] = Field(default=None, description="The result page number for pagination.") + parse: Optional[StrictBool] = Field(default=True, description="When true, the SERP response is parsed into structured JSON.") + query: Optional[StrictStr] = Field(default=None, description="The search keyword or phrase to query.") + render: Optional[StrictBool] = Field(default=False, description="Whether to render the page in a browser before extracting.") + resolve_url: Optional[StrictBool] = Field(default=None, description="When true, search result links that point at a search-engine redirector are resolved to their final destination URLs. Best-effort within a time budget: links that cannot be resolved in time are returned unchanged.") + search_engine: StrictStr = Field(description="The search engine to query.") + show_hidden_results: Optional[StrictBool] = Field(default=None, description="When true, disables Google result filtering (filter=0) so omitted/duplicate and highly similar pages are also returned. Applies to Google search engines.") + zdr: Optional[StrictBool] = Field(default=None, description="Redact retained customer input. Async and batch require customer storage_url; execution context expires after the configured retention period.") + __properties: ClassVar[List[str]] = ["country", "device", "domain", "locale", "location", "num_results", "page", "parse", "query", "render", "resolve_url", "search_engine", "show_hidden_results", "zdr"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('search_engine') + def search_engine_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search']): + raise ValueError("must be one of enum values ('google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerpPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerpPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "device": obj.get("device"), + "domain": obj.get("domain") if obj.get("domain") is not None else 'com', + "locale": obj.get("locale"), + "location": obj.get("location"), + "num_results": obj.get("num_results"), + "page": obj.get("page"), + "parse": obj.get("parse") if obj.get("parse") is not None else True, + "query": obj.get("query"), + "render": obj.get("render") if obj.get("render") is not None else False, + "resolve_url": obj.get("resolve_url"), + "search_engine": obj.get("search_engine"), + "show_hidden_results": obj.get("show_hidden_results"), + "zdr": obj.get("zdr") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/stream_agent_run_events200_response.py b/candidate/generated/nimble_client/models/stream_agent_run_events200_response.py new file mode 100644 index 0000000..6def7f6 --- /dev/null +++ b/candidate/generated/nimble_client/models/stream_agent_run_events200_response.py @@ -0,0 +1,154 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.gateway_def4f3b7ab2bb4e1911_task_run_progress_msg_event import GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent +from nimble_client.models.gateway_def_c0fe0f39c374a83b_task_run_progress_stats_event import GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent +from nimble_client.models.gateway_def_fd08b460e1d38459_task_run_state_event import GatewayDefFd08b460e1d38459TaskRunStateEvent +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +STREAMAGENTRUNEVENTS200RESPONSE_ONE_OF_SCHEMAS = ["GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent", "GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent", "GatewayDefFd08b460e1d38459TaskRunStateEvent"] + +class StreamAgentRunEvents200Response(BaseModel): + """ + StreamAgentRunEvents200Response + """ + # data type: GatewayDefFd08b460e1d38459TaskRunStateEvent + oneof_schema_1_validator: Optional[GatewayDefFd08b460e1d38459TaskRunStateEvent] = None + # data type: GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent + oneof_schema_2_validator: Optional[GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent] = None + # data type: GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent + oneof_schema_3_validator: Optional[GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent] = None + actual_instance: Optional[Union[GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent, GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent, GatewayDefFd08b460e1d38459TaskRunStateEvent]] = None + one_of_schemas: Set[str] = { "GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent", "GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent", "GatewayDefFd08b460e1d38459TaskRunStateEvent" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = StreamAgentRunEvents200Response.model_construct() + error_messages = [] + match = 0 + # validate data type: GatewayDefFd08b460e1d38459TaskRunStateEvent + if not isinstance(v, GatewayDefFd08b460e1d38459TaskRunStateEvent): + error_messages.append(f"Error! Input type `{type(v)}` is not `GatewayDefFd08b460e1d38459TaskRunStateEvent`") + else: + match += 1 + # validate data type: GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent + if not isinstance(v, GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent): + error_messages.append(f"Error! Input type `{type(v)}` is not `GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent`") + else: + match += 1 + # validate data type: GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent + if not isinstance(v, GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent): + error_messages.append(f"Error! Input type `{type(v)}` is not `GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in StreamAgentRunEvents200Response with oneOf schemas: GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent, GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent, GatewayDefFd08b460e1d38459TaskRunStateEvent. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in StreamAgentRunEvents200Response with oneOf schemas: GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent, GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent, GatewayDefFd08b460e1d38459TaskRunStateEvent. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into GatewayDefFd08b460e1d38459TaskRunStateEvent + try: + instance.actual_instance = GatewayDefFd08b460e1d38459TaskRunStateEvent.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent + try: + instance.actual_instance = GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent + try: + instance.actual_instance = GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into StreamAgentRunEvents200Response with oneOf schemas: GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent, GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent, GatewayDefFd08b460e1d38459TaskRunStateEvent. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into StreamAgentRunEvents200Response with oneOf schemas: GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent, GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent, GatewayDefFd08b460e1d38459TaskRunStateEvent. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], GatewayDef4f3b7ab2bb4e1911TaskRunProgressMsgEvent, GatewayDefC0fe0f39c374a83bTaskRunProgressStatsEvent, GatewayDefFd08b460e1d38459TaskRunStateEvent]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/submit_async_extract_request.py b/candidate/generated/nimble_client/models/submit_async_extract_request.py new file mode 100644 index 0000000..5204de1 --- /dev/null +++ b/candidate/generated/nimble_client/models/submit_async_extract_request.py @@ -0,0 +1,321 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.browser_action import BrowserAction +from nimble_client.models.crawl_payload_extract_options_browser import CrawlPayloadExtractOptionsBrowser +from nimble_client.models.crawl_payload_extract_options_cookies import CrawlPayloadExtractOptionsCookies +from nimble_client.models.crawl_payload_extract_options_file_parsing_options import CrawlPayloadExtractOptionsFileParsingOptions +from nimble_client.models.crawl_payload_extract_options_headers_value import CrawlPayloadExtractOptionsHeadersValue +from nimble_client.models.crawl_payload_extract_options_network_capture_inner import CrawlPayloadExtractOptionsNetworkCaptureInner +from nimble_client.models.crawl_payload_extract_options_parser import CrawlPayloadExtractOptionsParser +from nimble_client.models.crawl_payload_extract_options_render import CrawlPayloadExtractOptionsRender +from nimble_client.models.crawl_payload_extract_options_session import CrawlPayloadExtractOptionsSession +from nimble_client.models.crawl_payload_extract_options_skill import CrawlPayloadExtractOptionsSkill +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SubmitAsyncExtractRequest(BaseModel): + """ + SubmitAsyncExtractRequest + """ # noqa: E501 + auto_driver_configuration: Optional[Dict[str, Annotated[int, Field(le=10, strict=True, ge=0)]]] = Field(default=None, description="Custom flow for the optimization engine: maps candidate names to the number of attempts to spend on each candidate before advancing (0 skips it). Key order defines the flow order. Providing it opts the request into 'auto' driver selection.") + body: Optional[Any] = Field(default=None, description="Request body for POST, PUT, PATCH methods") + browser: Optional[CrawlPayloadExtractOptionsBrowser] = None + browser_actions: Optional[Annotated[List[BrowserAction], Field(min_length=1)]] = Field(default=None, description="Array of browser automation actions to execute sequentially", json_schema_extra={"examples": [[{"goto": "https://example.com/login"}, {"wait_for_element": "#login-form"}, {"fill": {"selector": "#username", "value": "user@example.com"}}, {"fill": {"selector": "#password", "value": "password123"}}, {"click": "#submit"}, {"screenshot": {"full_page": True}}]]}) + city: Optional[StrictStr] = Field(default=None, description="City for geolocation") + consent_header: Optional[StrictBool] = Field(default=None, description="Whether to automatically handle cookie consent headers") + cookies: Optional[CrawlPayloadExtractOptionsCookies] = None + country: Optional[StrictStr] = Field(default='ALL', description="Country code for geolocation and proxy selection") + device: Optional[StrictStr] = Field(default='desktop', description="Device type for browser emulation") + driver: Optional[StrictStr] = Field(default=None, description="Browser driver to use") + expected_status_codes: Optional[List[Annotated[int, Field(le=9007199254740991, strict=True, ge=-9007199254740991)]]] = Field(default=None, description="Expected HTTP status codes for successful requests") + file_parsing_options: Optional[CrawlPayloadExtractOptionsFileParsingOptions] = None + formats: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="List of acceptable response formats in order of preference") + headers: Optional[Dict[str, Optional[CrawlPayloadExtractOptionsHeadersValue]]] = Field(default=None, description="Custom HTTP headers to include in the request") + http2: Optional[StrictBool] = Field(default=False, description="Whether to use HTTP/2 protocol") + is_xhr: Optional[StrictBool] = Field(default=False, description="Whether to emulate XMLHttpRequest behavior") + locale: Optional[StrictStr] = Field(default='en', description="Locale for browser language and region settings") + markdown_backend: Optional[StrictStr] = Field(default='full_page', description="Selects which markdown conversion strategy to use. \"full_page\" converts the entire HTML page. \"main_content\" uses Mozilla Readability to extract the main article content before converting.") + method: Optional[StrictStr] = Field(default='GET', description="HTTP method for the request") + network_capture: Optional[List[CrawlPayloadExtractOptionsNetworkCaptureInner]] = Field(default=None, description="Filters for capturing network traffic") + os: Optional[StrictStr] = Field(default=None, description="Operating system to emulate") + parse: Optional[StrictBool] = Field(default=False, description="Whether to parse the response content") + parser: Optional[CrawlPayloadExtractOptionsParser] = None + realtime_total_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Overall deadline in milliseconds for a realtime request. Clamped to the account total timeout — it can shorten the deadline but never extend it. Has no effect on async requests.") + referrer_type: Optional[StrictStr] = Field(default=None, description="Referrer policy for the request") + render: Optional[CrawlPayloadExtractOptionsRender] = None + request_timeout: Optional[Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]]] = Field(default=None, description="Request timeout in milliseconds") + session: Optional[CrawlPayloadExtractOptionsSession] = None + skill: Optional[CrawlPayloadExtractOptionsSkill] = None + state: Optional[StrictStr] = Field(default=None, description="US state for geolocation (only valid when country is US)") + tag: Optional[StrictStr] = Field(default=None, description="User-defined tag for request identification") + url: StrictStr = Field(description="Target URL to scrape") + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["auto_driver_configuration", "body", "browser", "browser_actions", "city", "consent_header", "cookies", "country", "device", "driver", "expected_status_codes", "file_parsing_options", "formats", "headers", "http2", "is_xhr", "locale", "markdown_backend", "method", "network_capture", "os", "parse", "parser", "realtime_total_timeout", "referrer_type", "render", "request_timeout", "session", "skill", "state", "tag", "url", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('country') + def country_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL']): + raise ValueError("must be one of enum values ('AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', 'ALL')") + return value + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile', 'tablet']): + raise ValueError("must be one of enum values ('desktop', 'mobile', 'tablet')") + return value + + @field_validator('driver') + def driver_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6']): + raise ValueError("must be one of enum values ('auto', 'max', 'vx6', 'vx8', 'vx8-pro', 'vx10', 'vx10-pro', 'vx12', 'vx12-pro', 'media-vx6', 'fast-vx6')") + return value + + @field_validator('formats') + def formats_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['html', 'markdown', 'screenshot', 'headers', 'links']): + raise ValueError("each list item must be one of ('html', 'markdown', 'screenshot', 'headers', 'links')") + return value + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto']): + raise ValueError("must be one of enum values ('aa-DJ', 'aa-ER', 'aa-ET', 'af', 'af-NA', 'af-ZA', 'ak', 'ak-GH', 'am', 'am-ET', 'an-ES', 'ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IN', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-OM', 'ar-QA', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'as', 'as-IN', 'asa', 'asa-TZ', 'ast-ES', 'az', 'az-AZ', 'az-Cyrl', 'az-Cyrl-AZ', 'az-Latn', 'az-Latn-AZ', 'be', 'be-BY', 'bem', 'bem-ZM', 'ber-DZ', 'ber-MA', 'bez', 'bez-TZ', 'bg', 'bg-BG', 'bho-IN', 'bm', 'bm-ML', 'bn', 'bn-BD', 'bn-IN', 'bo', 'bo-CN', 'bo-IN', 'br-FR', 'brx-IN', 'bs', 'bs-BA', 'byn-ER', 'ca', 'ca-AD', 'ca-ES', 'ca-FR', 'ca-IT', 'cgg', 'cgg-UG', 'chr', 'chr-US', 'crh-UA', 'cs', 'cs-CZ', 'csb-PL', 'cv-RU', 'cy', 'cy-GB', 'da', 'da-DK', 'dav', 'dav-KE', 'de', 'de-AT', 'de-BE', 'de-CH', 'de-DE', 'de-LI', 'de-LU', 'dv-MV', 'dz-BT', 'ebu', 'ebu-KE', 'ee', 'ee-GH', 'ee-TG', 'el', 'el-CY', 'el-GR', 'en', 'en-AG', 'en-AS', 'en-AU', 'en-BE', 'en-BW', 'en-BZ', 'en-CA', 'en-DK', 'en-GB', 'en-GU', 'en-HK', 'en-IE', 'en-IN', 'en-JM', 'en-MH', 'en-MP', 'en-MT', 'en-MU', 'en-NA', 'en-NG', 'en-NZ', 'en-PH', 'en-PK', 'en-SG', 'en-TT', 'en-UM', 'en-US', 'en-VI', 'en-ZA', 'en-ZM', 'en-ZW', 'eo', 'es', 'es-419', 'es-AR', 'es-BO', 'es-CL', 'es-CO', 'es-CR', 'es-CU', 'es-DO', 'es-EC', 'es-ES', 'es-GQ', 'es-GT', 'es-HN', 'es-MX', 'es-NI', 'es-PA', 'es-PE', 'es-PR', 'es-PY', 'es-SV', 'es-US', 'es-UY', 'es-VE', 'et', 'et-EE', 'eu', 'eu-ES', 'fa', 'fa-AF', 'fa-IR', 'ff', 'ff-SN', 'fi', 'fi-FI', 'fil', 'fil-PH', 'fo', 'fo-FO', 'fr', 'fr-BE', 'fr-BF', 'fr-BI', 'fr-BJ', 'fr-BL', 'fr-CA', 'fr-CD', 'fr-CF', 'fr-CG', 'fr-CH', 'fr-CI', 'fr-CM', 'fr-DJ', 'fr-FR', 'fr-GA', 'fr-GN', 'fr-GP', 'fr-GQ', 'fr-KM', 'fr-LU', 'fr-MC', 'fr-MF', 'fr-MG', 'fr-ML', 'fr-MQ', 'fr-NE', 'fr-RE', 'fr-RW', 'fr-SN', 'fr-TD', 'fr-TG', 'fur-IT', 'fy-DE', 'fy-NL', 'ga', 'ga-IE', 'gd-GB', 'gez-ER', 'gez-ET', 'gl', 'gl-ES', 'gsw', 'gsw-CH', 'gu', 'gu-IN', 'guz', 'guz-KE', 'gv', 'gv-GB', 'ha', 'ha-Latn', 'ha-Latn-GH', 'ha-Latn-NE', 'ha-Latn-NG', 'ha-NG', 'haw', 'haw-US', 'he', 'he-IL', 'hi', 'hi-IN', 'hne-IN', 'hr', 'hr-HR', 'hsb-DE', 'ht-HT', 'hu', 'hu-HU', 'hy', 'hy-AM', 'id', 'id-ID', 'ig', 'ig-NG', 'ii', 'ii-CN', 'ik-CA', 'is', 'is-IS', 'it', 'it-CH', 'it-IT', 'iu-CA', 'iw-IL', 'ja', 'ja-JP', 'jmc', 'jmc-TZ', 'ka', 'ka-GE', 'kab', 'kab-DZ', 'kam', 'kam-KE', 'kde', 'kde-TZ', 'kea', 'kea-CV', 'khq', 'khq-ML', 'ki', 'ki-KE', 'kk', 'kk-Cyrl', 'kk-Cyrl-KZ', 'kk-KZ', 'kl', 'kl-GL', 'kln', 'kln-KE', 'km', 'km-KH', 'kn', 'kn-IN', 'ko', 'ko-KR', 'kok', 'kok-IN', 'ks-IN', 'ku-TR', 'kw', 'kw-GB', 'ky-KG', 'lag', 'lag-TZ', 'lb-LU', 'lg', 'lg-UG', 'li-BE', 'li-NL', 'lij-IT', 'lo-LA', 'lt', 'lt-LT', 'luo', 'luo-KE', 'luy', 'luy-KE', 'lv', 'lv-LV', 'mag-IN', 'mai-IN', 'mas', 'mas-KE', 'mas-TZ', 'mer', 'mer-KE', 'mfe', 'mfe-MU', 'mg', 'mg-MG', 'mhr-RU', 'mi-NZ', 'mk', 'mk-MK', 'ml', 'ml-IN', 'mn-MN', 'mr', 'mr-IN', 'ms', 'ms-BN', 'ms-MY', 'mt', 'mt-MT', 'my', 'my-MM', 'nan-TW', 'naq', 'naq-NA', 'nb', 'nb-NO', 'nd', 'nd-ZW', 'nds-DE', 'nds-NL', 'ne', 'ne-IN', 'ne-NP', 'nl', 'nl-AW', 'nl-BE', 'nl-NL', 'nn', 'nn-NO', 'nr-ZA', 'nso-ZA', 'nyn', 'nyn-UG', 'oc-FR', 'om', 'om-ET', 'om-KE', 'or', 'or-IN', 'os-RU', 'pa', 'pa-Arab', 'pa-Arab-PK', 'pa-Guru', 'pa-Guru-IN', 'pa-IN', 'pa-PK', 'pap-AN', 'pl', 'pl-PL', 'ps', 'ps-AF', 'pt', 'pt-BR', 'pt-GW', 'pt-MZ', 'pt-PT', 'rm', 'rm-CH', 'ro', 'ro-MD', 'ro-RO', 'rof', 'rof-TZ', 'ru', 'ru-MD', 'ru-RU', 'ru-UA', 'rw', 'rw-RW', 'rwk', 'rwk-TZ', 'sa-IN', 'saq', 'saq-KE', 'sc-IT', 'sd-IN', 'se-NO', 'seh', 'seh-MZ', 'ses', 'ses-ML', 'sg', 'sg-CF', 'shi', 'shi-Latn', 'shi-Latn-MA', 'shi-Tfng', 'shi-Tfng-MA', 'shs-CA', 'si', 'si-LK', 'sid-ET', 'sk', 'sk-SK', 'sl', 'sl-SI', 'sn', 'sn-ZW', 'so', 'so-DJ', 'so-ET', 'so-KE', 'so-SO', 'sq', 'sq-AL', 'sq-MK', 'sr', 'sr-Cyrl', 'sr-Cyrl-BA', 'sr-Cyrl-ME', 'sr-Cyrl-RS', 'sr-Latn', 'sr-Latn-BA', 'sr-Latn-ME', 'sr-Latn-RS', 'sr-ME', 'sr-RS', 'ss-ZA', 'st-ZA', 'sv', 'sv-FI', 'sv-SE', 'sw', 'sw-KE', 'sw-TZ', 'ta', 'ta-IN', 'ta-LK', 'te', 'te-IN', 'teo', 'teo-KE', 'teo-UG', 'tg-TJ', 'th', 'th-TH', 'ti', 'ti-ER', 'ti-ET', 'tig-ER', 'tk-TM', 'tl-PH', 'tn-ZA', 'to', 'to-TO', 'tr', 'tr-CY', 'tr-TR', 'ts-ZA', 'tt-RU', 'tzm', 'tzm-Latn', 'tzm-Latn-MA', 'ug-CN', 'uk', 'uk-UA', 'unm-US', 'ur', 'ur-IN', 'ur-PK', 'uz', 'uz-Arab', 'uz-Arab-AF', 'uz-Cyrl', 'uz-Cyrl-UZ', 'uz-Latn', 'uz-Latn-UZ', 'uz-UZ', 've-ZA', 'vi', 'vi-VN', 'vun', 'vun-TZ', 'wa-BE', 'wae-CH', 'wal-ET', 'wo-SN', 'xh-ZA', 'xog', 'xog-UG', 'yi-US', 'yo', 'yo-NG', 'yue-HK', 'zh', 'zh-CN', 'zh-HK', 'zh-Hans', 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hant', 'zh-Hant-HK', 'zh-Hant-MO', 'zh-Hant-TW', 'zh-SG', 'zh-TW', 'zu', 'zu-ZA', 'auto')") + return value + + @field_validator('markdown_backend') + def markdown_backend_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['full_page', 'main_content']): + raise ValueError("must be one of enum values ('full_page', 'main_content')") + return value + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']): + raise ValueError("must be one of enum values ('GET', 'POST', 'PUT', 'PATCH', 'DELETE')") + return value + + @field_validator('os') + def os_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['windows', 'mac os', 'linux', 'android', 'ios']): + raise ValueError("must be one of enum values ('windows', 'mac os', 'linux', 'android', 'ios')") + return value + + @field_validator('referrer_type') + def referrer_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram']): + raise ValueError("must be one of enum values ('random', 'no-referer', 'same-origin', 'google', 'bing', 'facebook', 'twitter', 'instagram')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY']): + raise ValueError("must be one of enum values ('AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'VI', 'WA', 'WV', 'WI', 'WY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmitAsyncExtractRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of browser + if self.browser: + _dict['browser'] = self.browser.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in browser_actions (list) + _items = [] + if self.browser_actions: + for _item_browser_actions in self.browser_actions: + _items.append(_item_browser_actions.to_dict() if _item_browser_actions is not None else None) + _dict['browser_actions'] = _items + # override the default output from pydantic by calling `to_dict()` of cookies + if self.cookies: + _dict['cookies'] = self.cookies.to_dict() + # override the default output from pydantic by calling `to_dict()` of file_parsing_options + if self.file_parsing_options: + _dict['file_parsing_options'] = self.file_parsing_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of each value in headers (dict) + _field_dict = {} + if self.headers: + for _key_headers in self.headers: + _field_dict[_key_headers] = self.headers[_key_headers].to_dict() if self.headers[_key_headers] is not None else None + _dict['headers'] = _field_dict + # override the default output from pydantic by calling `to_dict()` of each item in network_capture (list) + _items = [] + if self.network_capture: + for _item_network_capture in self.network_capture: + _items.append(_item_network_capture.to_dict() if _item_network_capture is not None else None) + _dict['network_capture'] = _items + # override the default output from pydantic by calling `to_dict()` of parser + if self.parser: + _dict['parser'] = self.parser.to_dict() + # override the default output from pydantic by calling `to_dict()` of render + if self.render: + _dict['render'] = self.render.to_dict() + # override the default output from pydantic by calling `to_dict()` of session + if self.session: + _dict['session'] = self.session.to_dict() + # override the default output from pydantic by calling `to_dict()` of skill + if self.skill: + _dict['skill'] = self.skill.to_dict() + # set to None if body (nullable) is None + # and model_fields_set contains the field + if self.body is None and "body" in self.model_fields_set: + _dict['body'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmitAsyncExtractRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auto_driver_configuration": obj.get("auto_driver_configuration"), + "body": obj.get("body"), + "browser": CrawlPayloadExtractOptionsBrowser.from_dict(obj["browser"]) if obj.get("browser") is not None else None, + "browser_actions": [BrowserAction.from_dict(_item) for _item in obj["browser_actions"]] if obj.get("browser_actions") is not None else None, + "city": obj.get("city"), + "consent_header": obj.get("consent_header"), + "cookies": CrawlPayloadExtractOptionsCookies.from_dict(obj["cookies"]) if obj.get("cookies") is not None else None, + "country": obj.get("country") if obj.get("country") is not None else 'ALL', + "device": obj.get("device") if obj.get("device") is not None else 'desktop', + "driver": obj.get("driver"), + "expected_status_codes": obj.get("expected_status_codes"), + "file_parsing_options": CrawlPayloadExtractOptionsFileParsingOptions.from_dict(obj["file_parsing_options"]) if obj.get("file_parsing_options") is not None else None, + "formats": obj.get("formats"), + "headers": dict( + (_k, CrawlPayloadExtractOptionsHeadersValue.from_dict(_v)) + for _k, _v in obj["headers"].items() + ) + if obj.get("headers") is not None + else None, + "http2": obj.get("http2") if obj.get("http2") is not None else False, + "is_xhr": obj.get("is_xhr") if obj.get("is_xhr") is not None else False, + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', + "markdown_backend": obj.get("markdown_backend") if obj.get("markdown_backend") is not None else 'full_page', + "method": obj.get("method") if obj.get("method") is not None else 'GET', + "network_capture": [CrawlPayloadExtractOptionsNetworkCaptureInner.from_dict(_item) for _item in obj["network_capture"]] if obj.get("network_capture") is not None else None, + "os": obj.get("os"), + "parse": obj.get("parse") if obj.get("parse") is not None else False, + "parser": CrawlPayloadExtractOptionsParser.from_dict(obj["parser"]) if obj.get("parser") is not None else None, + "realtime_total_timeout": obj.get("realtime_total_timeout"), + "referrer_type": obj.get("referrer_type"), + "render": CrawlPayloadExtractOptionsRender.from_dict(obj["render"]) if obj.get("render") is not None else None, + "request_timeout": obj.get("request_timeout"), + "session": CrawlPayloadExtractOptionsSession.from_dict(obj["session"]) if obj.get("session") is not None else None, + "skill": CrawlPayloadExtractOptionsSkill.from_dict(obj["skill"]) if obj.get("skill") is not None else None, + "state": obj.get("state"), + "tag": obj.get("tag"), + "url": obj.get("url"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/submit_async_serp_request.py b/candidate/generated/nimble_client/models/submit_async_serp_request.py new file mode 100644 index 0000000..afdab2b --- /dev/null +++ b/candidate/generated/nimble_client/models/submit_async_serp_request.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SubmitAsyncSerpRequest(BaseModel): + """ + SubmitAsyncSerpRequest + """ # noqa: E501 + country: Optional[StrictStr] = Field(default=None, description="ISO Alpha-2 country code used to access the target search engine (e.g. US, DE, GB).") + device: Optional[StrictStr] = Field(default=None, description="Device type used for the search request.") + domain: Optional[StrictStr] = Field(default='com', description="Top-level domain for the search engine (e.g. \"com\", \"co.uk\", \"de\").") + locale: Optional[StrictStr] = Field(default=None, description="Locale used for the search request.") + location: Optional[StrictStr] = Field(default=None, description="Geo-location for the search (canonical Google location name).") + num_results: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = Field(default=None, description="Number of results to return (1–100).") + page: Optional[Annotated[int, Field(le=9007199254740991, strict=True, ge=1)]] = Field(default=None, description="The result page number for pagination.") + parse: Optional[StrictBool] = Field(default=True, description="When true, the SERP response is parsed into structured JSON.") + query: Optional[StrictStr] = Field(default=None, description="The search keyword or phrase to query.") + render: Optional[StrictBool] = Field(default=False, description="Whether to render the page in a browser before extracting.") + resolve_url: Optional[StrictBool] = Field(default=None, description="When true, search result links that point at a search-engine redirector are resolved to their final destination URLs. Best-effort within a time budget: links that cannot be resolved in time are returned unchanged.") + search_engine: StrictStr = Field(description="The search engine to query.") + show_hidden_results: Optional[StrictBool] = Field(default=None, description="When true, disables Google result filtering (filter=0) so omitted/duplicate and highly similar pages are also returned. Applies to Google search engines.") + zdr: Optional[StrictBool] = Field(default=None, description="Redact retained customer input. Async and batch require customer storage_url; execution context expires after the configured retention period.") + callback_url: Optional[StrictStr] = Field(default=None, description="URL to call back when async operation completes") + storage_compress: Optional[StrictBool] = Field(default=None, description="Whether to compress stored data") + storage_object_name: Optional[StrictStr] = Field(default=None, description="Custom name for the stored object") + storage_type: Optional[StrictStr] = Field(default=None, description="Type of storage to use for results") + storage_url: Optional[StrictStr] = Field(default=None, description="URL for storage location") + __properties: ClassVar[List[str]] = ["country", "device", "domain", "locale", "location", "num_results", "page", "parse", "query", "render", "resolve_url", "search_engine", "show_hidden_results", "zdr", "callback_url", "storage_compress", "storage_object_name", "storage_type", "storage_url"] + + @field_validator('device') + def device_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['desktop', 'mobile']): + raise ValueError("must be one of enum values ('desktop', 'mobile')") + return value + + @field_validator('search_engine') + def search_engine_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search']): + raise ValueError("must be one of enum values ('google_search', 'google_sge', 'google_aio', 'google_maps_search', 'google_maps_reviews', 'google_maps_place', 'google_news', 'google_images', 'bing_search', 'yandex_search')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmitAsyncSerpRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmitAsyncSerpRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "device": obj.get("device"), + "domain": obj.get("domain") if obj.get("domain") is not None else 'com', + "locale": obj.get("locale"), + "location": obj.get("location"), + "num_results": obj.get("num_results"), + "page": obj.get("page"), + "parse": obj.get("parse") if obj.get("parse") is not None else True, + "query": obj.get("query"), + "render": obj.get("render") if obj.get("render") is not None else False, + "resolve_url": obj.get("resolve_url"), + "search_engine": obj.get("search_engine"), + "show_hidden_results": obj.get("show_hidden_results"), + "zdr": obj.get("zdr"), + "callback_url": obj.get("callback_url"), + "storage_compress": obj.get("storage_compress"), + "storage_object_name": obj.get("storage_object_name"), + "storage_type": obj.get("storage_type"), + "storage_url": obj.get("storage_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_error_response.py b/candidate/generated/nimble_client/models/task_error_response.py new file mode 100644 index 0000000..4287010 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_error_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskErrorResponse(BaseModel): + """ + Error response for task operations. + """ # noqa: E501 + error: StrictStr = Field(description="Error message describing what went wrong.") + status: StrictStr = Field(description="Status indicating the request failed.") + __properties: ClassVar[List[str]] = ["error", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['failed']): + raise ValueError("must be one of enum values ('failed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_failed_response.py b/candidate/generated/nimble_client/models/task_failed_response.py new file mode 100644 index 0000000..0192b3d --- /dev/null +++ b/candidate/generated/nimble_client/models/task_failed_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from nimble_client.models.task_failed_response_task import TaskFailedResponseTask +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskFailedResponse(BaseModel): + """ + Response when task execution failed. + """ # noqa: E501 + error: StrictStr = Field(description="Error message.") + status: StrictStr = Field(description="Status indicating the task failed.") + task: TaskFailedResponseTask + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["error", "status", "task"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['failed']): + raise ValueError("must be one of enum values ('failed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskFailedResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of task + if self.task: + _dict['task'] = self.task.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskFailedResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "status": obj.get("status"), + "task": TaskFailedResponseTask.from_dict(obj["task"]) if obj.get("task") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_failed_response_task.py b/candidate/generated/nimble_client/models/task_failed_response_task.py new file mode 100644 index 0000000..acd3050 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_failed_response_task.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskFailedResponseTask(BaseModel): + """ + The failed task details. + """ # noqa: E501 + query: Optional[Any] = Field(alias="_query") + account_name: Optional[StrictStr] = Field(default=None, description="Account name that owns the task.") + api_type: Optional[StrictStr] = None + batch_id: Optional[StrictStr] = Field(default=None, description="Batch ID if this task is part of a batch.") + created_at: StrictStr = Field(description="Timestamp when the task was created.") + download_url: Optional[StrictStr] = Field(default=None, description="URL for downloading the task results.") + error: Optional[StrictStr] = Field(default=None, description="Error message if the task failed.") + error_type: Optional[StrictStr] = Field(default=None, description="Classification of the error type.") + id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Unique task identifier.") + input: Optional[Any] = Field(description="Original input data for the task.") + modified_at: Optional[StrictStr] = Field(default=None, description="Timestamp when the task was last modified.") + output_url: Optional[StrictStr] = Field(default=None, description="Storage location of the output data.") + queue: Optional[StrictStr] = Field(default=None, description="Queue name the task was submitted to.") + state: StrictStr = Field(description="Current state of the task.") + status_code: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="HTTP status code from the task execution.") + status_url: StrictStr = Field(description="URL for checking the task status.") + __properties: ClassVar[List[str]] = ["_query", "account_name", "api_type", "batch_id", "created_at", "download_url", "error", "error_type", "id", "input", "modified_at", "output_url", "queue", "state", "status_code", "status_url"] + + @field_validator('api_type') + def api_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs']): + raise ValueError("must be one of enum values ('web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'queued', 'in_progress', 'success', 'error']): + raise ValueError("must be one of enum values ('pending', 'queued', 'in_progress', 'success', 'error')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskFailedResponseTask from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if query (nullable) is None + # and model_fields_set contains the field + if self.query is None and "query" in self.model_fields_set: + _dict['_query'] = None + + # set to None if batch_id (nullable) is None + # and model_fields_set contains the field + if self.batch_id is None and "batch_id" in self.model_fields_set: + _dict['batch_id'] = None + + # set to None if download_url (nullable) is None + # and model_fields_set contains the field + if self.download_url is None and "download_url" in self.model_fields_set: + _dict['download_url'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if error_type (nullable) is None + # and model_fields_set contains the field + if self.error_type is None and "error_type" in self.model_fields_set: + _dict['error_type'] = None + + # set to None if input (nullable) is None + # and model_fields_set contains the field + if self.input is None and "input" in self.model_fields_set: + _dict['input'] = None + + # set to None if output_url (nullable) is None + # and model_fields_set contains the field + if self.output_url is None and "output_url" in self.model_fields_set: + _dict['output_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskFailedResponseTask from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_query": obj.get("_query"), + "account_name": obj.get("account_name"), + "api_type": obj.get("api_type"), + "batch_id": obj.get("batch_id"), + "created_at": obj.get("created_at"), + "download_url": obj.get("download_url"), + "error": obj.get("error"), + "error_type": obj.get("error_type"), + "id": obj.get("id"), + "input": obj.get("input"), + "modified_at": obj.get("modified_at"), + "output_url": obj.get("output_url"), + "queue": obj.get("queue"), + "state": obj.get("state"), + "status_code": obj.get("status_code"), + "status_url": obj.get("status_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_list_response.py b/candidate/generated/nimble_client/models/task_list_response.py new file mode 100644 index 0000000..4c4b8fc --- /dev/null +++ b/candidate/generated/nimble_client/models/task_list_response.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from nimble_client.models.extract_batch_response_tasks_inner import ExtractBatchResponseTasksInner +from nimble_client.models.task_list_response_pagination import TaskListResponsePagination +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskListResponse(BaseModel): + """ + Paginated list of tasks response. + """ # noqa: E501 + data: List[ExtractBatchResponseTasksInner] = Field(description="Array of task objects.") + pagination: TaskListResponsePagination + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data", "pagination"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + _items.append(_item_data.to_dict() if _item_data is not None else None) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [ExtractBatchResponseTasksInner.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "pagination": TaskListResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_list_response_pagination.py b/candidate/generated/nimble_client/models/task_list_response_pagination.py new file mode 100644 index 0000000..6cfed0c --- /dev/null +++ b/candidate/generated/nimble_client/models/task_list_response_pagination.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskListResponsePagination(BaseModel): + """ + TaskListResponsePagination + """ # noqa: E501 + has_next: StrictBool = Field(description="Whether there are more tasks available.") + next_cursor: Optional[StrictStr] = Field(description="Cursor to use for fetching the next page.") + total: Union[StrictFloat, StrictInt] = Field(description="Total number of tasks.") + __properties: ClassVar[List[str]] = ["has_next", "next_cursor", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskListResponsePagination from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if next_cursor (nullable) is None + # and model_fields_set contains the field + if self.next_cursor is None and "next_cursor" in self.model_fields_set: + _dict['next_cursor'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskListResponsePagination from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "has_next": obj.get("has_next"), + "next_cursor": obj.get("next_cursor"), + "total": obj.get("total") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_not_found_error_response.py b/candidate/generated/nimble_client/models/task_not_found_error_response.py new file mode 100644 index 0000000..63cca99 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_not_found_error_response.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskNotFoundErrorResponse(BaseModel): + """ + Error response when the specified task is not found. + """ # noqa: E501 + error: StrictStr = Field(description="Error message indicating the task was not found.") + status: StrictStr = Field(description="Status indicating the request failed.") + __properties: ClassVar[List[str]] = ["error", "status"] + + @field_validator('error') + def error_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['task not found']): + raise ValueError("must be one of enum values ('task not found')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['failed']): + raise ValueError("must be one of enum values ('failed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskNotFoundErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskNotFoundErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_pending_response.py b/candidate/generated/nimble_client/models/task_pending_response.py new file mode 100644 index 0000000..dcc1b98 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_pending_response.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskPendingResponse(BaseModel): + """ + Response when task is still pending. + """ # noqa: E501 + error: StrictStr = Field(description="Error message indicating task is not finished yet.") + status: StrictStr = Field(description="Status indicating the task is still pending.") + __properties: ClassVar[List[str]] = ["error", "status"] + + @field_validator('error') + def error_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['task not finished yet']): + raise ValueError("must be one of enum values ('task not finished yet')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['failed']): + raise ValueError("must be one of enum values ('failed')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskPendingResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskPendingResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_progress.py b/candidate/generated/nimble_client/models/task_progress.py new file mode 100644 index 0000000..984f7cc --- /dev/null +++ b/candidate/generated/nimble_client/models/task_progress.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskProgress(BaseModel): + """ + Approximate progress of a running (in_progress) task. + """ # noqa: E501 + bytes_done: Annotated[int, Field(le=9007199254740991, strict=True, ge=0)] = Field(description="Bytes of the output written so far.") + bytes_total: Optional[Annotated[int, Field(le=9007199254740991, strict=True, gt=0)]] = Field(default=None, description="Expected size in bytes, often an estimate; omitted when unknown.") + percent: Optional[Annotated[int, Field(le=99, strict=True, ge=0)]] = Field(default=None, description="floor(100 * bytes_done / bytes_total), capped at 99 until the task succeeds; omitted when bytes_total is unknown. Approximate.") + updated_at: StrictStr = Field(description="When this progress was measured (ISO 8601).") + __properties: ClassVar[List[str]] = ["bytes_done", "bytes_total", "percent", "updated_at"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskProgress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskProgress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bytes_done": obj.get("bytes_done"), + "bytes_total": obj.get("bytes_total"), + "percent": obj.get("percent"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_response_schema.py b/candidate/generated/nimble_client/models/task_response_schema.py new file mode 100644 index 0000000..b3155a3 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_response_schema.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.task_response_schema_task import TaskResponseSchemaTask +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskResponseSchema(BaseModel): + """ + Response containing task details. + """ # noqa: E501 + task: TaskResponseSchemaTask + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["task"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskResponseSchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of task + if self.task: + _dict['task'] = self.task.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskResponseSchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "task": TaskResponseSchemaTask.from_dict(obj["task"]) if obj.get("task") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_response_schema_task.py b/candidate/generated/nimble_client/models/task_response_schema_task.py new file mode 100644 index 0000000..c1de73c --- /dev/null +++ b/candidate/generated/nimble_client/models/task_response_schema_task.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.task_progress import TaskProgress +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskResponseSchemaTask(BaseModel): + """ + TaskResponseSchemaTask + """ # noqa: E501 + query: Optional[Any] = Field(alias="_query") + account_name: Optional[StrictStr] = Field(default=None, description="Account name that owns the task.") + api_type: Optional[StrictStr] = None + batch_id: Optional[StrictStr] = Field(default=None, description="Batch ID if this task is part of a batch.") + created_at: StrictStr = Field(description="Timestamp when the task was created.") + download_url: Optional[StrictStr] = Field(default=None, description="URL for downloading the task results.") + error: Optional[StrictStr] = Field(default=None, description="Error message if the task failed.") + error_type: Optional[StrictStr] = Field(default=None, description="Classification of the error type.") + id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Unique task identifier.") + input: Optional[Any] = Field(description="Original input data for the task.") + modified_at: Optional[StrictStr] = Field(default=None, description="Timestamp when the task was last modified.") + output_url: Optional[StrictStr] = Field(default=None, description="Storage location of the output data.") + progress: Optional[TaskProgress] = Field(default=None, description="Approximate progress, present only while the task is in_progress and the job reports it (media downloads with media_extractor).") + queue: Optional[StrictStr] = Field(default=None, description="Queue name the task was submitted to.") + state: StrictStr = Field(description="Current state of the task.") + status_code: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="HTTP status code from the task execution.") + status_url: StrictStr = Field(description="URL for checking the task status.") + __properties: ClassVar[List[str]] = ["_query", "account_name", "api_type", "batch_id", "created_at", "download_url", "error", "error_type", "id", "input", "modified_at", "output_url", "progress", "queue", "state", "status_code", "status_url"] + + @field_validator('api_type') + def api_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs']): + raise ValueError("must be one of enum values ('web', 'serp', 'ecommerce', 'social', 'media', 'agent', 'extract', 'fast-serp', 'labs')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'queued', 'in_progress', 'success', 'error']): + raise ValueError("must be one of enum values ('pending', 'queued', 'in_progress', 'success', 'error')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskResponseSchemaTask from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of progress + if self.progress: + _dict['progress'] = self.progress.to_dict() + # set to None if query (nullable) is None + # and model_fields_set contains the field + if self.query is None and "query" in self.model_fields_set: + _dict['_query'] = None + + # set to None if batch_id (nullable) is None + # and model_fields_set contains the field + if self.batch_id is None and "batch_id" in self.model_fields_set: + _dict['batch_id'] = None + + # set to None if download_url (nullable) is None + # and model_fields_set contains the field + if self.download_url is None and "download_url" in self.model_fields_set: + _dict['download_url'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if error_type (nullable) is None + # and model_fields_set contains the field + if self.error_type is None and "error_type" in self.model_fields_set: + _dict['error_type'] = None + + # set to None if input (nullable) is None + # and model_fields_set contains the field + if self.input is None and "input" in self.model_fields_set: + _dict['input'] = None + + # set to None if output_url (nullable) is None + # and model_fields_set contains the field + if self.output_url is None and "output_url" in self.model_fields_set: + _dict['output_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskResponseSchemaTask from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_query": obj.get("_query"), + "account_name": obj.get("account_name"), + "api_type": obj.get("api_type"), + "batch_id": obj.get("batch_id"), + "created_at": obj.get("created_at"), + "download_url": obj.get("download_url"), + "error": obj.get("error"), + "error_type": obj.get("error_type"), + "id": obj.get("id"), + "input": obj.get("input"), + "modified_at": obj.get("modified_at"), + "output_url": obj.get("output_url"), + "progress": TaskProgress.from_dict(obj["progress"]) if obj.get("progress") is not None else None, + "queue": obj.get("queue"), + "state": obj.get("state"), + "status_code": obj.get("status_code"), + "status_url": obj.get("status_url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_error_public_v1.py b/candidate/generated/nimble_client/models/task_run_error_public_v1.py new file mode 100644 index 0000000..bab177d --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_error_public_v1.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunErrorPublicV1(BaseModel): + """ + TaskRunErrorPublicV1 + """ # noqa: E501 + message: StrictStr = Field(description="Human-readable error description.") + ref_id: StrictStr = Field(description="Reference ID (equals the run id).") + __properties: ClassVar[List[str]] = ["message", "ref_id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunErrorPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunErrorPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message"), + "ref_id": obj.get("ref_id") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_error_public_v2.py b/candidate/generated/nimble_client/models/task_run_error_public_v2.py new file mode 100644 index 0000000..085adf3 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_error_public_v2.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunErrorPublicV2(BaseModel): + """ + TaskRunErrorPublicV2 + """ # noqa: E501 + message: StrictStr = Field(description="Human-readable error description.") + ref_id: StrictStr = Field(description="Reference ID (equals the run id).") + __properties: ClassVar[List[str]] = ["message", "ref_id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunErrorPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunErrorPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "message": obj.get("message"), + "ref_id": obj.get("ref_id") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_failed_result_public_v1.py b/candidate/generated/nimble_client/models/task_run_failed_result_public_v1.py new file mode 100644 index 0000000..bc24ab5 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_failed_result_public_v1.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from nimble_client.models.task_run_error_public_v1 import TaskRunErrorPublicV1 +from nimble_client.models.task_run_response_public_v1 import TaskRunResponsePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunFailedResultPublicV1(BaseModel): + """ + TaskRunFailedResultPublicV1 + """ # noqa: E501 + error: TaskRunErrorPublicV1 = Field(description="Structured error detail.") + run: TaskRunResponsePublicV1 = Field(description="Task run object with status 'failed'.") + __properties: ClassVar[List[str]] = ["error", "run"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunFailedResultPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of error + if self.error: + _dict['error'] = self.error.to_dict() + # override the default output from pydantic by calling `to_dict()` of run + if self.run: + _dict['run'] = self.run.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunFailedResultPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": TaskRunErrorPublicV1.from_dict(obj["error"]) if obj.get("error") is not None else None, + "run": TaskRunResponsePublicV1.from_dict(obj["run"]) if obj.get("run") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_failed_result_public_v2.py b/candidate/generated/nimble_client/models/task_run_failed_result_public_v2.py new file mode 100644 index 0000000..746cbf9 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_failed_result_public_v2.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from nimble_client.models.task_run_error_public_v2 import TaskRunErrorPublicV2 +from nimble_client.models.task_run_response_public_v2 import TaskRunResponsePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunFailedResultPublicV2(BaseModel): + """ + TaskRunFailedResultPublicV2 + """ # noqa: E501 + error: TaskRunErrorPublicV2 = Field(description="Structured error detail.") + run: TaskRunResponsePublicV2 = Field(description="Task run object with status 'failed'.") + __properties: ClassVar[List[str]] = ["error", "run"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunFailedResultPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of error + if self.error: + _dict['error'] = self.error.to_dict() + # override the default output from pydantic by calling `to_dict()` of run + if self.run: + _dict['run'] = self.run.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunFailedResultPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": TaskRunErrorPublicV2.from_dict(obj["error"]) if obj.get("error") is not None else None, + "run": TaskRunResponsePublicV2.from_dict(obj["run"]) if obj.get("run") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_json_output_public_v1.py b/candidate/generated/nimble_client/models/task_run_json_output_public_v1.py new file mode 100644 index 0000000..090a25c --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_json_output_public_v1.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.content import Content +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from nimble_client.models.json_run_trust import JsonRunTrust +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunJsonOutputPublicV1(BaseModel): + """ + TaskRunJsonOutputPublicV1 + """ # noqa: E501 + content: Content + sources: Optional[List[GatewayDef3a5c7c6bfa027c89TaskRunOutputSource]] = Field(default=None, description="Sources the output cites, deduplicated by URL in citation order. Always present, including when trust is off (`trust: null`).") + trust: Optional[JsonRunTrust] = Field(description="Trust and citation metadata for the output.") + type: Optional[StrictStr] = Field(default='json', description="Output content type.") + __properties: ClassVar[List[str]] = ["content", "sources", "trust", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['json']): + raise ValueError("must be one of enum values ('json')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunJsonOutputPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict['content'] = self.content.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of trust + if self.trust: + _dict['trust'] = self.trust.to_dict() + # set to None if trust (nullable) is None + # and model_fields_set contains the field + if self.trust is None and "trust" in self.model_fields_set: + _dict['trust'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunJsonOutputPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": Content.from_dict(obj["content"]) if obj.get("content") is not None else None, + "sources": [GatewayDef3a5c7c6bfa027c89TaskRunOutputSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "trust": JsonRunTrust.from_dict(obj["trust"]) if obj.get("trust") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'json' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_json_output_public_v2.py b/candidate/generated/nimble_client/models/task_run_json_output_public_v2.py new file mode 100644 index 0000000..9557abb --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_json_output_public_v2.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.content import Content +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from nimble_client.models.json_run_trust import JsonRunTrust +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunJsonOutputPublicV2(BaseModel): + """ + TaskRunJsonOutputPublicV2 + """ # noqa: E501 + content: Content + sources: Optional[List[GatewayDef3a5c7c6bfa027c89TaskRunOutputSource]] = Field(default=None, description="Sources the output cites, deduplicated by URL in citation order. Always present, including when trust is off (`trust: null`).") + trust: Optional[JsonRunTrust] = Field(description="Trust and citation metadata for the output.") + type: Optional[StrictStr] = Field(default='json', description="Output content type.") + __properties: ClassVar[List[str]] = ["content", "sources", "trust", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['json']): + raise ValueError("must be one of enum values ('json')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunJsonOutputPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict['content'] = self.content.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of trust + if self.trust: + _dict['trust'] = self.trust.to_dict() + # set to None if trust (nullable) is None + # and model_fields_set contains the field + if self.trust is None and "trust" in self.model_fields_set: + _dict['trust'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunJsonOutputPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": Content.from_dict(obj["content"]) if obj.get("content") is not None else None, + "sources": [GatewayDef3a5c7c6bfa027c89TaskRunOutputSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "trust": JsonRunTrust.from_dict(obj["trust"]) if obj.get("trust") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'json' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_response_public_v1.py b/candidate/generated/nimble_client/models/task_run_response_public_v1.py new file mode 100644 index 0000000..85fafc5 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_response_public_v1.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.effort import Effort +from nimble_client.models.gateway_def6651fbad4f19182d_task_run_status_value import GatewayDef6651fbad4f19182dTaskRunStatusValue +from nimble_client.models.task_run_error_public_v1 import TaskRunErrorPublicV1 +from nimble_client.models.trust_mode import TrustMode +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunResponsePublicV1(BaseModel): + """ + TaskRunResponsePublicV1 + """ # noqa: E501 + completed_at: Optional[datetime] = Field(default=None, description="When the run completed.") + created_at: datetime = Field(description="When the run was created.") + effort: Effort = Field(description="Effort level used for the run.") + error: Optional[TaskRunErrorPublicV1] = Field(default=None, description="Error details when the run failed.") + id: StrictStr = Field(description="Run identifier, format \"task_run_{uuid}\".") + interaction_id: StrictStr = Field(description="Interaction ID.") + is_active: StrictBool = Field(description="True while status is 'queued' or 'running'.") + prompt: Optional[StrictStr] = Field(default=None, description="Prompt submitted for the run.") + started_at: Optional[datetime] = Field(default=None, description="When the run started executing.") + status: GatewayDef6651fbad4f19182dTaskRunStatusValue = Field(description="Current run status.") + trust_mode: Optional[TrustMode] = Field(default=None, description="Trust mode this run resolved to: the request's trust_mode, else the agent's, else no_trust. no_trust runs return `output.trust: null`. Null for runs created before trust_mode existed, which ran with trust.") + web_search_agent_id: StrictStr = Field(description="Web Search Agent instance this run belongs to.") + __properties: ClassVar[List[str]] = ["completed_at", "created_at", "effort", "error", "id", "interaction_id", "is_active", "prompt", "started_at", "status", "trust_mode", "web_search_agent_id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of error + if self.error: + _dict['error'] = self.error.to_dict() + # set to None if completed_at (nullable) is None + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: + _dict['completed_at'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if prompt (nullable) is None + # and model_fields_set contains the field + if self.prompt is None and "prompt" in self.model_fields_set: + _dict['prompt'] = None + + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict['started_at'] = None + + # set to None if trust_mode (nullable) is None + # and model_fields_set contains the field + if self.trust_mode is None and "trust_mode" in self.model_fields_set: + _dict['trust_mode'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "completed_at": obj.get("completed_at"), + "created_at": obj.get("created_at"), + "effort": obj.get("effort"), + "error": TaskRunErrorPublicV1.from_dict(obj["error"]) if obj.get("error") is not None else None, + "id": obj.get("id"), + "interaction_id": obj.get("interaction_id"), + "is_active": obj.get("is_active"), + "prompt": obj.get("prompt"), + "started_at": obj.get("started_at"), + "status": obj.get("status"), + "trust_mode": obj.get("trust_mode"), + "web_search_agent_id": obj.get("web_search_agent_id") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_response_public_v2.py b/candidate/generated/nimble_client/models/task_run_response_public_v2.py new file mode 100644 index 0000000..62dc9a0 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_response_public_v2.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.effort import Effort +from nimble_client.models.gateway_def6651fbad4f19182d_task_run_status_value import GatewayDef6651fbad4f19182dTaskRunStatusValue +from nimble_client.models.task_run_error_public_v2 import TaskRunErrorPublicV2 +from nimble_client.models.trust_mode import TrustMode +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunResponsePublicV2(BaseModel): + """ + TaskRunResponsePublicV2 + """ # noqa: E501 + completed_at: Optional[datetime] = Field(default=None, description="When the run completed.") + created_at: datetime = Field(description="When the run was created.") + effort: Effort = Field(description="Effort level used for the run.") + error: Optional[TaskRunErrorPublicV2] = Field(default=None, description="Error details when the run failed.") + id: StrictStr = Field(description="Run identifier, format \"task_run_{uuid}\".") + interaction_id: StrictStr = Field(description="Interaction ID.") + is_active: StrictBool = Field(description="True while status is 'queued' or 'running'.") + prompt: Optional[StrictStr] = Field(default=None, description="Prompt submitted for the run.") + started_at: Optional[datetime] = Field(default=None, description="When the run started executing.") + status: GatewayDef6651fbad4f19182dTaskRunStatusValue = Field(description="Current run status.") + trust_mode: Optional[TrustMode] = Field(default=None, description="Trust mode this run resolved to: the request's trust_mode, else the agent's, else no_trust. no_trust runs return `output.trust: null`. Null for runs created before trust_mode existed, which ran with trust.") + web_search_agent_id: StrictStr = Field(description="Web Search Agent instance this run belongs to.") + __properties: ClassVar[List[str]] = ["completed_at", "created_at", "effort", "error", "id", "interaction_id", "is_active", "prompt", "started_at", "status", "trust_mode", "web_search_agent_id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of error + if self.error: + _dict['error'] = self.error.to_dict() + # set to None if completed_at (nullable) is None + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: + _dict['completed_at'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if prompt (nullable) is None + # and model_fields_set contains the field + if self.prompt is None and "prompt" in self.model_fields_set: + _dict['prompt'] = None + + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict['started_at'] = None + + # set to None if trust_mode (nullable) is None + # and model_fields_set contains the field + if self.trust_mode is None and "trust_mode" in self.model_fields_set: + _dict['trust_mode'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "completed_at": obj.get("completed_at"), + "created_at": obj.get("created_at"), + "effort": obj.get("effort"), + "error": TaskRunErrorPublicV2.from_dict(obj["error"]) if obj.get("error") is not None else None, + "id": obj.get("id"), + "interaction_id": obj.get("interaction_id"), + "is_active": obj.get("is_active"), + "prompt": obj.get("prompt"), + "started_at": obj.get("started_at"), + "status": obj.get("status"), + "trust_mode": obj.get("trust_mode"), + "web_search_agent_id": obj.get("web_search_agent_id") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_result_public_v1.py b/candidate/generated/nimble_client/models/task_run_result_public_v1.py new file mode 100644 index 0000000..81bb324 --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_result_public_v1.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from nimble_client.models.output2 import Output2 +from nimble_client.models.task_run_response_public_v1 import TaskRunResponsePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunResultPublicV1(BaseModel): + """ + TaskRunResultPublicV1 + """ # noqa: E501 + output: Output2 + run: TaskRunResponsePublicV1 = Field(description="Task run object with status 'completed'.") + __properties: ClassVar[List[str]] = ["output", "run"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunResultPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of output + if self.output: + _dict['output'] = self.output.to_dict() + # override the default output from pydantic by calling `to_dict()` of run + if self.run: + _dict['run'] = self.run.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunResultPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "output": Output2.from_dict(obj["output"]) if obj.get("output") is not None else None, + "run": TaskRunResponsePublicV1.from_dict(obj["run"]) if obj.get("run") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_result_public_v2.py b/candidate/generated/nimble_client/models/task_run_result_public_v2.py new file mode 100644 index 0000000..71ab0bb --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_result_public_v2.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.output3 import Output3 +from nimble_client.models.run_stats_public_v2 import RunStatsPublicV2 +from nimble_client.models.task_run_response_public_v2 import TaskRunResponsePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunResultPublicV2(BaseModel): + """ + TaskRunResultPublicV2 + """ # noqa: E501 + output: Output3 + run: TaskRunResponsePublicV2 = Field(description="Task run object with status 'completed'.") + stats: Optional[RunStatsPublicV2] = Field(default=None, description="Counts of the work the agent did. Null for runs completed before this was recorded.") + __properties: ClassVar[List[str]] = ["output", "run", "stats"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunResultPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of output + if self.output: + _dict['output'] = self.output.to_dict() + # override the default output from pydantic by calling `to_dict()` of run + if self.run: + _dict['run'] = self.run.to_dict() + # override the default output from pydantic by calling `to_dict()` of stats + if self.stats: + _dict['stats'] = self.stats.to_dict() + # set to None if stats (nullable) is None + # and model_fields_set contains the field + if self.stats is None and "stats" in self.model_fields_set: + _dict['stats'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunResultPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "output": Output3.from_dict(obj["output"]) if obj.get("output") is not None else None, + "run": TaskRunResponsePublicV2.from_dict(obj["run"]) if obj.get("run") is not None else None, + "stats": RunStatsPublicV2.from_dict(obj["stats"]) if obj.get("stats") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_text_output_public_v1.py b/candidate/generated/nimble_client/models/task_run_text_output_public_v1.py new file mode 100644 index 0000000..ef058fb --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_text_output_public_v1.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from nimble_client.models.text_run_trust import TextRunTrust +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunTextOutputPublicV1(BaseModel): + """ + TaskRunTextOutputPublicV1 + """ # noqa: E501 + content: StrictStr = Field(description="The final prose answer.") + sources: Optional[List[GatewayDef3a5c7c6bfa027c89TaskRunOutputSource]] = Field(default=None, description="Sources the output cites, deduplicated by URL in citation order. Always present, including when trust is off (`trust: null`).") + trust: Optional[TextRunTrust] = Field(description="Trust and citation metadata for the output.") + type: Optional[StrictStr] = Field(default='text', description="Output content type.") + __properties: ClassVar[List[str]] = ["content", "sources", "trust", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['text']): + raise ValueError("must be one of enum values ('text')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunTextOutputPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of trust + if self.trust: + _dict['trust'] = self.trust.to_dict() + # set to None if trust (nullable) is None + # and model_fields_set contains the field + if self.trust is None and "trust" in self.model_fields_set: + _dict['trust'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunTextOutputPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": obj.get("content"), + "sources": [GatewayDef3a5c7c6bfa027c89TaskRunOutputSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "trust": TextRunTrust.from_dict(obj["trust"]) if obj.get("trust") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'text' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/task_run_text_output_public_v2.py b/candidate/generated/nimble_client/models/task_run_text_output_public_v2.py new file mode 100644 index 0000000..1cf2f7e --- /dev/null +++ b/candidate/generated/nimble_client/models/task_run_text_output_public_v2.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def3a5c7c6bfa027c89_task_run_output_source import GatewayDef3a5c7c6bfa027c89TaskRunOutputSource +from nimble_client.models.text_run_trust import TextRunTrust +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskRunTextOutputPublicV2(BaseModel): + """ + TaskRunTextOutputPublicV2 + """ # noqa: E501 + content: StrictStr = Field(description="The final prose answer.") + sources: Optional[List[GatewayDef3a5c7c6bfa027c89TaskRunOutputSource]] = Field(default=None, description="Sources the output cites, deduplicated by URL in citation order. Always present, including when trust is off (`trust: null`).") + trust: Optional[TextRunTrust] = Field(description="Trust and citation metadata for the output.") + type: Optional[StrictStr] = Field(default='text', description="Output content type.") + __properties: ClassVar[List[str]] = ["content", "sources", "trust", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['text']): + raise ValueError("must be one of enum values ('text')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskRunTextOutputPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of trust + if self.trust: + _dict['trust'] = self.trust.to_dict() + # set to None if trust (nullable) is None + # and model_fields_set contains the field + if self.trust is None and "trust" in self.model_fields_set: + _dict['trust'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskRunTextOutputPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content": obj.get("content"), + "sources": [GatewayDef3a5c7c6bfa027c89TaskRunOutputSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "trust": TextRunTrust.from_dict(obj["trust"]) if obj.get("trust") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'text' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/template_feature_flags_public_v1.py b/candidate/generated/nimble_client/models/template_feature_flags_public_v1.py new file mode 100644 index 0000000..7a6fb5e --- /dev/null +++ b/candidate/generated/nimble_client/models/template_feature_flags_public_v1.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TemplateFeatureFlagsPublicV1(BaseModel): + """ + TemplateFeatureFlagsPublicV1 + """ # noqa: E501 + is_localization_supported: Optional[StrictBool] = False + is_pagination_supported: Optional[StrictBool] = False + __properties: ClassVar[List[str]] = ["is_localization_supported", "is_pagination_supported"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateFeatureFlagsPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateFeatureFlagsPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "is_localization_supported": obj.get("is_localization_supported") if obj.get("is_localization_supported") is not None else False, + "is_pagination_supported": obj.get("is_pagination_supported") if obj.get("is_pagination_supported") is not None else False + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/template_generation_response_public_v1.py b/candidate/generated/nimble_client/models/template_generation_response_public_v1.py new file mode 100644 index 0000000..11dfc35 --- /dev/null +++ b/candidate/generated/nimble_client/models/template_generation_response_public_v1.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from nimble_client.models.template_version_response_public_v1 import TemplateVersionResponsePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TemplateGenerationResponsePublicV1(BaseModel): + """ + TemplateGenerationResponsePublicV1 + """ # noqa: E501 + agent_name: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + completed_at: Optional[datetime] = Field(default=None, description="Most recent usage recorded for this account (UTC) in the services queried, at any time (not limited to the range); `null` when there is none.") + created_at: Optional[datetime] = Field(default=None, description="Most recent usage recorded for this account (UTC) in the services queried, at any time (not limited to the range); `null` when there is none.") + error: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + generated_version: Optional[TemplateVersionResponsePublicV1] = None + generated_version_id: Optional[UUID] = None + id: UUID + source_version_id: Optional[UUID] = None + started_at: Optional[datetime] = Field(default=None, description="Most recent usage recorded for this account (UTC) in the services queried, at any time (not limited to the range); `null` when there is none.") + status: StrictStr + summary: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + __properties: ClassVar[List[str]] = ["agent_name", "completed_at", "created_at", "error", "generated_version", "generated_version_id", "id", "source_version_id", "started_at", "status", "summary"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateGenerationResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of generated_version + if self.generated_version: + _dict['generated_version'] = self.generated_version.to_dict() + # set to None if agent_name (nullable) is None + # and model_fields_set contains the field + if self.agent_name is None and "agent_name" in self.model_fields_set: + _dict['agent_name'] = None + + # set to None if completed_at (nullable) is None + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: + _dict['completed_at'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if generated_version (nullable) is None + # and model_fields_set contains the field + if self.generated_version is None and "generated_version" in self.model_fields_set: + _dict['generated_version'] = None + + # set to None if generated_version_id (nullable) is None + # and model_fields_set contains the field + if self.generated_version_id is None and "generated_version_id" in self.model_fields_set: + _dict['generated_version_id'] = None + + # set to None if source_version_id (nullable) is None + # and model_fields_set contains the field + if self.source_version_id is None and "source_version_id" in self.model_fields_set: + _dict['source_version_id'] = None + + # set to None if started_at (nullable) is None + # and model_fields_set contains the field + if self.started_at is None and "started_at" in self.model_fields_set: + _dict['started_at'] = None + + # set to None if summary (nullable) is None + # and model_fields_set contains the field + if self.summary is None and "summary" in self.model_fields_set: + _dict['summary'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateGenerationResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "completed_at": obj.get("completed_at"), + "created_at": obj.get("created_at"), + "error": obj.get("error"), + "generated_version": TemplateVersionResponsePublicV1.from_dict(obj["generated_version"]) if obj.get("generated_version") is not None else None, + "generated_version_id": obj.get("generated_version_id"), + "id": obj.get("id"), + "source_version_id": obj.get("source_version_id"), + "started_at": obj.get("started_at"), + "status": obj.get("status"), + "summary": obj.get("summary") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/template_input_property_public_v1.py b/candidate/generated/nimble_client/models/template_input_property_public_v1.py new file mode 100644 index 0000000..1738df6 --- /dev/null +++ b/candidate/generated/nimble_client/models/template_input_property_public_v1.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.default import Default +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TemplateInputPropertyPublicV1(BaseModel): + """ + TemplateInputPropertyPublicV1 + """ # noqa: E501 + default: Optional[Default] = None + description: Optional[StrictStr] = None + examples: Optional[List[Any]] = None + is_localization_param: Optional[StrictBool] = False + is_pagination_param: Optional[StrictBool] = False + name: Optional[StrictStr] = '' + required: Optional[StrictBool] = False + rules: Optional[List[StrictStr]] = None + type: Optional[StrictStr] = 'string' + __properties: ClassVar[List[str]] = ["default", "description", "examples", "is_localization_param", "is_pagination_param", "name", "required", "rules", "type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateInputPropertyPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of default + if self.default: + _dict['default'] = self.default.to_dict() + # set to None if default (nullable) is None + # and model_fields_set contains the field + if self.default is None and "default" in self.model_fields_set: + _dict['default'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if examples (nullable) is None + # and model_fields_set contains the field + if self.examples is None and "examples" in self.model_fields_set: + _dict['examples'] = None + + # set to None if rules (nullable) is None + # and model_fields_set contains the field + if self.rules is None and "rules" in self.model_fields_set: + _dict['rules'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateInputPropertyPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "default": Default.from_dict(obj["default"]) if obj.get("default") is not None else None, + "description": obj.get("description"), + "examples": obj.get("examples"), + "is_localization_param": obj.get("is_localization_param") if obj.get("is_localization_param") is not None else False, + "is_pagination_param": obj.get("is_pagination_param") if obj.get("is_pagination_param") is not None else False, + "name": obj.get("name") if obj.get("name") is not None else '', + "required": obj.get("required") if obj.get("required") is not None else False, + "rules": obj.get("rules"), + "type": obj.get("type") if obj.get("type") is not None else 'string' + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/template_public_v1.py b/candidate/generated/nimble_client/models/template_public_v1.py new file mode 100644 index 0000000..20027e2 --- /dev/null +++ b/candidate/generated/nimble_client/models/template_public_v1.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TemplatePublicV1(BaseModel): + """ + TemplatePublicV1 + """ # noqa: E501 + description: Optional[StrictStr] = None + display_name: StrictStr + domain: Optional[StrictStr] = None + entity_type: Optional[StrictStr] = None + is_public: StrictBool + managed_by: Optional[StrictStr] = None + name: StrictStr + vertical: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["description", "display_name", "domain", "entity_type", "is_public", "managed_by", "name", "vertical"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplatePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if domain (nullable) is None + # and model_fields_set contains the field + if self.domain is None and "domain" in self.model_fields_set: + _dict['domain'] = None + + # set to None if entity_type (nullable) is None + # and model_fields_set contains the field + if self.entity_type is None and "entity_type" in self.model_fields_set: + _dict['entity_type'] = None + + # set to None if managed_by (nullable) is None + # and model_fields_set contains the field + if self.managed_by is None and "managed_by" in self.model_fields_set: + _dict['managed_by'] = None + + # set to None if vertical (nullable) is None + # and model_fields_set contains the field + if self.vertical is None and "vertical" in self.model_fields_set: + _dict['vertical'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplatePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "domain": obj.get("domain"), + "entity_type": obj.get("entity_type"), + "is_public": obj.get("is_public"), + "managed_by": obj.get("managed_by"), + "name": obj.get("name"), + "vertical": obj.get("vertical") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/template_sample_public_v1.py b/candidate/generated/nimble_client/models/template_sample_public_v1.py new file mode 100644 index 0000000..3ba5e44 --- /dev/null +++ b/candidate/generated/nimble_client/models/template_sample_public_v1.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TemplateSamplePublicV1(BaseModel): + """ + TemplateSamplePublicV1 + """ # noqa: E501 + input: Optional[Any] = None + output: Optional[Any] = None + __properties: ClassVar[List[str]] = ["input", "output"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateSamplePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of input + if self.input: + _dict['input'] = self.input.to_dict() + # override the default output from pydantic by calling `to_dict()` of output + if self.output: + _dict['output'] = self.output.to_dict() + # set to None if input (nullable) is None + # and model_fields_set contains the field + if self.input is None and "input" in self.model_fields_set: + _dict['input'] = None + + # set to None if output (nullable) is None + # and model_fields_set contains the field + if self.output is None and "output" in self.model_fields_set: + _dict['output'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateSamplePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "input": AnyOf.from_dict(obj["input"]) if obj.get("input") is not None else None, + "output": AnyOf.from_dict(obj["output"]) if obj.get("output") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/template_version_metadata_public_v1.py b/candidate/generated/nimble_client/models/template_version_metadata_public_v1.py new file mode 100644 index 0000000..58f1cf6 --- /dev/null +++ b/candidate/generated/nimble_client/models/template_version_metadata_public_v1.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TemplateVersionMetadataPublicV1(BaseModel): + """ + TemplateVersionMetadataPublicV1 + """ # noqa: E501 + data_source: Optional[StrictStr] = None + description: Optional[StrictStr] = None + display_name: Optional[StrictStr] = None + domain: Optional[StrictStr] = None + entity_type: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + vertical: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["data_source", "description", "display_name", "domain", "entity_type", "tags", "vertical"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateVersionMetadataPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if data_source (nullable) is None + # and model_fields_set contains the field + if self.data_source is None and "data_source" in self.model_fields_set: + _dict['data_source'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if domain (nullable) is None + # and model_fields_set contains the field + if self.domain is None and "domain" in self.model_fields_set: + _dict['domain'] = None + + # set to None if entity_type (nullable) is None + # and model_fields_set contains the field + if self.entity_type is None and "entity_type" in self.model_fields_set: + _dict['entity_type'] = None + + # set to None if vertical (nullable) is None + # and model_fields_set contains the field + if self.vertical is None and "vertical" in self.model_fields_set: + _dict['vertical'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateVersionMetadataPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data_source": obj.get("data_source"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "domain": obj.get("domain"), + "entity_type": obj.get("entity_type"), + "tags": obj.get("tags"), + "vertical": obj.get("vertical") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/template_version_response_public_v1.py b/candidate/generated/nimble_client/models/template_version_response_public_v1.py new file mode 100644 index 0000000..fdc7bb0 --- /dev/null +++ b/candidate/generated/nimble_client/models/template_version_response_public_v1.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from nimble_client.models.template_sample_public_v1 import TemplateSamplePublicV1 +from nimble_client.models.template_version_metadata_public_v1 import TemplateVersionMetadataPublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TemplateVersionResponsePublicV1(BaseModel): + """ + TemplateVersionResponsePublicV1 + """ # noqa: E501 + agent_name: StrictStr + created_at: datetime + id: UUID + input_schema: Dict[str, Any] + metadata: TemplateVersionMetadataPublicV1 + output_schema: Dict[str, Any] + samples: Optional[List[TemplateSamplePublicV1]] = None + version_number: StrictInt + __properties: ClassVar[List[str]] = ["agent_name", "created_at", "id", "input_schema", "metadata", "output_schema", "samples", "version_number"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateVersionResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in samples (list) + _items = [] + if self.samples: + for _item_samples in self.samples: + _items.append(_item_samples.to_dict() if _item_samples is not None else None) + _dict['samples'] = _items + # set to None if samples (nullable) is None + # and model_fields_set contains the field + if self.samples is None and "samples" in self.model_fields_set: + _dict['samples'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateVersionResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "created_at": obj.get("created_at"), + "id": obj.get("id"), + "input_schema": obj.get("input_schema"), + "metadata": TemplateVersionMetadataPublicV1.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "output_schema": obj.get("output_schema"), + "samples": [TemplateSamplePublicV1.from_dict(_item) for _item in obj["samples"]] if obj.get("samples") is not None else None, + "version_number": obj.get("version_number") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/text_claim_trust.py b/candidate/generated/nimble_client/models/text_claim_trust.py new file mode 100644 index 0000000..6218b55 --- /dev/null +++ b/candidate/generated/nimble_client/models/text_claim_trust.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.trust_citation import TrustCitation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TextClaimTrust(BaseModel): + """ + Trust metadata for one claim in a prose answer, keyed by callout marker. + """ # noqa: E501 + callout: StrictInt = Field(description="Callout marker number referencing this claim in the answer text.") + citations: List[TrustCitation] = Field(description="Citations backing this claim.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Confidence in this claim.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + __properties: ClassVar[List[str]] = ["callout", "citations", "confidence", "reasoning"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TextClaimTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in citations (list) + _items = [] + if self.citations: + for _item_citations in self.citations: + _items.append(_item_citations.to_dict() if _item_citations is not None else None) + _dict['citations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TextClaimTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "callout": obj.get("callout"), + "citations": [TrustCitation.from_dict(_item) for _item in obj["citations"]] if obj.get("citations") is not None else None, + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/text_run_trust.py b/candidate/generated/nimble_client/models/text_run_trust.py new file mode 100644 index 0000000..49e9cbd --- /dev/null +++ b/candidate/generated/nimble_client/models/text_run_trust.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.gateway_def07f3b31eb3e5e2cb_trust_confidence import GatewayDef07f3b31eb3e5e2cbTrustConfidence +from nimble_client.models.text_claim_trust import TextClaimTrust +from nimble_client.models.trust_source import TrustSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TextRunTrust(BaseModel): + """ + Trust metadata for a prose answer: run-level confidence plus per-claim citations. + """ # noqa: E501 + claims: List[TextClaimTrust] = Field(description="Per-claim trust, keyed by callout markers in the answer text.") + confidence: GatewayDef07f3b31eb3e5e2cbTrustConfidence = Field(description="Overall confidence in the answer.") + reasoning: StrictStr = Field(description="Why this confidence level was assigned.") + sources: List[TrustSource] = Field(description="Sources consulted while producing the answer.") + __properties: ClassVar[List[str]] = ["claims", "confidence", "reasoning", "sources"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TextRunTrust from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in claims (list) + _items = [] + if self.claims: + for _item_claims in self.claims: + _items.append(_item_claims.to_dict() if _item_claims is not None else None) + _dict['claims'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TextRunTrust from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "claims": [TextClaimTrust.from_dict(_item) for _item in obj["claims"]] if obj.get("claims") is not None else None, + "confidence": obj.get("confidence"), + "reasoning": obj.get("reasoning"), + "sources": [TrustSource.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/time_range.py b/candidate/generated/nimble_client/models/time_range.py new file mode 100644 index 0000000..87c6e8d --- /dev/null +++ b/candidate/generated/nimble_client/models/time_range.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class TimeRange(str, Enum): + """ + Time range filters passed to Webit SERP API as 'time' parameter. + """ + + """ + allowed enum values + """ + HOUR = 'hour' + DAY = 'day' + WEEK = 'week' + MONTH = 'month' + YEAR = 'year' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TimeRange from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/trigger_job_run_request_public_v1.py b/candidate/generated/nimble_client/models/trigger_job_run_request_public_v1.py new file mode 100644 index 0000000..101adc9 --- /dev/null +++ b/candidate/generated/nimble_client/models/trigger_job_run_request_public_v1.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.job_inputs_public_v1 import JobInputsPublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TriggerJobRunRequestPublicV1(BaseModel): + """ + Optional body for a manual run: inputs applied to this run only. + """ # noqa: E501 + inputs: Optional[JobInputsPublicV1] = Field(default=None, description="Inputs to use for this run only. The job's own configuration is left unchanged; omit the body to run the job with its configured inputs.") + __properties: ClassVar[List[str]] = ["inputs"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TriggerJobRunRequestPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of inputs + if self.inputs: + _dict['inputs'] = self.inputs.to_dict() + # set to None if inputs (nullable) is None + # and model_fields_set contains the field + if self.inputs is None and "inputs" in self.model_fields_set: + _dict['inputs'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TriggerJobRunRequestPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "inputs": JobInputsPublicV1.from_dict(obj["inputs"]) if obj.get("inputs") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/trigger_job_run_request_public_v2.py b/candidate/generated/nimble_client/models/trigger_job_run_request_public_v2.py new file mode 100644 index 0000000..946bbe5 --- /dev/null +++ b/candidate/generated/nimble_client/models/trigger_job_run_request_public_v2.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.job_inputs_public_v2 import JobInputsPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TriggerJobRunRequestPublicV2(BaseModel): + """ + Optional body for a manual run: inputs applied to this run only. + """ # noqa: E501 + inputs: Optional[JobInputsPublicV2] = Field(default=None, description="Inputs to use for this run only. The job's own configuration is left unchanged; omit the body to run the job with its configured inputs.") + __properties: ClassVar[List[str]] = ["inputs"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TriggerJobRunRequestPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of inputs + if self.inputs: + _dict['inputs'] = self.inputs.to_dict() + # set to None if inputs (nullable) is None + # and model_fields_set contains the field + if self.inputs is None and "inputs" in self.model_fields_set: + _dict['inputs'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TriggerJobRunRequestPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "inputs": JobInputsPublicV2.from_dict(obj["inputs"]) if obj.get("inputs") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/trust_citation.py b/candidate/generated/nimble_client/models/trust_citation.py new file mode 100644 index 0000000..a6c0dc3 --- /dev/null +++ b/candidate/generated/nimble_client/models/trust_citation.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def1d511972aa34af3c_source_category import GatewayDef1d511972aa34af3cSourceCategory +from nimble_client.models.gateway_def7feddd7d853a299b_trust_source_type import GatewayDef7feddd7d853a299bTrustSourceType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TrustCitation(BaseModel): + """ + A citation backing a specific claim in the answer. + """ # noqa: E501 + excerpts: Optional[List[StrictStr]] = Field(default=None, description="Verbatim excerpts supporting the claim.") + extract_template_name: Optional[StrictStr] = Field(default=None, description="Extract template used to read the source, when one was used.") + source_category: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source: official, news, social, academic, aggregator, or other.") + source_intent: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source the underlying question asked for.") + source_type: Optional[GatewayDef7feddd7d853a299bTrustSourceType] = Field(default=None, description="How authoritative the source is: 'primary' or 'secondary'.") + title: Optional[StrictStr] = Field(default=None, description="Title of the cited page.") + url: StrictStr = Field(description="URL of the cited page.") + __properties: ClassVar[List[str]] = ["excerpts", "extract_template_name", "source_category", "source_intent", "source_type", "title", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TrustCitation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if excerpts (nullable) is None + # and model_fields_set contains the field + if self.excerpts is None and "excerpts" in self.model_fields_set: + _dict['excerpts'] = None + + # set to None if extract_template_name (nullable) is None + # and model_fields_set contains the field + if self.extract_template_name is None and "extract_template_name" in self.model_fields_set: + _dict['extract_template_name'] = None + + # set to None if source_category (nullable) is None + # and model_fields_set contains the field + if self.source_category is None and "source_category" in self.model_fields_set: + _dict['source_category'] = None + + # set to None if source_intent (nullable) is None + # and model_fields_set contains the field + if self.source_intent is None and "source_intent" in self.model_fields_set: + _dict['source_intent'] = None + + # set to None if source_type (nullable) is None + # and model_fields_set contains the field + if self.source_type is None and "source_type" in self.model_fields_set: + _dict['source_type'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TrustCitation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "excerpts": obj.get("excerpts"), + "extract_template_name": obj.get("extract_template_name"), + "source_category": obj.get("source_category"), + "source_intent": obj.get("source_intent"), + "source_type": obj.get("source_type"), + "title": obj.get("title"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/trust_mode.py b/candidate/generated/nimble_client/models/trust_mode.py new file mode 100644 index 0000000..fd004e0 --- /dev/null +++ b/candidate/generated/nimble_client/models/trust_mode.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class TrustMode(str, Enum): + """ + TrustMode + """ + + """ + allowed enum values + """ + NO_TRUST = 'no_trust' + FULL_TRUST = 'full_trust' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TrustMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/trust_source.py b/candidate/generated/nimble_client/models/trust_source.py new file mode 100644 index 0000000..362189c --- /dev/null +++ b/candidate/generated/nimble_client/models/trust_source.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.gateway_def1d511972aa34af3c_source_category import GatewayDef1d511972aa34af3cSourceCategory +from nimble_client.models.gateway_def7feddd7d853a299b_trust_source_type import GatewayDef7feddd7d853a299bTrustSourceType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TrustSource(BaseModel): + """ + A source consulted while producing the answer. + """ # noqa: E501 + extract_template_name: Optional[StrictStr] = Field(default=None, description="Extract template used to read the source, when one was used.") + source_category: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source: official, news, social, academic, aggregator, or other.") + source_intent: Optional[GatewayDef1d511972aa34af3cSourceCategory] = Field(default=None, description="Kind of source the underlying question asked for.") + title: Optional[StrictStr] = Field(default=None, description="Title of the source page.") + type: GatewayDef7feddd7d853a299bTrustSourceType = Field(description="How authoritative the source is: 'primary' or 'secondary'.") + url: StrictStr = Field(description="URL of the source page.") + __properties: ClassVar[List[str]] = ["extract_template_name", "source_category", "source_intent", "title", "type", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TrustSource from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if extract_template_name (nullable) is None + # and model_fields_set contains the field + if self.extract_template_name is None and "extract_template_name" in self.model_fields_set: + _dict['extract_template_name'] = None + + # set to None if source_category (nullable) is None + # and model_fields_set contains the field + if self.source_category is None and "source_category" in self.model_fields_set: + _dict['source_category'] = None + + # set to None if source_intent (nullable) is None + # and model_fields_set contains the field + if self.source_intent is None and "source_intent" in self.model_fields_set: + _dict['source_intent'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TrustSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "extract_template_name": obj.get("extract_template_name"), + "source_category": obj.get("source_category"), + "source_intent": obj.get("source_intent"), + "title": obj.get("title"), + "type": obj.get("type"), + "url": obj.get("url") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/update_job_request_public_v1.py b/candidate/generated/nimble_client/models/update_job_request_public_v1.py new file mode 100644 index 0000000..88b2f12 --- /dev/null +++ b/candidate/generated/nimble_client/models/update_job_request_public_v1.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.job_destination_public_v1 import JobDestinationPublicV1 +from nimble_client.models.job_inputs_public_v1 import JobInputsPublicV1 +from nimble_client.models.job_schedule_public_v1 import JobSchedulePublicV1 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateJobRequestPublicV1(BaseModel): + """ + Partial update for an existing job; omitted fields are left unchanged. + """ # noqa: E501 + description: Optional[StrictStr] = Field(default=None, description="New description.") + destination: Optional[JobDestinationPublicV1] = Field(default=None, description="New output destination.") + display_name: Optional[StrictStr] = Field(default=None, description="New display name.") + inputs: Optional[JobInputsPublicV1] = Field(default=None, description="New input data configuration.") + schedule: Optional[JobSchedulePublicV1] = Field(default=None, description="New cron schedule.") + __properties: ClassVar[List[str]] = ["description", "destination", "display_name", "inputs", "schedule"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateJobRequestPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of destination + if self.destination: + _dict['destination'] = self.destination.to_dict() + # override the default output from pydantic by calling `to_dict()` of inputs + if self.inputs: + _dict['inputs'] = self.inputs.to_dict() + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if destination (nullable) is None + # and model_fields_set contains the field + if self.destination is None and "destination" in self.model_fields_set: + _dict['destination'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if inputs (nullable) is None + # and model_fields_set contains the field + if self.inputs is None and "inputs" in self.model_fields_set: + _dict['inputs'] = None + + # set to None if schedule (nullable) is None + # and model_fields_set contains the field + if self.schedule is None and "schedule" in self.model_fields_set: + _dict['schedule'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateJobRequestPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "destination": JobDestinationPublicV1.from_dict(obj["destination"]) if obj.get("destination") is not None else None, + "display_name": obj.get("display_name"), + "inputs": JobInputsPublicV1.from_dict(obj["inputs"]) if obj.get("inputs") is not None else None, + "schedule": JobSchedulePublicV1.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/update_job_request_public_v2.py b/candidate/generated/nimble_client/models/update_job_request_public_v2.py new file mode 100644 index 0000000..ee8a7b7 --- /dev/null +++ b/candidate/generated/nimble_client/models/update_job_request_public_v2.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.job_destination_public_v2 import JobDestinationPublicV2 +from nimble_client.models.job_inputs_public_v2 import JobInputsPublicV2 +from nimble_client.models.job_schedule_public_v2 import JobSchedulePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UpdateJobRequestPublicV2(BaseModel): + """ + Partial update for an existing job; omitted fields are left unchanged. + """ # noqa: E501 + description: Optional[StrictStr] = Field(default=None, description="New description.") + destination: Optional[JobDestinationPublicV2] = Field(default=None, description="New output destination.") + display_name: Optional[StrictStr] = Field(default=None, description="New display name.") + inputs: Optional[JobInputsPublicV2] = Field(default=None, description="New input data configuration.") + schedule: Optional[JobSchedulePublicV2] = Field(default=None, description="New cron schedule.") + __properties: ClassVar[List[str]] = ["description", "destination", "display_name", "inputs", "schedule"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateJobRequestPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of destination + if self.destination: + _dict['destination'] = self.destination.to_dict() + # override the default output from pydantic by calling `to_dict()` of inputs + if self.inputs: + _dict['inputs'] = self.inputs.to_dict() + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if destination (nullable) is None + # and model_fields_set contains the field + if self.destination is None and "destination" in self.model_fields_set: + _dict['destination'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if inputs (nullable) is None + # and model_fields_set contains the field + if self.inputs is None and "inputs" in self.model_fields_set: + _dict['inputs'] = None + + # set to None if schedule (nullable) is None + # and model_fields_set contains the field + if self.schedule is None and "schedule" in self.model_fields_set: + _dict['schedule'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateJobRequestPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "destination": JobDestinationPublicV2.from_dict(obj["destination"]) if obj.get("destination") is not None else None, + "display_name": obj.get("display_name"), + "inputs": JobInputsPublicV2.from_dict(obj["inputs"]) if obj.get("inputs") is not None else None, + "schedule": JobSchedulePublicV2.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_catalog_configuration_public_v2.py b/candidate/generated/nimble_client/models/usage_catalog_configuration_public_v2.py new file mode 100644 index 0000000..6b2022b --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_catalog_configuration_public_v2.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageCatalogConfigurationPublicV2(BaseModel): + """ + A configuration that can be used as a filter. + """ # noqa: E501 + filter: StrictStr = Field(description="The value to pass as `configuration` on `GET /v2/usage`: `.`.") + key: StrictStr = Field(description="Configuration key, unique within its product.") + name: StrictStr = Field(description="Current display name.") + status: StrictStr = Field(description="`active`: on sale. `deprecated`: still billed, not sold to new customers. `retired`: no longer billed; listed because past usage carries its key.") + __properties: ClassVar[List[str]] = ["filter", "key", "name", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['active', 'deprecated', 'retired']): + raise ValueError("must be one of enum values ('active', 'deprecated', 'retired')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageCatalogConfigurationPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageCatalogConfigurationPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filter": obj.get("filter"), + "key": obj.get("key"), + "name": obj.get("name"), + "status": obj.get("status") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_catalog_product_public_v2.py b/candidate/generated/nimble_client/models/usage_catalog_product_public_v2.py new file mode 100644 index 0000000..d1a3a86 --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_catalog_product_public_v2.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.usage_catalog_configuration_public_v2 import UsageCatalogConfigurationPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageCatalogProductPublicV2(BaseModel): + """ + A product and its configurations. + """ # noqa: E501 + configurations: List[UsageCatalogConfigurationPublicV2] = Field(description="Configurations of this product.") + key: StrictStr = Field(description="Product key.") + name: StrictStr = Field(description="Current display name.") + __properties: ClassVar[List[str]] = ["configurations", "key", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageCatalogProductPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in configurations (list) + _items = [] + if self.configurations: + for _item_configurations in self.configurations: + _items.append(_item_configurations.to_dict() if _item_configurations is not None else None) + _dict['configurations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageCatalogProductPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "configurations": [UsageCatalogConfigurationPublicV2.from_dict(_item) for _item in obj["configurations"]] if obj.get("configurations") is not None else None, + "key": obj.get("key"), + "name": obj.get("name") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_catalog_public_v2.py b/candidate/generated/nimble_client/models/usage_catalog_public_v2.py new file mode 100644 index 0000000..75193c4 --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_catalog_public_v2.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from nimble_client.models.usage_catalog_service_public_v2 import UsageCatalogServicePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageCatalogPublicV2(BaseModel): + """ + Every service, product and configuration usage can be filtered and grouped by. + """ # noqa: E501 + services: List[UsageCatalogServicePublicV2] = Field(description="Services, each with its products.") + __properties: ClassVar[List[str]] = ["services"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageCatalogPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in services (list) + _items = [] + if self.services: + for _item_services in self.services: + _items.append(_item_services.to_dict() if _item_services is not None else None) + _dict['services'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageCatalogPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "services": [UsageCatalogServicePublicV2.from_dict(_item) for _item in obj["services"]] if obj.get("services") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_catalog_service_public_v2.py b/candidate/generated/nimble_client/models/usage_catalog_service_public_v2.py new file mode 100644 index 0000000..67aaee5 --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_catalog_service_public_v2.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from nimble_client.models.usage_catalog_product_public_v2 import UsageCatalogProductPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageCatalogServicePublicV2(BaseModel): + """ + A service and its products. + """ # noqa: E501 + key: StrictStr = Field(description="Service key.") + name: StrictStr = Field(description="Current display name.") + products: List[UsageCatalogProductPublicV2] = Field(description="Products of this service.") + __properties: ClassVar[List[str]] = ["key", "name", "products"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageCatalogServicePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in products (list) + _items = [] + if self.products: + for _item_products in self.products: + _items.append(_item_products.to_dict() if _item_products is not None else None) + _dict['products'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageCatalogServicePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "name": obj.get("name"), + "products": [UsageCatalogProductPublicV2.from_dict(_item) for _item in obj["products"]] if obj.get("products") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_configuration_name_public_v2.py b/candidate/generated/nimble_client/models/usage_configuration_name_public_v2.py new file mode 100644 index 0000000..a5664f8 --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_configuration_name_public_v2.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageConfigurationNamePublicV2(BaseModel): + """ + The configuration usage was billed on. + """ # noqa: E501 + key: Optional[StrictStr] = Field(description="Cursor for pagination.") + name: StrictStr = Field(description="Current display name, or the legacy name when `key` is `null`.") + __properties: ClassVar[List[str]] = ["key", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageConfigurationNamePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if key (nullable) is None + # and model_fields_set contains the field + if self.key is None and "key" in self.model_fields_set: + _dict['key'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageConfigurationNamePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "name": obj.get("name") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_dimensions_public_v2.py b/candidate/generated/nimble_client/models/usage_dimensions_public_v2.py new file mode 100644 index 0000000..ef92643 --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_dimensions_public_v2.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.usage_configuration_name_public_v2 import UsageConfigurationNamePublicV2 +from nimble_client.models.usage_name_public_v2 import UsageNamePublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageDimensionsPublicV2(BaseModel): + """ + The dimension values of a row. Only the dimensions in `group_by` are present. + """ # noqa: E501 + api_key: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + configuration: Optional[UsageConfigurationNamePublicV2] = Field(default=None, description="Configuration the usage was billed on; `null` when the usage carries none.") + country: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + domain: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + product: Optional[UsageNamePublicV2] = Field(default=None, description="Product the usage belongs to; `null` when the usage is on a legacy name.") + service: Optional[UsageNamePublicV2] = Field(default=None, description="Service the usage belongs to.") + __properties: ClassVar[List[str]] = ["api_key", "configuration", "country", "domain", "product", "service"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageDimensionsPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of configuration + if self.configuration: + _dict['configuration'] = self.configuration.to_dict() + # override the default output from pydantic by calling `to_dict()` of product + if self.product: + _dict['product'] = self.product.to_dict() + # override the default output from pydantic by calling `to_dict()` of service + if self.service: + _dict['service'] = self.service.to_dict() + # set to None if api_key (nullable) is None + # and model_fields_set contains the field + if self.api_key is None and "api_key" in self.model_fields_set: + _dict['api_key'] = None + + # set to None if configuration (nullable) is None + # and model_fields_set contains the field + if self.configuration is None and "configuration" in self.model_fields_set: + _dict['configuration'] = None + + # set to None if country (nullable) is None + # and model_fields_set contains the field + if self.country is None and "country" in self.model_fields_set: + _dict['country'] = None + + # set to None if domain (nullable) is None + # and model_fields_set contains the field + if self.domain is None and "domain" in self.model_fields_set: + _dict['domain'] = None + + # set to None if product (nullable) is None + # and model_fields_set contains the field + if self.product is None and "product" in self.model_fields_set: + _dict['product'] = None + + # set to None if service (nullable) is None + # and model_fields_set contains the field + if self.service is None and "service" in self.model_fields_set: + _dict['service'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageDimensionsPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_key": obj.get("api_key"), + "configuration": UsageConfigurationNamePublicV2.from_dict(obj["configuration"]) if obj.get("configuration") is not None else None, + "country": obj.get("country"), + "domain": obj.get("domain"), + "product": UsageNamePublicV2.from_dict(obj["product"]) if obj.get("product") is not None else None, + "service": UsageNamePublicV2.from_dict(obj["service"]) if obj.get("service") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_meta_public_v2.py b/candidate/generated/nimble_client/models/usage_meta_public_v2.py new file mode 100644 index 0000000..80a9412 --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_meta_public_v2.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageMetaPublicV2(BaseModel): + """ + How the response was produced. + """ # noqa: E501 + domains_capped: Optional[StrictBool] = Field(default=False, description="Only the top 100 domains are broken out; the rest are combined in the row with domain null. Present, as true, only when such a row is in the result.") + end: datetime = Field(description="End of the range answered (UTC): the requested end rounded up to a whole bucket.") + excluded_services: Optional[List[Optional[StrictStr]]] = Field(default=None, description="Service keys left out because they cannot be split or filtered by the requested `api_key`, `domain` or `country`, or because their usage cannot be read yet; their usage is not in `data` or `totals`.") + granularity: StrictStr = Field(description="Time bucket size used.") + last_usage_at: Optional[datetime] = Field(description="Most recent usage recorded for this account (UTC) in the services queried, at any time (not limited to the range); `null` when there is none.") + partial: StrictBool = Field(description="True when figures may still change: figures for recent periods are still being loaded (the last hour or two for `hour`; today, and yesterday until 05:00 UTC, for `day`; the current month, and the previous one until the 4th, for `month`), or part of the usage could not be read this time.") + range_snapped: StrictBool = Field(description="True when the requested range did not fall on bucket boundaries, so `start` and `end` were widened to whole buckets and the edge buckets are reported whole.") + start: datetime = Field(description="Start of the range answered (UTC): the requested start rounded down to a whole bucket.") + total: StrictInt = Field(description="Number of rows before `limit` and `offset`; page while `offset + limit < total`.") + truncated: StrictBool = Field(description="True when the range held more rows than one call can read: rows are cut, and `totals` may be incomplete too. Narrow the range, the filters or `group_by` to see all usage.") + __properties: ClassVar[List[str]] = ["domains_capped", "end", "excluded_services", "granularity", "last_usage_at", "partial", "range_snapped", "start", "total", "truncated"] + + @field_validator('granularity') + def granularity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['hour', 'day', 'month']): + raise ValueError("must be one of enum values ('hour', 'day', 'month')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageMetaPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if last_usage_at (nullable) is None + # and model_fields_set contains the field + if self.last_usage_at is None and "last_usage_at" in self.model_fields_set: + _dict['last_usage_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageMetaPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "domains_capped": obj.get("domains_capped") if obj.get("domains_capped") is not None else False, + "end": obj.get("end"), + "excluded_services": obj.get("excluded_services"), + "granularity": obj.get("granularity"), + "last_usage_at": obj.get("last_usage_at"), + "partial": obj.get("partial"), + "range_snapped": obj.get("range_snapped"), + "start": obj.get("start"), + "total": obj.get("total"), + "truncated": obj.get("truncated") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_metrics_public_v2.py b/candidate/generated/nimble_client/models/usage_metrics_public_v2.py new file mode 100644 index 0000000..de8c533 --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_metrics_public_v2.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageMetricsPublicV2(BaseModel): + """ + Usage figures. A metric a service does not measure is `null`, not 0. + """ # noqa: E501 + bytes_in: Optional[StrictInt] = Field(description="Request bytes sent; `null` when the service does not measure it.") + bytes_out: Optional[StrictInt] = Field(description="Response bytes received; `null` when the service does not measure it.") + cost_usd: Optional[StrictStr] = Field(description="Cost in US dollars, as a decimal string. Row costs are rounded to the cent per underlying bucket, so rows may not add up exactly to `totals.cost_usd`. `null` for accounts on fixed-price plans, whose spend isn't shown.") + errors: StrictInt = Field(description="Requests and runs that did not succeed.") + requests: Optional[StrictInt] = Field(description="Requests made; `null` for usage counted in runs only.") + runs: Optional[StrictInt] = Field(description="Web Search Agent runs; `null` for usage counted in requests only.") + success_rate: Optional[Union[StrictFloat, StrictInt]] = Field(description="`successes` divided by `requests` plus `runs`, 0 to 1; `null` when there were none.") + successes: StrictInt = Field(description="Successful requests and runs.") + __properties: ClassVar[List[str]] = ["bytes_in", "bytes_out", "cost_usd", "errors", "requests", "runs", "success_rate", "successes"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageMetricsPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if bytes_in (nullable) is None + # and model_fields_set contains the field + if self.bytes_in is None and "bytes_in" in self.model_fields_set: + _dict['bytes_in'] = None + + # set to None if bytes_out (nullable) is None + # and model_fields_set contains the field + if self.bytes_out is None and "bytes_out" in self.model_fields_set: + _dict['bytes_out'] = None + + # set to None if cost_usd (nullable) is None + # and model_fields_set contains the field + if self.cost_usd is None and "cost_usd" in self.model_fields_set: + _dict['cost_usd'] = None + + # set to None if requests (nullable) is None + # and model_fields_set contains the field + if self.requests is None and "requests" in self.model_fields_set: + _dict['requests'] = None + + # set to None if runs (nullable) is None + # and model_fields_set contains the field + if self.runs is None and "runs" in self.model_fields_set: + _dict['runs'] = None + + # set to None if success_rate (nullable) is None + # and model_fields_set contains the field + if self.success_rate is None and "success_rate" in self.model_fields_set: + _dict['success_rate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageMetricsPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bytes_in": obj.get("bytes_in"), + "bytes_out": obj.get("bytes_out"), + "cost_usd": obj.get("cost_usd"), + "errors": obj.get("errors"), + "requests": obj.get("requests"), + "runs": obj.get("runs"), + "success_rate": obj.get("success_rate"), + "successes": obj.get("successes") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_name_public_v2.py b/candidate/generated/nimble_client/models/usage_name_public_v2.py new file mode 100644 index 0000000..f370345 --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_name_public_v2.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageNamePublicV2(BaseModel): + """ + A catalog entry: its permanent key and its current display name. + """ # noqa: E501 + key: StrictStr = Field(description="Permanent key; use it in filters. Never changes.") + name: StrictStr = Field(description="Current display name. May change at any time.") + __properties: ClassVar[List[str]] = ["key", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageNamePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageNamePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "name": obj.get("name") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_response_public_v2.py b/candidate/generated/nimble_client/models/usage_response_public_v2.py new file mode 100644 index 0000000..7b6259b --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_response_public_v2.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from nimble_client.models.usage_meta_public_v2 import UsageMetaPublicV2 +from nimble_client.models.usage_metrics_public_v2 import UsageMetricsPublicV2 +from nimble_client.models.usage_row_public_v2 import UsageRowPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageResponsePublicV2(BaseModel): + """ + Usage of the calling account over a time range. + """ # noqa: E501 + data: List[UsageRowPublicV2] = Field(description="Rows, newest-bucket last, largest usage first within a bucket.") + meta: UsageMetaPublicV2 = Field(description="Range, granularity, freshness and row count of this response.") + totals: UsageMetricsPublicV2 = Field(description="Figures for the whole range and filters, across every row.") + __properties: ClassVar[List[str]] = ["data", "meta", "totals"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + _items.append(_item_data.to_dict() if _item_data is not None else None) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of totals + if self.totals: + _dict['totals'] = self.totals.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [UsageRowPublicV2.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "meta": UsageMetaPublicV2.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "totals": UsageMetricsPublicV2.from_dict(obj["totals"]) if obj.get("totals") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/usage_row_public_v2.py b/candidate/generated/nimble_client/models/usage_row_public_v2.py new file mode 100644 index 0000000..4b67a3d --- /dev/null +++ b/candidate/generated/nimble_client/models/usage_row_public_v2.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.usage_dimensions_public_v2 import UsageDimensionsPublicV2 +from nimble_client.models.usage_metrics_public_v2 import UsageMetricsPublicV2 +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsageRowPublicV2(BaseModel): + """ + Usage for one combination of the `group_by` dimensions. + """ # noqa: E501 + dimensions: UsageDimensionsPublicV2 = Field(description="Dimension values of this row.") + metrics: UsageMetricsPublicV2 = Field(description="Usage figures of this row.") + timestamp: Optional[datetime] = Field(default=None, description="Start of the time bucket (UTC). Present only when `group_by` includes `time`.") + __properties: ClassVar[List[str]] = ["dimensions", "metrics", "timestamp"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageRowPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of dimensions + if self.dimensions: + _dict['dimensions'] = self.dimensions.to_dict() + # override the default output from pydantic by calling `to_dict()` of metrics + if self.metrics: + _dict['metrics'] = self.metrics.to_dict() + # set to None if timestamp (nullable) is None + # and model_fields_set contains the field + if self.timestamp is None and "timestamp" in self.model_fields_set: + _dict['timestamp'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageRowPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "dimensions": UsageDimensionsPublicV2.from_dict(obj["dimensions"]) if obj.get("dimensions") is not None else None, + "metrics": UsageMetricsPublicV2.from_dict(obj["metrics"]) if obj.get("metrics") is not None else None, + "timestamp": obj.get("timestamp") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/validation_error.py b/candidate/generated/nimble_client/models/validation_error.py new file mode 100644 index 0000000..814f3fb --- /dev/null +++ b/candidate/generated/nimble_client/models/validation_error.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.location_inner import LocationInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ValidationError(BaseModel): + """ + ValidationError + """ # noqa: E501 + ctx: Optional[Dict[str, Any]] = None + input: Optional[Any] = None + loc: List[LocationInner] + msg: StrictStr + type: StrictStr + __properties: ClassVar[List[str]] = ["ctx", "input", "loc", "msg", "type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ValidationError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in loc (list) + _items = [] + if self.loc: + for _item_loc in self.loc: + _items.append(_item_loc.to_dict() if _item_loc is not None else None) + _dict['loc'] = _items + # set to None if input (nullable) is None + # and model_fields_set contains the field + if self.input is None and "input" in self.model_fields_set: + _dict['input'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ValidationError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ctx": obj.get("ctx"), + "input": obj.get("input"), + "loc": [LocationInner.from_dict(_item) for _item in obj["loc"]] if obj.get("loc") is not None else None, + "msg": obj.get("msg"), + "type": obj.get("type") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/visits.py b/candidate/generated/nimble_client/models/visits.py new file mode 100644 index 0000000..139325e --- /dev/null +++ b/candidate/generated/nimble_client/models/visits.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +VISITS_ANY_OF_SCHEMAS = ["float", "int"] + +class Visits(BaseModel): + """ + Visits + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: float + anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, int]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "float", "int" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = Visits.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in Visits with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into Visits with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/visits_monthly.py b/candidate/generated/nimble_client/models/visits_monthly.py new file mode 100644 index 0000000..65388d3 --- /dev/null +++ b/candidate/generated/nimble_client/models/visits_monthly.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +VISITSMONTHLY_ANY_OF_SCHEMAS = ["float", "int"] + +class VisitsMonthly(BaseModel): + """ + VisitsMonthly + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: float + anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, int]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "float", "int" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = VisitsMonthly.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in VisitsMonthly with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into VisitsMonthly with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/wait_action.py b/candidate/generated/nimble_client/models/wait_action.py new file mode 100644 index 0000000..8d52a07 --- /dev/null +++ b/candidate/generated/nimble_client/models/wait_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.wait_action_wait import WaitActionWait +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WaitAction(BaseModel): + """ + Wait for a specified duration + """ # noqa: E501 + wait: WaitActionWait + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["wait"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WaitAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of wait + if self.wait: + _dict['wait'] = self.wait.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WaitAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "wait": WaitActionWait.from_dict(obj["wait"]) if obj.get("wait") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/wait_action_wait.py b/candidate/generated/nimble_client/models/wait_action_wait.py new file mode 100644 index 0000000..016fbde --- /dev/null +++ b/candidate/generated/nimble_client/models/wait_action_wait.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.duration import Duration +from nimble_client.models.wait_action_wait_one_of import WaitActionWaitOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +WAITACTIONWAIT_ONE_OF_SCHEMAS = ["Duration", "WaitActionWaitOneOf"] + +class WaitActionWait(BaseModel): + """ + WaitActionWait + """ + # data type: Duration + oneof_schema_1_validator: Optional[Duration] = None + # data type: WaitActionWaitOneOf + oneof_schema_2_validator: Optional[WaitActionWaitOneOf] = None + actual_instance: Optional[Union[Duration, WaitActionWaitOneOf]] = None + one_of_schemas: Set[str] = { "Duration", "WaitActionWaitOneOf" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = WaitActionWait.model_construct() + error_messages = [] + match = 0 + # validate data type: Duration + if not isinstance(v, Duration): + error_messages.append(f"Error! Input type `{type(v)}` is not `Duration`") + else: + match += 1 + # validate data type: WaitActionWaitOneOf + if not isinstance(v, WaitActionWaitOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `WaitActionWaitOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in WaitActionWait with oneOf schemas: Duration, WaitActionWaitOneOf. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in WaitActionWait with oneOf schemas: Duration, WaitActionWaitOneOf. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into Duration + try: + instance.actual_instance = Duration.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WaitActionWaitOneOf + try: + instance.actual_instance = WaitActionWaitOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into WaitActionWait with oneOf schemas: Duration, WaitActionWaitOneOf. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into WaitActionWait with oneOf schemas: Duration, WaitActionWaitOneOf. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Duration, WaitActionWaitOneOf]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/wait_action_wait_one_of.py b/candidate/generated/nimble_client/models/wait_action_wait_one_of.py new file mode 100644 index 0000000..ccfae62 --- /dev/null +++ b/candidate/generated/nimble_client/models/wait_action_wait_one_of.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.duration import Duration +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WaitActionWaitOneOf(BaseModel): + """ + WaitActionWaitOneOf + """ # noqa: E501 + duration: Duration + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + __properties: ClassVar[List[str]] = ["duration", "required", "skip"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WaitActionWaitOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of duration + if self.duration: + _dict['duration'] = self.duration.to_dict() + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WaitActionWaitOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "duration": Duration.from_dict(obj["duration"]) if obj.get("duration") is not None else None, + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/wait_for_element_action.py b/candidate/generated/nimble_client/models/wait_for_element_action.py new file mode 100644 index 0000000..b2d9786 --- /dev/null +++ b/candidate/generated/nimble_client/models/wait_for_element_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.wait_for_element_action_wait_for_element import WaitForElementActionWaitForElement +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WaitForElementAction(BaseModel): + """ + Wait for an element to appear or reach a specific state + """ # noqa: E501 + wait_for_element: WaitForElementActionWaitForElement + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["wait_for_element"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WaitForElementAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of wait_for_element + if self.wait_for_element: + _dict['wait_for_element'] = self.wait_for_element.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WaitForElementAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "wait_for_element": WaitForElementActionWaitForElement.from_dict(obj["wait_for_element"]) if obj.get("wait_for_element") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/wait_for_element_action_wait_for_element.py b/candidate/generated/nimble_client/models/wait_for_element_action_wait_for_element.py new file mode 100644 index 0000000..512f8d7 --- /dev/null +++ b/candidate/generated/nimble_client/models/wait_for_element_action_wait_for_element.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.selector import Selector +from nimble_client.models.wait_for_element_action_wait_for_element_one_of import WaitForElementActionWaitForElementOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +WAITFORELEMENTACTIONWAITFORELEMENT_ONE_OF_SCHEMAS = ["Selector", "WaitForElementActionWaitForElementOneOf"] + +class WaitForElementActionWaitForElement(BaseModel): + """ + WaitForElementActionWaitForElement + """ + # data type: Selector + oneof_schema_1_validator: Optional[Selector] = None + # data type: WaitForElementActionWaitForElementOneOf + oneof_schema_2_validator: Optional[WaitForElementActionWaitForElementOneOf] = None + actual_instance: Optional[Union[Selector, WaitForElementActionWaitForElementOneOf]] = None + one_of_schemas: Set[str] = { "Selector", "WaitForElementActionWaitForElementOneOf" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = WaitForElementActionWaitForElement.model_construct() + error_messages = [] + match = 0 + # validate data type: Selector + if not isinstance(v, Selector): + error_messages.append(f"Error! Input type `{type(v)}` is not `Selector`") + else: + match += 1 + # validate data type: WaitForElementActionWaitForElementOneOf + if not isinstance(v, WaitForElementActionWaitForElementOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `WaitForElementActionWaitForElementOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in WaitForElementActionWaitForElement with oneOf schemas: Selector, WaitForElementActionWaitForElementOneOf. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in WaitForElementActionWaitForElement with oneOf schemas: Selector, WaitForElementActionWaitForElementOneOf. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into Selector + try: + instance.actual_instance = Selector.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WaitForElementActionWaitForElementOneOf + try: + instance.actual_instance = WaitForElementActionWaitForElementOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into WaitForElementActionWaitForElement with oneOf schemas: Selector, WaitForElementActionWaitForElementOneOf. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into WaitForElementActionWaitForElement with oneOf schemas: Selector, WaitForElementActionWaitForElementOneOf. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Selector, WaitForElementActionWaitForElementOneOf]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/wait_for_element_action_wait_for_element_one_of.py b/candidate/generated/nimble_client/models/wait_for_element_action_wait_for_element_one_of.py new file mode 100644 index 0000000..ec883c7 --- /dev/null +++ b/candidate/generated/nimble_client/models/wait_for_element_action_wait_for_element_one_of.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from nimble_client.models.selector import Selector +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WaitForElementActionWaitForElementOneOf(BaseModel): + """ + WaitForElementActionWaitForElementOneOf + """ # noqa: E501 + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + selector: Selector + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=15000, description="Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.") + visible: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["required", "selector", "skip", "timeout", "visible"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WaitForElementActionWaitForElementOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of selector + if self.selector: + _dict['selector'] = self.selector.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WaitForElementActionWaitForElementOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "selector": Selector.from_dict(obj["selector"]) if obj.get("selector") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "timeout": obj.get("timeout") if obj.get("timeout") is not None else 15000, + "visible": obj.get("visible") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/wait_for_navigation_action.py b/candidate/generated/nimble_client/models/wait_for_navigation_action.py new file mode 100644 index 0000000..59ccc2a --- /dev/null +++ b/candidate/generated/nimble_client/models/wait_for_navigation_action.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from nimble_client.models.wait_for_navigation_action_wait_for_navigation import WaitForNavigationActionWaitForNavigation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WaitForNavigationAction(BaseModel): + """ + Wait for page navigation to complete + """ # noqa: E501 + wait_for_navigation: WaitForNavigationActionWaitForNavigation + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["wait_for_navigation"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WaitForNavigationAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of wait_for_navigation + if self.wait_for_navigation: + _dict['wait_for_navigation'] = self.wait_for_navigation.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WaitForNavigationAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "wait_for_navigation": WaitForNavigationActionWaitForNavigation.from_dict(obj["wait_for_navigation"]) if obj.get("wait_for_navigation") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/candidate/generated/nimble_client/models/wait_for_navigation_action_wait_for_navigation.py b/candidate/generated/nimble_client/models/wait_for_navigation_action_wait_for_navigation.py new file mode 100644 index 0000000..43f3796 --- /dev/null +++ b/candidate/generated/nimble_client/models/wait_for_navigation_action_wait_for_navigation.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from nimble_client.models.wait_for_navigation_action_wait_for_navigation_one_of import WaitForNavigationActionWaitForNavigationOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +WAITFORNAVIGATIONACTIONWAITFORNAVIGATION_ONE_OF_SCHEMAS = ["WaitForNavigationActionWaitForNavigationOneOf", "str"] + +class WaitForNavigationActionWaitForNavigation(BaseModel): + """ + WaitForNavigationActionWaitForNavigation + """ + # data type: str + oneof_schema_1_validator: Optional[StrictStr] = None + # data type: WaitForNavigationActionWaitForNavigationOneOf + oneof_schema_2_validator: Optional[WaitForNavigationActionWaitForNavigationOneOf] = None + actual_instance: Optional[Union[WaitForNavigationActionWaitForNavigationOneOf, str]] = None + one_of_schemas: Set[str] = { "WaitForNavigationActionWaitForNavigationOneOf", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = WaitForNavigationActionWaitForNavigation.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: WaitForNavigationActionWaitForNavigationOneOf + if not isinstance(v, WaitForNavigationActionWaitForNavigationOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `WaitForNavigationActionWaitForNavigationOneOf`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in WaitForNavigationActionWaitForNavigation with oneOf schemas: WaitForNavigationActionWaitForNavigationOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in WaitForNavigationActionWaitForNavigation with oneOf schemas: WaitForNavigationActionWaitForNavigationOneOf, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into str + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into WaitForNavigationActionWaitForNavigationOneOf + try: + instance.actual_instance = WaitForNavigationActionWaitForNavigationOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into WaitForNavigationActionWaitForNavigation with oneOf schemas: WaitForNavigationActionWaitForNavigationOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into WaitForNavigationActionWaitForNavigation with oneOf schemas: WaitForNavigationActionWaitForNavigationOneOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], WaitForNavigationActionWaitForNavigationOneOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/wait_for_navigation_action_wait_for_navigation_one_of.py b/candidate/generated/nimble_client/models/wait_for_navigation_action_wait_for_navigation_one_of.py new file mode 100644 index 0000000..2b653c0 --- /dev/null +++ b/candidate/generated/nimble_client/models/wait_for_navigation_action_wait_for_navigation_one_of.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_required import AutoScrollActionAutoScrollOneOfRequired +from nimble_client.models.auto_scroll_action_auto_scroll_one_of_skip import AutoScrollActionAutoScrollOneOfSkip +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WaitForNavigationActionWaitForNavigationOneOf(BaseModel): + """ + WaitForNavigationActionWaitForNavigationOneOf + """ # noqa: E501 + navigation: StrictStr + required: Optional[AutoScrollActionAutoScrollOneOfRequired] = None + skip: Optional[AutoScrollActionAutoScrollOneOfSkip] = None + timeout: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=15000, description="Timeout in milliseconds. Set to 0 for infinite timeout (no timeout). Default: 15000ms.") + __properties: ClassVar[List[str]] = ["navigation", "required", "skip", "timeout"] + + @field_validator('navigation') + def navigation_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['load', 'domcontentloaded', 'networkidle0', 'networkidle2']): + raise ValueError("must be one of enum values ('load', 'domcontentloaded', 'networkidle0', 'networkidle2')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WaitForNavigationActionWaitForNavigationOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of required + if self.required: + _dict['required'] = self.required.to_dict() + # override the default output from pydantic by calling `to_dict()` of skip + if self.skip: + _dict['skip'] = self.skip.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WaitForNavigationActionWaitForNavigationOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "navigation": obj.get("navigation"), + "required": AutoScrollActionAutoScrollOneOfRequired.from_dict(obj["required"]) if obj.get("required") is not None else None, + "skip": AutoScrollActionAutoScrollOneOfSkip.from_dict(obj["skip"]) if obj.get("skip") is not None else None, + "timeout": obj.get("timeout") if obj.get("timeout") is not None else 15000 + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_create_request_public_v1.py b/candidate/generated/nimble_client/models/web_search_agent_create_request_public_v1.py new file mode 100644 index 0000000..6696a42 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_create_request_public_v1.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.agent_sources_public_v1 import AgentSourcesPublicV1 +from nimble_client.models.effort import Effort +from nimble_client.models.trust_mode import TrustMode +from nimble_client.models.web_search_agent_use_case import WebSearchAgentUseCase +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentCreateRequestPublicV1(BaseModel): + """ + WebSearchAgentCreateRequestPublicV1 + """ # noqa: E501 + agent_name: Optional[StrictStr] = Field(default=None, description="Stable agent name.") + description: Optional[StrictStr] = Field(default=None, description="Agent description shown to users.") + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly agent name shown to users.") + domain_expertise: Optional[StrictStr] = Field(default=None, description="Cursor for pagination.") + effort: Optional[Effort] = Field(default=None, description="Default effort level for this agent's runs.") + goals: Optional[List[StrictStr]] = Field(default=None, description="Ordered goals for the agent to follow.") + icon: Optional[StrictStr] = Field(default=None, description="Icon identifier used when presenting the agent.") + is_active: Optional[StrictBool] = Field(default=True, description="Whether the agent can be used to start new runs.") + output_schema: Optional[Dict[str, Any]] = Field(default=None, description="JSON schema describing the structured output the agent should produce.") + sources: Optional[AgentSourcesPublicV1] = Field(default=None, description="Source guidance for the agent.") + suggested_questions: Optional[List[StrictStr]] = Field(default=None, description="Suggested prompts users can run with this agent.") + template: Optional[StrictStr] = Field(default=None, description="Template name to materialize this instance from. When set, the scalar fields and child rows are copied from the template.") + trust_mode: Optional[TrustMode] = Field(default=None, description="Default trust mode for this agent's runs. no_trust (default; also what null means) skips trust and grounding; full_trust scores each value's confidence and checks it against its sources.") + use_case: Optional[WebSearchAgentUseCase] = Field(default=None, description="Primary use case supported by the agent.") + __properties: ClassVar[List[str]] = ["agent_name", "description", "display_name", "domain_expertise", "effort", "goals", "icon", "is_active", "output_schema", "sources", "suggested_questions", "template", "trust_mode", "use_case"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentCreateRequestPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of sources + if self.sources: + _dict['sources'] = self.sources.to_dict() + # set to None if agent_name (nullable) is None + # and model_fields_set contains the field + if self.agent_name is None and "agent_name" in self.model_fields_set: + _dict['agent_name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if domain_expertise (nullable) is None + # and model_fields_set contains the field + if self.domain_expertise is None and "domain_expertise" in self.model_fields_set: + _dict['domain_expertise'] = None + + # set to None if icon (nullable) is None + # and model_fields_set contains the field + if self.icon is None and "icon" in self.model_fields_set: + _dict['icon'] = None + + # set to None if output_schema (nullable) is None + # and model_fields_set contains the field + if self.output_schema is None and "output_schema" in self.model_fields_set: + _dict['output_schema'] = None + + # set to None if template (nullable) is None + # and model_fields_set contains the field + if self.template is None and "template" in self.model_fields_set: + _dict['template'] = None + + # set to None if use_case (nullable) is None + # and model_fields_set contains the field + if self.use_case is None and "use_case" in self.model_fields_set: + _dict['use_case'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentCreateRequestPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "domain_expertise": obj.get("domain_expertise"), + "effort": obj.get("effort"), + "goals": obj.get("goals"), + "icon": obj.get("icon"), + "is_active": obj.get("is_active") if obj.get("is_active") is not None else True, + "output_schema": obj.get("output_schema"), + "sources": AgentSourcesPublicV1.from_dict(obj["sources"]) if obj.get("sources") is not None else None, + "suggested_questions": obj.get("suggested_questions"), + "template": obj.get("template"), + "trust_mode": obj.get("trust_mode"), + "use_case": obj.get("use_case") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_create_request_public_v2.py b/candidate/generated/nimble_client/models/web_search_agent_create_request_public_v2.py new file mode 100644 index 0000000..c8d8303 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_create_request_public_v2.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.agent_sources_public_v2 import AgentSourcesPublicV2 +from nimble_client.models.effort import Effort +from nimble_client.models.trust_mode import TrustMode +from nimble_client.models.web_search_agent_use_case import WebSearchAgentUseCase +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentCreateRequestPublicV2(BaseModel): + """ + WebSearchAgentCreateRequestPublicV2 + """ # noqa: E501 + agent_name: Optional[StrictStr] = Field(default=None, description="Stable agent name.") + description: Optional[StrictStr] = Field(default=None, description="Agent description shown to users.") + display_name: Optional[StrictStr] = Field(default=None, description="Human-friendly agent name shown to users.") + effort: Optional[Effort] = Field(default=None, description="Default effort level for this agent's runs.") + goals: Optional[List[StrictStr]] = Field(default=None, description="Ordered goals for the agent to follow.") + icon: Optional[StrictStr] = Field(default=None, description="Icon identifier used when presenting the agent.") + is_active: Optional[StrictBool] = Field(default=True, description="Whether the agent can be used to start new runs.") + output_schema: Optional[Dict[str, Any]] = Field(default=None, description="JSON schema describing the structured output the agent should produce.") + skill: Optional[StrictStr] = Field(default=None, description="Skill or operating context for the agent.") + sources: Optional[AgentSourcesPublicV2] = Field(default=None, description="Source guidance for the agent.") + suggested_questions: Optional[List[StrictStr]] = Field(default=None, description="Suggested prompts users can run with this agent.") + template: Optional[StrictStr] = Field(default=None, description="Template name to materialize this instance from. When set, the scalar fields and child rows are copied from the template.") + trust_mode: Optional[TrustMode] = Field(default=None, description="Default trust mode for this agent's runs. no_trust (default; also what null means) skips trust and grounding; full_trust scores each value's confidence and checks it against its sources.") + use_case: Optional[WebSearchAgentUseCase] = Field(default=None, description="Primary use case supported by the agent.") + __properties: ClassVar[List[str]] = ["agent_name", "description", "display_name", "effort", "goals", "icon", "is_active", "output_schema", "skill", "sources", "suggested_questions", "template", "trust_mode", "use_case"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentCreateRequestPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of sources + if self.sources: + _dict['sources'] = self.sources.to_dict() + # set to None if agent_name (nullable) is None + # and model_fields_set contains the field + if self.agent_name is None and "agent_name" in self.model_fields_set: + _dict['agent_name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if display_name (nullable) is None + # and model_fields_set contains the field + if self.display_name is None and "display_name" in self.model_fields_set: + _dict['display_name'] = None + + # set to None if icon (nullable) is None + # and model_fields_set contains the field + if self.icon is None and "icon" in self.model_fields_set: + _dict['icon'] = None + + # set to None if output_schema (nullable) is None + # and model_fields_set contains the field + if self.output_schema is None and "output_schema" in self.model_fields_set: + _dict['output_schema'] = None + + # set to None if skill (nullable) is None + # and model_fields_set contains the field + if self.skill is None and "skill" in self.model_fields_set: + _dict['skill'] = None + + # set to None if template (nullable) is None + # and model_fields_set contains the field + if self.template is None and "template" in self.model_fields_set: + _dict['template'] = None + + # set to None if use_case (nullable) is None + # and model_fields_set contains the field + if self.use_case is None and "use_case" in self.model_fields_set: + _dict['use_case'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentCreateRequestPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "effort": obj.get("effort"), + "goals": obj.get("goals"), + "icon": obj.get("icon"), + "is_active": obj.get("is_active") if obj.get("is_active") is not None else True, + "output_schema": obj.get("output_schema"), + "skill": obj.get("skill"), + "sources": AgentSourcesPublicV2.from_dict(obj["sources"]) if obj.get("sources") is not None else None, + "suggested_questions": obj.get("suggested_questions"), + "template": obj.get("template"), + "trust_mode": obj.get("trust_mode"), + "use_case": obj.get("use_case") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_goal_response_public_v1.py b/candidate/generated/nimble_client/models/web_search_agent_goal_response_public_v1.py new file mode 100644 index 0000000..d3332d9 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_goal_response_public_v1.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentGoalResponsePublicV1(BaseModel): + """ + WebSearchAgentGoalResponsePublicV1 + """ # noqa: E501 + goal: StrictStr = Field(description="Goal text.") + id: StrictStr = Field(description="Unique goal identifier (wsag_).") + order: StrictInt = Field(description="Zero-based goal position.") + __properties: ClassVar[List[str]] = ["goal", "id", "order"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentGoalResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentGoalResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "goal": obj.get("goal"), + "id": obj.get("id"), + "order": obj.get("order") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_goal_response_public_v2.py b/candidate/generated/nimble_client/models/web_search_agent_goal_response_public_v2.py new file mode 100644 index 0000000..ce37dd1 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_goal_response_public_v2.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentGoalResponsePublicV2(BaseModel): + """ + WebSearchAgentGoalResponsePublicV2 + """ # noqa: E501 + goal: StrictStr = Field(description="Goal text.") + id: StrictStr = Field(description="Unique goal identifier (wsag_).") + order: StrictInt = Field(description="Zero-based goal position.") + __properties: ClassVar[List[str]] = ["goal", "id", "order"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentGoalResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentGoalResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "goal": obj.get("goal"), + "id": obj.get("id"), + "order": obj.get("order") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_response_public_v1.py b/candidate/generated/nimble_client/models/web_search_agent_response_public_v1.py new file mode 100644 index 0000000..9694a7f --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_response_public_v1.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.agent_sources_response_public_v1 import AgentSourcesResponsePublicV1 +from nimble_client.models.effort import Effort +from nimble_client.models.trust_mode import TrustMode +from nimble_client.models.web_search_agent_goal_response_public_v1 import WebSearchAgentGoalResponsePublicV1 +from nimble_client.models.web_search_agent_suggested_question_response_public_v1 import WebSearchAgentSuggestedQuestionResponsePublicV1 +from nimble_client.models.web_search_agent_use_case import WebSearchAgentUseCase +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentResponsePublicV1(BaseModel): + """ + WebSearchAgentResponsePublicV1 + """ # noqa: E501 + agent_name: Optional[StrictStr] = Field(default=None, description="Stable agent name.") + created_at: datetime = Field(description="When the agent was created.") + description: StrictStr = Field(description="Agent description shown to users.") + display_name: StrictStr = Field(description="Human-friendly agent name shown to users.") + domain_expertise: StrictStr = Field(description="Domain expertise or operating context for the agent.") + effort: Effort = Field(description="Default effort level for this agent's runs.") + goals: Optional[List[WebSearchAgentGoalResponsePublicV1]] = Field(default=None, description="Ordered goals for the agent to follow.") + icon: StrictStr = Field(description="Icon identifier used when presenting the agent.") + id: StrictStr = Field(description="Unique web search agent identifier (wsa_).") + is_active: StrictBool = Field(description="Whether the agent can be used to start new runs.") + output_schema: Optional[Dict[str, Any]] = Field(description="JSON schema describing the structured output the agent should produce.") + sources: AgentSourcesResponsePublicV1 = Field(description="Source guidance for the agent.") + suggested_questions: List[WebSearchAgentSuggestedQuestionResponsePublicV1] = Field(description="Suggested prompts users can run with this agent.") + trust_mode: TrustMode = Field(description="Default trust mode for this agent's runs.") + updated_at: datetime = Field(description="When the agent was last updated.") + use_case: WebSearchAgentUseCase = Field(description="Primary use case supported by the agent.") + __properties: ClassVar[List[str]] = ["agent_name", "created_at", "description", "display_name", "domain_expertise", "effort", "goals", "icon", "id", "is_active", "output_schema", "sources", "suggested_questions", "trust_mode", "updated_at", "use_case"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in goals (list) + _items = [] + if self.goals: + for _item_goals in self.goals: + _items.append(_item_goals.to_dict() if _item_goals is not None else None) + _dict['goals'] = _items + # override the default output from pydantic by calling `to_dict()` of sources + if self.sources: + _dict['sources'] = self.sources.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in suggested_questions (list) + _items = [] + if self.suggested_questions: + for _item_suggested_questions in self.suggested_questions: + _items.append(_item_suggested_questions.to_dict() if _item_suggested_questions is not None else None) + _dict['suggested_questions'] = _items + # set to None if agent_name (nullable) is None + # and model_fields_set contains the field + if self.agent_name is None and "agent_name" in self.model_fields_set: + _dict['agent_name'] = None + + # set to None if output_schema (nullable) is None + # and model_fields_set contains the field + if self.output_schema is None and "output_schema" in self.model_fields_set: + _dict['output_schema'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "domain_expertise": obj.get("domain_expertise"), + "effort": obj.get("effort"), + "goals": [WebSearchAgentGoalResponsePublicV1.from_dict(_item) for _item in obj["goals"]] if obj.get("goals") is not None else None, + "icon": obj.get("icon"), + "id": obj.get("id"), + "is_active": obj.get("is_active"), + "output_schema": obj.get("output_schema"), + "sources": AgentSourcesResponsePublicV1.from_dict(obj["sources"]) if obj.get("sources") is not None else None, + "suggested_questions": [WebSearchAgentSuggestedQuestionResponsePublicV1.from_dict(_item) for _item in obj["suggested_questions"]] if obj.get("suggested_questions") is not None else None, + "trust_mode": obj.get("trust_mode"), + "updated_at": obj.get("updated_at"), + "use_case": obj.get("use_case") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_response_public_v2.py b/candidate/generated/nimble_client/models/web_search_agent_response_public_v2.py new file mode 100644 index 0000000..5c7d7db --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_response_public_v2.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.agent_sources_response_public_v2 import AgentSourcesResponsePublicV2 +from nimble_client.models.effort import Effort +from nimble_client.models.trust_mode import TrustMode +from nimble_client.models.web_search_agent_goal_response_public_v2 import WebSearchAgentGoalResponsePublicV2 +from nimble_client.models.web_search_agent_suggested_question_response_public_v2 import WebSearchAgentSuggestedQuestionResponsePublicV2 +from nimble_client.models.web_search_agent_use_case import WebSearchAgentUseCase +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentResponsePublicV2(BaseModel): + """ + WebSearchAgentResponsePublicV2 + """ # noqa: E501 + agent_name: Optional[StrictStr] = Field(default=None, description="Stable agent name.") + created_at: datetime = Field(description="When the agent was created.") + description: StrictStr = Field(description="Agent description shown to users.") + display_name: StrictStr = Field(description="Human-friendly agent name shown to users.") + effort: Effort = Field(description="Default effort level for this agent's runs.") + goals: Optional[List[WebSearchAgentGoalResponsePublicV2]] = Field(default=None, description="Ordered goals for the agent to follow.") + icon: StrictStr = Field(description="Icon identifier used when presenting the agent.") + id: StrictStr = Field(description="Unique web search agent identifier (wsa_).") + is_active: StrictBool = Field(description="Whether the agent can be used to start new runs.") + output_schema: Optional[Dict[str, Any]] = Field(description="JSON schema describing the structured output the agent should produce.") + skill: StrictStr = Field(description="Skill or operating context for the agent.") + sources: AgentSourcesResponsePublicV2 = Field(description="Source guidance for the agent.") + suggested_questions: List[WebSearchAgentSuggestedQuestionResponsePublicV2] = Field(description="Suggested prompts users can run with this agent.") + trust_mode: TrustMode = Field(description="Default trust mode for this agent's runs.") + updated_at: datetime = Field(description="When the agent was last updated.") + use_case: WebSearchAgentUseCase = Field(description="Primary use case supported by the agent.") + __properties: ClassVar[List[str]] = ["agent_name", "created_at", "description", "display_name", "effort", "goals", "icon", "id", "is_active", "output_schema", "skill", "sources", "suggested_questions", "trust_mode", "updated_at", "use_case"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in goals (list) + _items = [] + if self.goals: + for _item_goals in self.goals: + _items.append(_item_goals.to_dict() if _item_goals is not None else None) + _dict['goals'] = _items + # override the default output from pydantic by calling `to_dict()` of sources + if self.sources: + _dict['sources'] = self.sources.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in suggested_questions (list) + _items = [] + if self.suggested_questions: + for _item_suggested_questions in self.suggested_questions: + _items.append(_item_suggested_questions.to_dict() if _item_suggested_questions is not None else None) + _dict['suggested_questions'] = _items + # set to None if agent_name (nullable) is None + # and model_fields_set contains the field + if self.agent_name is None and "agent_name" in self.model_fields_set: + _dict['agent_name'] = None + + # set to None if output_schema (nullable) is None + # and model_fields_set contains the field + if self.output_schema is None and "output_schema" in self.model_fields_set: + _dict['output_schema'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "effort": obj.get("effort"), + "goals": [WebSearchAgentGoalResponsePublicV2.from_dict(_item) for _item in obj["goals"]] if obj.get("goals") is not None else None, + "icon": obj.get("icon"), + "id": obj.get("id"), + "is_active": obj.get("is_active"), + "output_schema": obj.get("output_schema"), + "skill": obj.get("skill"), + "sources": AgentSourcesResponsePublicV2.from_dict(obj["sources"]) if obj.get("sources") is not None else None, + "suggested_questions": [WebSearchAgentSuggestedQuestionResponsePublicV2.from_dict(_item) for _item in obj["suggested_questions"]] if obj.get("suggested_questions") is not None else None, + "trust_mode": obj.get("trust_mode"), + "updated_at": obj.get("updated_at"), + "use_case": obj.get("use_case") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_run_create_request_public_v1.py b/candidate/generated/nimble_client/models/web_search_agent_run_create_request_public_v1.py new file mode 100644 index 0000000..72026fe --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_run_create_request_public_v1.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.agent_sources_public_v1 import AgentSourcesPublicV1 +from nimble_client.models.effort import Effort +from nimble_client.models.input_data import InputData +from nimble_client.models.trust_mode import TrustMode +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentRunCreateRequestPublicV1(BaseModel): + """ + WebSearchAgentRunCreateRequestPublicV1 + """ # noqa: E501 + effort: Optional[Effort] = Field(default=None, description="Effort level overriding the agent default for this run.") + enable_events: Optional[StrictBool] = Field(default=False, description="Whether to stream run events when supported.") + input: StrictStr = Field(description="User prompt or task instructions for the run.") + input_data: Optional[InputData] = None + output_schema: Optional[Dict[str, Any]] = Field(default=None, description="JSON schema overriding the agent's default structured output for this run.") + previous_interaction_id: Optional[StrictStr] = Field(default=None, description="Previous interaction identifier used to continue a conversation.") + sources: Optional[AgentSourcesPublicV1] = Field(default=None, description="Source guidance overriding the agent default.") + trust_mode: Optional[TrustMode] = Field(default=None, description="Per-run trust override. When unset, the run uses the agent's trust_mode, which defaults to no_trust (trust off). no_trust skips trust and grounding and returns `trust: null`; full_trust enables trust and grounding.") + __properties: ClassVar[List[str]] = ["effort", "enable_events", "input", "input_data", "output_schema", "previous_interaction_id", "sources", "trust_mode"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentRunCreateRequestPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of input_data + if self.input_data: + _dict['input_data'] = self.input_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of sources + if self.sources: + _dict['sources'] = self.sources.to_dict() + # set to None if effort (nullable) is None + # and model_fields_set contains the field + if self.effort is None and "effort" in self.model_fields_set: + _dict['effort'] = None + + # set to None if input_data (nullable) is None + # and model_fields_set contains the field + if self.input_data is None and "input_data" in self.model_fields_set: + _dict['input_data'] = None + + # set to None if output_schema (nullable) is None + # and model_fields_set contains the field + if self.output_schema is None and "output_schema" in self.model_fields_set: + _dict['output_schema'] = None + + # set to None if previous_interaction_id (nullable) is None + # and model_fields_set contains the field + if self.previous_interaction_id is None and "previous_interaction_id" in self.model_fields_set: + _dict['previous_interaction_id'] = None + + # set to None if sources (nullable) is None + # and model_fields_set contains the field + if self.sources is None and "sources" in self.model_fields_set: + _dict['sources'] = None + + # set to None if trust_mode (nullable) is None + # and model_fields_set contains the field + if self.trust_mode is None and "trust_mode" in self.model_fields_set: + _dict['trust_mode'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentRunCreateRequestPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "effort": obj.get("effort"), + "enable_events": obj.get("enable_events") if obj.get("enable_events") is not None else False, + "input": obj.get("input"), + "input_data": InputData.from_dict(obj["input_data"]) if obj.get("input_data") is not None else None, + "output_schema": obj.get("output_schema"), + "previous_interaction_id": obj.get("previous_interaction_id"), + "sources": AgentSourcesPublicV1.from_dict(obj["sources"]) if obj.get("sources") is not None else None, + "trust_mode": obj.get("trust_mode") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_run_create_request_public_v2.py b/candidate/generated/nimble_client/models/web_search_agent_run_create_request_public_v2.py new file mode 100644 index 0000000..8a8b9f3 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_run_create_request_public_v2.py @@ -0,0 +1,182 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.agent_sources_public_v2 import AgentSourcesPublicV2 +from nimble_client.models.effort import Effort +from nimble_client.models.input_data import InputData +from nimble_client.models.trust_mode import TrustMode +from nimble_client.models.web_search_agent_run_memory_config_public_v2 import WebSearchAgentRunMemoryConfigPublicV2 +from nimble_client.models.web_search_agent_use_case import WebSearchAgentUseCase +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentRunCreateRequestPublicV2(BaseModel): + """ + WebSearchAgentRunCreateRequestPublicV2 + """ # noqa: E501 + agent_name: Optional[StrictStr] = Field(default=None, description="Stable agent name. On this no-agent-id route, an unseen name creates a new agent; an existing name reuses it. Ignored on the /{agent_id}/runs route.") + effort: Optional[Effort] = Field(default=None, description="Effort level overriding the agent default for this run.") + enable_events: Optional[StrictBool] = Field(default=False, description="Whether to stream run events when supported.") + input: StrictStr = Field(description="User prompt or task instructions for the run.") + input_data: Optional[InputData] = None + memory: Optional[WebSearchAgentRunMemoryConfigPublicV2] = Field(default=None, description="Memory settings for this run. Not yet available to every account.") + origin: Optional[StrictStr] = Field(default='api', description="Origin of public API runs. Public requests are always API-originated.") + output_schema: Optional[Dict[str, Any]] = Field(default=None, description="JSON schema overriding the agent's default structured output for this run.") + previous_interaction_id: Optional[StrictStr] = Field(default=None, description="Previous interaction identifier used to continue a conversation.") + skill: Optional[StrictStr] = Field(default=None, description="Skill override for this run. One-time only, except when this run creates a new agent via agent_name, in which case it becomes the new agent's stored skill.") + sources: Optional[AgentSourcesPublicV2] = Field(default=None, description="Source guidance overriding the agent default.") + trust_mode: Optional[TrustMode] = Field(default=None, description="Per-run trust override. When unset, the run uses the agent's trust_mode, which defaults to no_trust (trust off). no_trust skips trust and grounding and returns `trust: null`; full_trust enables trust and grounding.") + use_case: Optional[WebSearchAgentUseCase] = Field(default=None, description="Only settable when this run creates a new agent (via agent_name, or when no agent is resolved), in which case it becomes the new agent's stored use_case. For a run against an existing agent, this must match the agent's own use_case — passing the same value is accepted as a no-op, a different value is rejected.") + __properties: ClassVar[List[str]] = ["agent_name", "effort", "enable_events", "input", "input_data", "memory", "origin", "output_schema", "previous_interaction_id", "skill", "sources", "trust_mode", "use_case"] + + @field_validator('origin') + def origin_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['api']): + raise ValueError("must be one of enum values ('api')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentRunCreateRequestPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of input_data + if self.input_data: + _dict['input_data'] = self.input_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of memory + if self.memory: + _dict['memory'] = self.memory.to_dict() + # override the default output from pydantic by calling `to_dict()` of sources + if self.sources: + _dict['sources'] = self.sources.to_dict() + # set to None if agent_name (nullable) is None + # and model_fields_set contains the field + if self.agent_name is None and "agent_name" in self.model_fields_set: + _dict['agent_name'] = None + + # set to None if effort (nullable) is None + # and model_fields_set contains the field + if self.effort is None and "effort" in self.model_fields_set: + _dict['effort'] = None + + # set to None if input_data (nullable) is None + # and model_fields_set contains the field + if self.input_data is None and "input_data" in self.model_fields_set: + _dict['input_data'] = None + + # set to None if output_schema (nullable) is None + # and model_fields_set contains the field + if self.output_schema is None and "output_schema" in self.model_fields_set: + _dict['output_schema'] = None + + # set to None if previous_interaction_id (nullable) is None + # and model_fields_set contains the field + if self.previous_interaction_id is None and "previous_interaction_id" in self.model_fields_set: + _dict['previous_interaction_id'] = None + + # set to None if skill (nullable) is None + # and model_fields_set contains the field + if self.skill is None and "skill" in self.model_fields_set: + _dict['skill'] = None + + # set to None if sources (nullable) is None + # and model_fields_set contains the field + if self.sources is None and "sources" in self.model_fields_set: + _dict['sources'] = None + + # set to None if trust_mode (nullable) is None + # and model_fields_set contains the field + if self.trust_mode is None and "trust_mode" in self.model_fields_set: + _dict['trust_mode'] = None + + # set to None if use_case (nullable) is None + # and model_fields_set contains the field + if self.use_case is None and "use_case" in self.model_fields_set: + _dict['use_case'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentRunCreateRequestPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name"), + "effort": obj.get("effort"), + "enable_events": obj.get("enable_events") if obj.get("enable_events") is not None else False, + "input": obj.get("input"), + "input_data": InputData.from_dict(obj["input_data"]) if obj.get("input_data") is not None else None, + "memory": WebSearchAgentRunMemoryConfigPublicV2.from_dict(obj["memory"]) if obj.get("memory") is not None else None, + "origin": obj.get("origin") if obj.get("origin") is not None else 'api', + "output_schema": obj.get("output_schema"), + "previous_interaction_id": obj.get("previous_interaction_id"), + "skill": obj.get("skill"), + "sources": AgentSourcesPublicV2.from_dict(obj["sources"]) if obj.get("sources") is not None else None, + "trust_mode": obj.get("trust_mode"), + "use_case": obj.get("use_case") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_run_memory_config_public_v2.py b/candidate/generated/nimble_client/models/web_search_agent_run_memory_config_public_v2.py new file mode 100644 index 0000000..a1f0f42 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_run_memory_config_public_v2.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentRunMemoryConfigPublicV2(BaseModel): + """ + WebSearchAgentRunMemoryConfigPublicV2 + """ # noqa: E501 + enabled: Optional[StrictBool] = Field(default=False, description="Whether the run loads the agent's published memory.") + __properties: ClassVar[List[str]] = ["enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentRunMemoryConfigPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentRunMemoryConfigPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "enabled": obj.get("enabled") if obj.get("enabled") is not None else False + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_source_create_request_public_v1.py b/candidate/generated/nimble_client/models/web_search_agent_source_create_request_public_v1.py new file mode 100644 index 0000000..9568a74 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_source_create_request_public_v1.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentSourceCreateRequestPublicV1(BaseModel): + """ + WebSearchAgentSourceCreateRequestPublicV1 + """ # noqa: E501 + domains: List[StrictStr] = Field(description="Domains included in this source group.") + order: Optional[StrictInt] = Field(default=0, description="Zero-based source group position.") + title: StrictStr = Field(description="Source group title.") + __properties: ClassVar[List[str]] = ["domains", "order", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentSourceCreateRequestPublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentSourceCreateRequestPublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "domains": obj.get("domains"), + "order": obj.get("order") if obj.get("order") is not None else 0, + "title": obj.get("title") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_source_create_request_public_v2.py b/candidate/generated/nimble_client/models/web_search_agent_source_create_request_public_v2.py new file mode 100644 index 0000000..bfc013b --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_source_create_request_public_v2.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentSourceCreateRequestPublicV2(BaseModel): + """ + WebSearchAgentSourceCreateRequestPublicV2 + """ # noqa: E501 + domains: List[StrictStr] = Field(description="Domains included in this source group.") + order: Optional[StrictInt] = Field(default=0, description="Zero-based source group position.") + title: StrictStr = Field(description="Source group title.") + __properties: ClassVar[List[str]] = ["domains", "order", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentSourceCreateRequestPublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentSourceCreateRequestPublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "domains": obj.get("domains"), + "order": obj.get("order") if obj.get("order") is not None else 0, + "title": obj.get("title") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_source_response_public_v1.py b/candidate/generated/nimble_client/models/web_search_agent_source_response_public_v1.py new file mode 100644 index 0000000..bfb3317 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_source_response_public_v1.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentSourceResponsePublicV1(BaseModel): + """ + WebSearchAgentSourceResponsePublicV1 + """ # noqa: E501 + domains: List[StrictStr] = Field(description="Domains included in this source group.") + id: StrictStr = Field(description="Unique source group identifier (wsas_).") + order: StrictInt = Field(description="Zero-based source group position.") + title: StrictStr = Field(description="Source group title.") + __properties: ClassVar[List[str]] = ["domains", "id", "order", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentSourceResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentSourceResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "domains": obj.get("domains"), + "id": obj.get("id"), + "order": obj.get("order"), + "title": obj.get("title") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_source_response_public_v2.py b/candidate/generated/nimble_client/models/web_search_agent_source_response_public_v2.py new file mode 100644 index 0000000..3055375 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_source_response_public_v2.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentSourceResponsePublicV2(BaseModel): + """ + WebSearchAgentSourceResponsePublicV2 + """ # noqa: E501 + domains: List[StrictStr] = Field(description="Domains included in this source group.") + id: StrictStr = Field(description="Unique source group identifier (wsas_).") + order: StrictInt = Field(description="Zero-based source group position.") + title: StrictStr = Field(description="Source group title.") + __properties: ClassVar[List[str]] = ["domains", "id", "order", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentSourceResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentSourceResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "domains": obj.get("domains"), + "id": obj.get("id"), + "order": obj.get("order"), + "title": obj.get("title") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_suggested_question_response_public_v1.py b/candidate/generated/nimble_client/models/web_search_agent_suggested_question_response_public_v1.py new file mode 100644 index 0000000..637ff74 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_suggested_question_response_public_v1.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentSuggestedQuestionResponsePublicV1(BaseModel): + """ + WebSearchAgentSuggestedQuestionResponsePublicV1 + """ # noqa: E501 + id: StrictStr = Field(description="Unique suggested question identifier (wsasq_).") + order: StrictInt = Field(description="Zero-based suggested question position.") + question: StrictStr = Field(description="Suggested prompt text.") + __properties: ClassVar[List[str]] = ["id", "order", "question"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentSuggestedQuestionResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentSuggestedQuestionResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "order": obj.get("order"), + "question": obj.get("question") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_suggested_question_response_public_v2.py b/candidate/generated/nimble_client/models/web_search_agent_suggested_question_response_public_v2.py new file mode 100644 index 0000000..1389f23 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_suggested_question_response_public_v2.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentSuggestedQuestionResponsePublicV2(BaseModel): + """ + WebSearchAgentSuggestedQuestionResponsePublicV2 + """ # noqa: E501 + id: StrictStr = Field(description="Unique suggested question identifier (wsasq_).") + order: StrictInt = Field(description="Zero-based suggested question position.") + question: StrictStr = Field(description="Suggested prompt text.") + __properties: ClassVar[List[str]] = ["id", "order", "question"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentSuggestedQuestionResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentSuggestedQuestionResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "order": obj.get("order"), + "question": obj.get("question") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_template_response_public_v1.py b/candidate/generated/nimble_client/models/web_search_agent_template_response_public_v1.py new file mode 100644 index 0000000..7e11bb1 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_template_response_public_v1.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.effort import Effort +from nimble_client.models.web_search_agent_goal_response_public_v1 import WebSearchAgentGoalResponsePublicV1 +from nimble_client.models.web_search_agent_source_response_public_v1 import WebSearchAgentSourceResponsePublicV1 +from nimble_client.models.web_search_agent_suggested_question_response_public_v1 import WebSearchAgentSuggestedQuestionResponsePublicV1 +from nimble_client.models.web_search_agent_use_case import WebSearchAgentUseCase +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentTemplateResponsePublicV1(BaseModel): + """ + WebSearchAgentTemplateResponsePublicV1 + """ # noqa: E501 + created_at: datetime = Field(description="When the template was created.") + description: StrictStr = Field(description="Template description shown to users.") + display_name: StrictStr = Field(description="Human-friendly template name shown to users.") + domain_expertise: StrictStr = Field(description="Domain expertise or operating context for the template.") + effort: Effort = Field(description="Default effort level for runs created from this template.") + goals: Optional[List[WebSearchAgentGoalResponsePublicV1]] = Field(default=None, description="Ordered goals for the template.") + icon: StrictStr = Field(description="Icon identifier used when presenting the template.") + id: StrictStr = Field(description="Unique template identifier (wsat_).") + output_schema: Optional[Dict[str, Any]] = Field(description="JSON schema describing the structured output the agent should produce.") + sources: List[WebSearchAgentSourceResponsePublicV1] = Field(description="Ordered source groups for the template.") + suggested_questions: List[WebSearchAgentSuggestedQuestionResponsePublicV1] = Field(description="Suggested prompts for the template.") + template_name: StrictStr = Field(description="Stable template name used to create agent instances.") + updated_at: datetime = Field(description="When the template was last updated.") + use_case: WebSearchAgentUseCase = Field(description="Primary use case supported by the template.") + __properties: ClassVar[List[str]] = ["created_at", "description", "display_name", "domain_expertise", "effort", "goals", "icon", "id", "output_schema", "sources", "suggested_questions", "template_name", "updated_at", "use_case"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentTemplateResponsePublicV1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in goals (list) + _items = [] + if self.goals: + for _item_goals in self.goals: + _items.append(_item_goals.to_dict() if _item_goals is not None else None) + _dict['goals'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in suggested_questions (list) + _items = [] + if self.suggested_questions: + for _item_suggested_questions in self.suggested_questions: + _items.append(_item_suggested_questions.to_dict() if _item_suggested_questions is not None else None) + _dict['suggested_questions'] = _items + # set to None if output_schema (nullable) is None + # and model_fields_set contains the field + if self.output_schema is None and "output_schema" in self.model_fields_set: + _dict['output_schema'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentTemplateResponsePublicV1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "domain_expertise": obj.get("domain_expertise"), + "effort": obj.get("effort"), + "goals": [WebSearchAgentGoalResponsePublicV1.from_dict(_item) for _item in obj["goals"]] if obj.get("goals") is not None else None, + "icon": obj.get("icon"), + "id": obj.get("id"), + "output_schema": obj.get("output_schema"), + "sources": [WebSearchAgentSourceResponsePublicV1.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "suggested_questions": [WebSearchAgentSuggestedQuestionResponsePublicV1.from_dict(_item) for _item in obj["suggested_questions"]] if obj.get("suggested_questions") is not None else None, + "template_name": obj.get("template_name"), + "updated_at": obj.get("updated_at"), + "use_case": obj.get("use_case") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_template_response_public_v2.py b/candidate/generated/nimble_client/models/web_search_agent_template_response_public_v2.py new file mode 100644 index 0000000..872b0c1 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_template_response_public_v2.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.effort import Effort +from nimble_client.models.web_search_agent_goal_response_public_v2 import WebSearchAgentGoalResponsePublicV2 +from nimble_client.models.web_search_agent_source_response_public_v2 import WebSearchAgentSourceResponsePublicV2 +from nimble_client.models.web_search_agent_suggested_question_response_public_v2 import WebSearchAgentSuggestedQuestionResponsePublicV2 +from nimble_client.models.web_search_agent_use_case import WebSearchAgentUseCase +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebSearchAgentTemplateResponsePublicV2(BaseModel): + """ + WebSearchAgentTemplateResponsePublicV2 + """ # noqa: E501 + created_at: datetime = Field(description="When the template was created.") + description: StrictStr = Field(description="Template description shown to users.") + display_name: StrictStr = Field(description="Human-friendly template name shown to users.") + effort: Effort = Field(description="Default effort level for runs created from this template.") + goals: Optional[List[WebSearchAgentGoalResponsePublicV2]] = Field(default=None, description="Ordered goals for the template.") + icon: StrictStr = Field(description="Icon identifier used when presenting the template.") + id: StrictStr = Field(description="Unique template identifier (wsat_).") + output_schema: Optional[Dict[str, Any]] = Field(description="JSON schema describing the structured output the agent should produce.") + skill: StrictStr = Field(description="Skill or operating context for the template.") + sources: List[WebSearchAgentSourceResponsePublicV2] = Field(description="Ordered source groups for the template.") + suggested_questions: List[WebSearchAgentSuggestedQuestionResponsePublicV2] = Field(description="Suggested prompts for the template.") + template_name: StrictStr = Field(description="Stable template name used to create agent instances.") + updated_at: datetime = Field(description="When the template was last updated.") + use_case: WebSearchAgentUseCase = Field(description="Primary use case supported by the template.") + __properties: ClassVar[List[str]] = ["created_at", "description", "display_name", "effort", "goals", "icon", "id", "output_schema", "skill", "sources", "suggested_questions", "template_name", "updated_at", "use_case"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebSearchAgentTemplateResponsePublicV2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in goals (list) + _items = [] + if self.goals: + for _item_goals in self.goals: + _items.append(_item_goals.to_dict() if _item_goals is not None else None) + _dict['goals'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + _items.append(_item_sources.to_dict() if _item_sources is not None else None) + _dict['sources'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in suggested_questions (list) + _items = [] + if self.suggested_questions: + for _item_suggested_questions in self.suggested_questions: + _items.append(_item_suggested_questions.to_dict() if _item_suggested_questions is not None else None) + _dict['suggested_questions'] = _items + # set to None if output_schema (nullable) is None + # and model_fields_set contains the field + if self.output_schema is None and "output_schema" in self.model_fields_set: + _dict['output_schema'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebSearchAgentTemplateResponsePublicV2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "display_name": obj.get("display_name"), + "effort": obj.get("effort"), + "goals": [WebSearchAgentGoalResponsePublicV2.from_dict(_item) for _item in obj["goals"]] if obj.get("goals") is not None else None, + "icon": obj.get("icon"), + "id": obj.get("id"), + "output_schema": obj.get("output_schema"), + "skill": obj.get("skill"), + "sources": [WebSearchAgentSourceResponsePublicV2.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None, + "suggested_questions": [WebSearchAgentSuggestedQuestionResponsePublicV2.from_dict(_item) for _item in obj["suggested_questions"]] if obj.get("suggested_questions") is not None else None, + "template_name": obj.get("template_name"), + "updated_at": obj.get("updated_at"), + "use_case": obj.get("use_case") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/web_search_agent_use_case.py b/candidate/generated/nimble_client/models/web_search_agent_use_case.py new file mode 100644 index 0000000..cde56db --- /dev/null +++ b/candidate/generated/nimble_client/models/web_search_agent_use_case.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class WebSearchAgentUseCase(str, Enum): + """ + WebSearchAgentUseCase + """ + + """ + allowed enum values + """ + RESEARCH = 'research' + ENRICHMENT = 'enrichment' + DATASET_BUILDING = 'dataset_building' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WebSearchAgentUseCase from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/candidate/generated/nimble_client/models/web_traffic_month.py b/candidate/generated/nimble_client/models/web_traffic_month.py new file mode 100644 index 0000000..8bf10b8 --- /dev/null +++ b/candidate/generated/nimble_client/models/web_traffic_month.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from nimble_client.models.visits import Visits +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebTrafficMonth(BaseModel): + """ + WebTrafficMonth + """ # noqa: E501 + month: Optional[StrictStr] = Field(default=None, description="YYYY-MM") + visits: Optional[Visits] = None + __properties: ClassVar[List[str]] = ["month", "visits"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebTrafficMonth from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of visits + if self.visits: + _dict['visits'] = self.visits.to_dict() + # set to None if month (nullable) is None + # and model_fields_set contains the field + if self.month is None and "month" in self.model_fields_set: + _dict['month'] = None + + # set to None if visits (nullable) is None + # and model_fields_set contains the field + if self.visits is None and "visits" in self.model_fields_set: + _dict['visits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebTrafficMonth from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "month": obj.get("month"), + "visits": Visits.from_dict(obj["visits"]) if obj.get("visits") is not None else None + }) + return _obj + + diff --git a/candidate/generated/nimble_client/models/workforce_total.py b/candidate/generated/nimble_client/models/workforce_total.py new file mode 100644 index 0000000..f087b0a --- /dev/null +++ b/candidate/generated/nimble_client/models/workforce_total.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator +from typing import Optional, Union +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +WORKFORCETOTAL_ANY_OF_SCHEMAS = ["float", "int"] + +class WorkforceTotal(BaseModel): + """ + Employee count + """ + + # data type: int + anyof_schema_1_validator: Optional[StrictInt] = None + # data type: float + anyof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[float, int]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "float", "int" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + if v is None: + return v + + instance = WorkforceTotal.model_construct() + error_messages = [] + # validate data type: int + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: float + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in WorkforceTotal with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + if json_str is None: + return instance + + error_messages = [] + # deserialize data into int + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into float + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into WorkforceTotal with anyOf schemas: float, int. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/candidate/generated/nimble_client/models/wsa_metadata.py b/candidate/generated/nimble_client/models/wsa_metadata.py new file mode 100644 index 0000000..afe3b37 --- /dev/null +++ b/candidate/generated/nimble_client/models/wsa_metadata.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WSAMetadata(BaseModel): + """ + Metadata for WSA-based search results. + """ # noqa: E501 + agent_name: StrictStr + __properties: ClassVar[List[str]] = ["agent_name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WSAMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WSAMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent_name": obj.get("agent_name") + }) + return _obj + + diff --git a/candidate/generated/nimble_client/py.typed b/candidate/generated/nimble_client/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/candidate/generated/nimble_client/rest.py b/candidate/generated/nimble_client/rest.py new file mode 100644 index 0000000..f8a1d66 --- /dev/null +++ b/candidate/generated/nimble_client/rest.py @@ -0,0 +1,334 @@ +# coding: utf-8 + +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import ipaddress +import io +import json +import re +import ssl +from urllib.parse import urlparse + +import urllib3 + +from nimble_client.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + +def contenttype_matches(contenttype, maintype, subtype): + """Matches the given contenttype against the given type and subtype + + :param contenttype: the content type to match + :param maintype: the expected maintype + :param subtype: the expected subtype + :return: `true` when the given content type matches the given type and subtype, + regardless of the presence of mime type parameters, otherwise returns `false`. + :rtype: bool + """ + pattern = '{type}/(?:[^+;]+\\+)?{subtype}(?:[ \t]*;.*)?'.format( + type = re.escape(maintype), + subtype = re.escape(subtype), + ) + return re.fullmatch(pattern, contenttype, re.IGNORECASE) is not None + +def should_bypass_proxies(url: str, no_proxy: str) -> bool: + """Return whether ``url`` matches the comma-separated ``no_proxy`` rules.""" + parsed_url = urlparse(url) + if not parsed_url.hostname: + return True + + host = parsed_url.hostname.lower() + host_and_port = parsed_url.netloc.lower() + try: + host_ip = ipaddress.ip_address(host) + except ValueError: + host_ip = None + + for entry in (entry.strip().lower() for entry in no_proxy.split(',')): + if not entry: + continue + if entry == '*': + return True + + if host_ip is not None: + try: + if host_ip in ipaddress.ip_network(entry, strict=False): + return True + except ValueError: + pass + + entry = entry.lstrip('.') + if ( + host == entry + or host.endswith('.' + entry) + or host_and_port == entry + or host_and_port.endswith('.' + entry) + ): + return True + + return False + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + @property + def headers(self): + """Returns a dictionary of response headers.""" + return self.response.headers + + def getheaders(self): + """Returns a dictionary of the response headers; use ``headers`` instead.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header; use ``headers.get()`` instead.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy and not should_bypass_proxies( + configuration.host, configuration.no_proxy or '' + ): + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + if configuration.proxy_ssl_context is not None: + pool_args["proxy_ssl_context"] = configuration.proxy_ssl_context + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = urllib3.HTTPHeaderDict(headers or {}) + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + content_type = headers.get('Content-Type') + is_json = ( + not content_type + or contenttype_matches(content_type, 'application', 'json') + ) + # JSON is valid YAML 1.2, so structured YAML bodies can use + # the existing JSON serializer: + # https://yaml.org/spec/1.2.2/#13-relation-to-json + is_structured_yaml = ( + content_type + and ( + contenttype_matches(content_type, 'application', 'yaml') + or contenttype_matches(content_type, 'text', 'yaml') + or contenttype_matches(content_type, 'text', 'x-yaml') + ) + and not isinstance(body, (str, bytes)) + ) + if is_json or is_structured_yaml: + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif contenttype_matches(content_type, 'application', 'x-www-form-urlencoded'): + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif contenttype_matches(content_type, 'multipart', 'form-data'): + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type.startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/candidate/generated/pyproject.toml b/candidate/generated/pyproject.toml new file mode 100644 index 0000000..e2e31d7 --- /dev/null +++ b/candidate/generated/pyproject.toml @@ -0,0 +1,93 @@ +[project] +name = "nimble_client" +version = "1.0.0" +description = "API Gateway" +authors = [ + {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, +] +readme = "README.md" +keywords = ["OpenAPI", "OpenAPI-Generator", "API Gateway"] +requires-python = ">=3.11" + +dependencies = [ + "urllib3 (>=2.7.0,<3.0.0)", + "python-dateutil (>=2.8.2)", + "pydantic (>=2.11)", + "typing-extensions (>=4.7.1)", +] + +[project.urls] +Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" + +[dependency-groups] +dev = [ + "pytest>=9.0.3", + "pytest-cov>=2.8.1", + "tox>=3.9.0", + "flake8>=4.0.0", + "types-python-dateutil>=2.8.19.14", + "mypy>=1.5", +] + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "nimble_client", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +extra_checks = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "nimble_client.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/candidate/generated/requirements.txt b/candidate/generated/requirements.txt new file mode 100644 index 0000000..1d751a9 --- /dev/null +++ b/candidate/generated/requirements.txt @@ -0,0 +1,4 @@ +urllib3 >= 2.7.0, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2.11 +typing-extensions >= 4.7.1 diff --git a/candidate/generated/setup.cfg b/candidate/generated/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/candidate/generated/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/candidate/generated/setup.py b/candidate/generated/setup.py new file mode 100644 index 0000000..45743cc --- /dev/null +++ b/candidate/generated/setup.py @@ -0,0 +1,47 @@ +""" + API Gateway + + Nimble API + + The version of the OpenAPI document: 2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "nimble-client" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">= 3.11" +REQUIRES = [ + "urllib3 >= 2.7.0, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2.11", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="API Gateway", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "API Gateway"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + Nimble API + """, # noqa: E501 + package_data={"nimble_client": ["py.typed"]}, +) diff --git a/candidate/generated/test-requirements.txt b/candidate/generated/test-requirements.txt new file mode 100644 index 0000000..9cb0629 --- /dev/null +++ b/candidate/generated/test-requirements.txt @@ -0,0 +1,6 @@ +pytest >= 9.0.3 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 diff --git a/candidate/generated/tox.ini b/candidate/generated/tox.ini new file mode 100644 index 0000000..5c2af4f --- /dev/null +++ b/candidate/generated/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=nimble_client From 8443aada71d305278ff3562fc78ea11a5e670d7b Mon Sep 17 00:00:00 2001 From: omermorad Date: Sun, 22 Nov 2026 10:02:44 +0200 Subject: [PATCH 2/3] fix(ci): exclude generated candidate from root lint --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index af55faf..6a35251 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -136,6 +136,7 @@ exclude = [ ".venv", ".nox", ".git", + "candidate/generated", ] reportImplicitOverride = true @@ -154,7 +155,7 @@ show_error_codes = true # # We also exclude our `tests` as mypy doesn't always infer # types correctly and Pyright will still catch any type errors. -exclude = ["src/nimble_python/_files.py", "_dev/.*.py", "tests/.*"] +exclude = ["src/nimble_python/_files.py", "_dev/.*.py", "tests/.*", "candidate/.*"] strict_equality = true implicit_reexport = true @@ -197,6 +198,7 @@ ignore_missing_imports = true [tool.ruff] +extend-exclude = ["candidate/generated"] line-length = 120 output-format = "grouped" target-version = "py38" From c083b9081d66ce25c9ce584be6987708747e136c Mon Sep 17 00:00:00 2001 From: omermorad Date: Sun, 22 Nov 2026 10:04:22 +0200 Subject: [PATCH 3/3] ci(sdk): build and install Python candidate wheel --- .github/workflows/sdk-candidate.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/sdk-candidate.yml b/.github/workflows/sdk-candidate.yml index 281bf5a..fb732a8 100644 --- a/.github/workflows/sdk-candidate.yml +++ b/.github/workflows/sdk-candidate.yml @@ -14,6 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: '3.12' - name: Verify frozen SDK input run: echo '283b1079b67453be6e8f06ccd3bf9955fedd553a9ab881e3f1f3904467d87cca candidate/contract/openapi.yaml' | sha256sum --check - name: Regenerate selected client @@ -28,3 +31,18 @@ jobs: test -z "$(git status --porcelain -- candidate/generated)" - name: Compile candidate run: python -m compileall -q candidate/generated/nimble_client + - name: Build and install candidate wheel + run: | + python -m pip install build + mkdir -p "$RUNNER_TEMP/sdk-artifact" + python -m build --wheel --sdist \ + --outdir "$RUNNER_TEMP/sdk-artifact" candidate/generated \ + > "$RUNNER_TEMP/sdk-build.log" 2>&1 + python -m venv "$RUNNER_TEMP/sdk-consumer" + "$RUNNER_TEMP/sdk-consumer/bin/pip" install "$RUNNER_TEMP"/sdk-artifact/*.whl + "$RUNNER_TEMP/sdk-consumer/bin/python" -c 'import nimble_client' + - uses: actions/upload-artifact@v7 + with: + name: python-sdk-candidate + path: ${{ runner.temp }}/sdk-artifact/* + if-no-files-found: error