harbor-framework-client 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (433) hide show
  1. harbor_client/__init__.py +49 -0
  2. harbor_client/__init__.pyi +661 -0
  3. harbor_client/_openapi.json.gz +0 -0
  4. harbor_client/account/__init__.py +3 -0
  5. harbor_client/account/client.py +236 -0
  6. harbor_client/agents/__init__.py +3 -0
  7. harbor_client/agents/client.py +230 -0
  8. harbor_client/api_keys/__init__.py +3 -0
  9. harbor_client/api_keys/client.py +457 -0
  10. harbor_client/api_keys/types/__init__.py +13 -0
  11. harbor_client/api_keys/types/api_keys_list_bad_request_response.py +13 -0
  12. harbor_client/base_client.py +912 -0
  13. harbor_client/client.py +207 -0
  14. harbor_client/core/__init__.py +20 -0
  15. harbor_client/core/api_error.py +3 -0
  16. harbor_client/core/client_wrapper.py +73 -0
  17. harbor_client/core/file.py +57 -0
  18. harbor_client/core/http_response.py +5 -0
  19. harbor_client/core/httpx_session.py +136 -0
  20. harbor_client/core/jsonable_encoder.py +52 -0
  21. harbor_client/core/remove_none_from_dict.py +5 -0
  22. harbor_client/core/request_options.py +47 -0
  23. harbor_client/environment.py +4 -0
  24. harbor_client/errors.py +119 -0
  25. harbor_client/jobs/__init__.py +3 -0
  26. harbor_client/jobs/client.py +2994 -0
  27. harbor_client/jobs/types/__init__.py +97 -0
  28. harbor_client/jobs/types/jobs_get_filters_request_field.py +3 -0
  29. harbor_client/jobs/types/jobs_get_overview_request_force_combined.py +3 -0
  30. harbor_client/jobs/types/jobs_list_bad_request_response.py +13 -0
  31. harbor_client/jobs/types/jobs_list_request_sort.py +3 -0
  32. harbor_client/jobs/types/jobs_list_tasks_bad_request_response.py +13 -0
  33. harbor_client/jobs/types/jobs_list_tasks_request_sort_by.py +3 -0
  34. harbor_client/jobs/types/jobs_list_tasks_request_sort_order.py +3 -0
  35. harbor_client/jobs/types/jobs_submit_response.py +3 -0
  36. harbor_client/jobs/types/result_job_create_visibility.py +3 -0
  37. harbor_client/jobs/types/submit_job_request_config.py +3 -0
  38. harbor_client/jobs/types/submit_job_request_config_agent_setup_timeout_multiplier.py +3 -0
  39. harbor_client/jobs/types/submit_job_request_config_agent_setup_timeout_multiplier_one.py +3 -0
  40. harbor_client/jobs/types/submit_job_request_config_agent_timeout_multiplier.py +3 -0
  41. harbor_client/jobs/types/submit_job_request_config_agent_timeout_multiplier_one.py +3 -0
  42. harbor_client/jobs/types/submit_job_request_config_artifacts_item.py +3 -0
  43. harbor_client/jobs/types/submit_job_request_config_credential_mode.py +3 -0
  44. harbor_client/jobs/types/submit_job_request_config_environment_build_timeout_multiplier.py +3 -0
  45. harbor_client/jobs/types/submit_job_request_config_environment_build_timeout_multiplier_one.py +3 -0
  46. harbor_client/jobs/types/submit_job_request_config_timeout_multiplier.py +3 -0
  47. harbor_client/jobs/types/submit_job_request_config_timeout_multiplier_one.py +3 -0
  48. harbor_client/jobs/types/submit_job_request_config_verifier_timeout_multiplier.py +3 -0
  49. harbor_client/jobs/types/submit_job_request_config_verifier_timeout_multiplier_one.py +3 -0
  50. harbor_client/jobs/types/submit_job_request_regrade.py +3 -0
  51. harbor_client/jobs/types/submit_job_request_regrade_source_trial_id.py +3 -0
  52. harbor_client/jobs/types/update_job_sharing_request_visibility.py +3 -0
  53. harbor_client/leaderboards/__init__.py +3 -0
  54. harbor_client/leaderboards/client.py +1354 -0
  55. harbor_client/leaderboards/types/__init__.py +61 -0
  56. harbor_client/leaderboards/types/leaderboards_create_request_visibility.py +3 -0
  57. harbor_client/leaderboards/types/leaderboards_list_bad_request_response.py +13 -0
  58. harbor_client/leaderboards/types/leaderboards_list_rows_bad_request_response.py +13 -0
  59. harbor_client/leaderboards/types/leaderboards_list_trials_bad_request_response.py +13 -0
  60. harbor_client/leaderboards/types/leaderboards_update_request_definition.py +3 -0
  61. harbor_client/leaderboards/types/leaderboards_update_request_definition_visibility.py +3 -0
  62. harbor_client/leaderboards/types/leaderboards_update_request_row_deletes_item.py +3 -0
  63. harbor_client/leaderboards/types/leaderboards_update_request_row_updates_item.py +3 -0
  64. harbor_client/leaderboards/types/leaderboards_update_request_row_updates_item_status.py +3 -0
  65. harbor_client/leaderboards/types/leaderboards_update_request_trial_updates_item.py +3 -0
  66. harbor_client/leaderboards/types/leaderboards_update_request_trial_updates_item_operation.py +3 -0
  67. harbor_client/net/__init__.py +0 -0
  68. harbor_client/net/environment/__init__.py +4 -0
  69. harbor_client/net/environment/environment.py +32 -0
  70. harbor_client/net/headers/__init__.py +0 -0
  71. harbor_client/net/headers/access_token_auth.py +75 -0
  72. harbor_client/net/headers/base_header.py +34 -0
  73. harbor_client/net/request_chain/__init__.py +0 -0
  74. harbor_client/net/request_chain/handlers/__init__.py +0 -0
  75. harbor_client/net/request_chain/handlers/base_handler.py +51 -0
  76. harbor_client/net/request_chain/handlers/http_handler.py +607 -0
  77. harbor_client/net/request_chain/handlers/logging_handler.py +186 -0
  78. harbor_client/net/request_chain/handlers/retry_handler.py +295 -0
  79. harbor_client/net/request_chain/request_chain.py +76 -0
  80. harbor_client/net/sdk_config.py +101 -0
  81. harbor_client/net/transport/__init__.py +0 -0
  82. harbor_client/net/transport/api_error.py +118 -0
  83. harbor_client/net/transport/http_response.py +83 -0
  84. harbor_client/net/transport/pagination.py +156 -0
  85. harbor_client/net/transport/request.py +190 -0
  86. harbor_client/net/transport/request_error.py +34 -0
  87. harbor_client/net/transport/response.py +456 -0
  88. harbor_client/net/transport/serializer.py +490 -0
  89. harbor_client/net/transport/utils.py +41 -0
  90. harbor_client/organizations/__init__.py +3 -0
  91. harbor_client/organizations/client.py +346 -0
  92. harbor_client/packages/__init__.py +3 -0
  93. harbor_client/packages/client.py +2277 -0
  94. harbor_client/packages/types/__init__.py +53 -0
  95. harbor_client/packages/types/packages_list_version_catalog_bad_request_response.py +13 -0
  96. harbor_client/packages/types/packages_list_version_catalog_request_include_yanked.py +3 -0
  97. harbor_client/packages/types/packages_list_version_catalog_request_type.py +3 -0
  98. harbor_client/packages/types/packages_list_version_files_bad_request_response.py +13 -0
  99. harbor_client/packages/types/packages_list_versions_bad_request_response.py +13 -0
  100. harbor_client/packages/types/packages_list_versions_request_include_yanked.py +3 -0
  101. harbor_client/packages/types/packages_set_visibility_request_visibility.py +3 -0
  102. harbor_client/packages/types/packages_update_organization_access_request_action.py +3 -0
  103. harbor_client/py.typed +1 -0
  104. harbor_client/rollouts/__init__.py +3 -0
  105. harbor_client/rollouts/client.py +1364 -0
  106. harbor_client/rollouts/types/__init__.py +31 -0
  107. harbor_client/rollouts/types/rollouts_get_filters_request_attempts.py +3 -0
  108. harbor_client/rollouts/types/rollouts_get_filters_request_failed_only.py +3 -0
  109. harbor_client/rollouts/types/rollouts_get_filters_request_field.py +3 -0
  110. harbor_client/rollouts/types/rollouts_get_filters_request_terminal.py +3 -0
  111. harbor_client/rollouts/types/rollouts_list_bad_request_response.py +13 -0
  112. harbor_client/rollouts/types/rollouts_list_request_attempts.py +3 -0
  113. harbor_client/rollouts/types/rollouts_list_request_failed_only.py +3 -0
  114. harbor_client/rollouts/types/rollouts_list_request_sort.py +3 -0
  115. harbor_client/rollouts/types/rollouts_list_request_terminal.py +3 -0
  116. harbor_client/secrets/__init__.py +3 -0
  117. harbor_client/secrets/client.py +1309 -0
  118. harbor_client/secrets/types/__init__.py +61 -0
  119. harbor_client/secrets/types/registry_credential_upsert_encoded_provider.py +3 -0
  120. harbor_client/secrets/types/secrets_list_bad_request_response.py +13 -0
  121. harbor_client/secrets/types/secrets_list_registry_credentials_request_status.py +3 -0
  122. harbor_client/secrets/types/secrets_list_registry_credentials_response.py +3 -0
  123. harbor_client/secrets/types/secrets_list_request_status_filter.py +3 -0
  124. harbor_client/secrets/types/secrets_preflight_request_config.py +3 -0
  125. harbor_client/secrets/types/secrets_preflight_request_config_credential_mode.py +3 -0
  126. harbor_client/secrets/types/secrets_revoke_registry_credential_request_purge.py +3 -0
  127. harbor_client/secrets/types/secrets_revoke_request_scope.py +3 -0
  128. harbor_client/secrets/types/secrets_revoke_response.py +3 -0
  129. harbor_client/secrets/types/secrets_upsert_conflict_response.py +13 -0
  130. harbor_client/secrets/types/secrets_upsert_registry_credential_conflict_response.py +11 -0
  131. harbor_client/secrets/types/secrets_upsert_request_scope.py +3 -0
  132. harbor_client/services/__init__.py +0 -0
  133. harbor_client/services/async_/__init__.py +0 -0
  134. harbor_client/services/async_/utils/__init__.py +0 -0
  135. harbor_client/services/async_/utils/to_async.py +20 -0
  136. harbor_client/services/utils/__init__.py +0 -0
  137. harbor_client/services/utils/base_service.py +408 -0
  138. harbor_client/services/utils/default_headers.py +69 -0
  139. harbor_client/services/utils/validator.py +474 -0
  140. harbor_client/storage/__init__.py +3 -0
  141. harbor_client/storage/client.py +269 -0
  142. harbor_client/transfers.py +724 -0
  143. harbor_client/trials/__init__.py +3 -0
  144. harbor_client/trials/client.py +1939 -0
  145. harbor_client/trials/types/__init__.py +29 -0
  146. harbor_client/trials/types/trials_get_filters_request_attempts.py +3 -0
  147. harbor_client/trials/types/trials_get_filters_request_failed_only.py +3 -0
  148. harbor_client/trials/types/trials_get_filters_request_field.py +3 -0
  149. harbor_client/trials/types/trials_get_filters_request_terminal.py +3 -0
  150. harbor_client/trials/types/trials_list_bad_request_response.py +13 -0
  151. harbor_client/trials/types/trials_list_request_attempts.py +3 -0
  152. harbor_client/trials/types/trials_list_request_failed_only.py +3 -0
  153. harbor_client/trials/types/trials_list_request_sort.py +3 -0
  154. harbor_client/trials/types/trials_list_request_terminal.py +3 -0
  155. harbor_client/types/__init__.py +1006 -0
  156. harbor_client/types/__init__.pyi +644 -0
  157. harbor_client/types/account_identity.py +15 -0
  158. harbor_client/types/agent_identity.py +19 -0
  159. harbor_client/types/agent_options.py +1 -0
  160. harbor_client/types/agent_source.py +40 -0
  161. harbor_client/types/agent_source_manifest.py +57 -0
  162. harbor_client/types/agent_source_runtime.py +33 -0
  163. harbor_client/types/agents_response.py +16 -0
  164. harbor_client/types/api_key_create.py +19 -0
  165. harbor_client/types/api_key_created.py +44 -0
  166. harbor_client/types/api_key_metadata.py +41 -0
  167. harbor_client/types/api_key_metadata_page.py +24 -0
  168. harbor_client/types/api_keys_list_bad_request_response.py +35 -0
  169. harbor_client/types/artifact_config.py +26 -0
  170. harbor_client/types/available_dataset_task_dependency.py +97 -0
  171. harbor_client/types/bad_request_encoded.py +79 -0
  172. harbor_client/types/bad_request_error_body.py +35 -0
  173. harbor_client/types/cancel_job_request.py +15 -0
  174. harbor_client/types/cancel_trial_request.py +15 -0
  175. harbor_client/types/conflict_encoded.py +77 -0
  176. harbor_client/types/conflict_error_body.py +38 -0
  177. harbor_client/types/create_leaderboard_response.py +22 -0
  178. harbor_client/types/create_leaderboard_row_input.py +32 -0
  179. harbor_client/types/created_result_job.py +49 -0
  180. harbor_client/types/created_result_trial.py +28 -0
  181. harbor_client/types/credential_proxy_header_transform.py +16 -0
  182. harbor_client/types/credential_proxy_path_match.py +15 -0
  183. harbor_client/types/credential_proxy_policy_rule.py +21 -0
  184. harbor_client/types/credential_proxy_request_match.py +20 -0
  185. harbor_client/types/dataset_publish_task_reference.py +21 -0
  186. harbor_client/types/dataset_version_detail.py +95 -0
  187. harbor_client/types/dataset_version_file.py +50 -0
  188. harbor_client/types/dataset_version_manifest.py +91 -0
  189. harbor_client/types/dataset_version_revision_summary.py +22 -0
  190. harbor_client/types/delete_jobs_request.py +17 -0
  191. harbor_client/types/delete_jobs_response.py +22 -0
  192. harbor_client/types/dry_run_response.py +15 -0
  193. harbor_client/types/ensure_organization_response.py +18 -0
  194. harbor_client/types/evaluation_comparison.py +27 -0
  195. harbor_client/types/evaluation_comparison_agent_model.py +34 -0
  196. harbor_client/types/evaluation_comparison_cell.py +109 -0
  197. harbor_client/types/evaluation_comparison_task.py +22 -0
  198. harbor_client/types/evaluation_job_reference.py +48 -0
  199. harbor_client/types/evaluation_metric_set.py +42 -0
  200. harbor_client/types/evaluation_summary.py +21 -0
  201. harbor_client/types/evaluation_summary_row.py +128 -0
  202. harbor_client/types/existing_registry_credential.py +28 -0
  203. harbor_client/types/existing_secret_summary.py +31 -0
  204. harbor_client/types/filter_values_response.py +72 -0
  205. harbor_client/types/forbidden_encoded.py +79 -0
  206. harbor_client/types/hosted_agent_config.py +72 -0
  207. harbor_client/types/hosted_dataset_config.py +62 -0
  208. harbor_client/types/hosted_diff_selectors.py +22 -0
  209. harbor_client/types/hosted_github_agent_source.py +30 -0
  210. harbor_client/types/hosted_job_trial_regrade_source.py +19 -0
  211. harbor_client/types/hosted_local_task_requirements.py +20 -0
  212. harbor_client/types/hosted_preflight_environment_config.py +24 -0
  213. harbor_client/types/hosted_retry_config.py +32 -0
  214. harbor_client/types/hosted_secret_selection.py +21 -0
  215. harbor_client/types/hosted_submission_credential_proxy_path_match.py +17 -0
  216. harbor_client/types/hosted_submission_credential_proxy_policy_rule.py +23 -0
  217. harbor_client/types/hosted_submission_credential_proxy_request_match.py +22 -0
  218. harbor_client/types/hosted_submission_dataset_config.py +64 -0
  219. harbor_client/types/hosted_submission_environment_config.py +26 -0
  220. harbor_client/types/hosted_submission_retry_config.py +32 -0
  221. harbor_client/types/hosted_submission_task_config.py +45 -0
  222. harbor_client/types/hosted_task_config.py +45 -0
  223. harbor_client/types/hosted_task_environment_requirement.py +26 -0
  224. harbor_client/types/hosted_verifier_config.py +75 -0
  225. harbor_client/types/internal_server_error_encoded.py +93 -0
  226. harbor_client/types/invalid_page_size_encoded.py +58 -0
  227. harbor_client/types/invalid_page_token_encoded.py +60 -0
  228. harbor_client/types/job_artifact_type.py +5 -0
  229. harbor_client/types/job_bucket_circuit_state.py +93 -0
  230. harbor_client/types/job_cancellation_summary.py +47 -0
  231. harbor_client/types/job_circuit_state.py +90 -0
  232. harbor_client/types/job_creator.py +28 -0
  233. harbor_client/types/job_detail.py +84 -0
  234. harbor_client/types/job_manual_pause_summary.py +66 -0
  235. harbor_client/types/job_overview.py +332 -0
  236. harbor_client/types/job_overview_statistics.py +97 -0
  237. harbor_client/types/job_owner_organization.py +28 -0
  238. harbor_client/types/job_package_run_target.py +21 -0
  239. harbor_client/types/job_page.py +24 -0
  240. harbor_client/types/job_path_run_target.py +24 -0
  241. harbor_client/types/job_response.py +17 -0
  242. harbor_client/types/job_reward_metric_set.py +42 -0
  243. harbor_client/types/job_share_organization_summary.py +22 -0
  244. harbor_client/types/job_sharing.py +38 -0
  245. harbor_client/types/job_summary.py +73 -0
  246. harbor_client/types/job_task_page.py +24 -0
  247. harbor_client/types/job_task_summary.py +146 -0
  248. harbor_client/types/job_trial_status.py +4 -0
  249. harbor_client/types/job_trial_status_item.py +128 -0
  250. harbor_client/types/jobs_copy_request.py +22 -0
  251. harbor_client/types/jobs_get_filters_request_field.py +17 -0
  252. harbor_client/types/jobs_get_overview_request_force_combined.py +7 -0
  253. harbor_client/types/jobs_list_bad_request_response.py +35 -0
  254. harbor_client/types/jobs_list_request_sort.py +21 -0
  255. harbor_client/types/jobs_list_tasks_bad_request_response.py +35 -0
  256. harbor_client/types/jobs_list_tasks_request_sort_by.py +25 -0
  257. harbor_client/types/jobs_list_tasks_request_sort_order.py +5 -0
  258. harbor_client/types/jobs_rename_request.py +15 -0
  259. harbor_client/types/jobs_submit_response.py +15 -0
  260. harbor_client/types/jobs_transfer_request.py +22 -0
  261. harbor_client/types/leaderboard_change_summary.py +37 -0
  262. harbor_client/types/leaderboard_definition.py +67 -0
  263. harbor_client/types/leaderboard_detail.py +17 -0
  264. harbor_client/types/leaderboard_mutation_record.py +64 -0
  265. harbor_client/types/leaderboard_mutation_row.py +43 -0
  266. harbor_client/types/leaderboard_package_selector_encoded.py +16 -0
  267. harbor_client/types/leaderboard_ranked_row.py +44 -0
  268. harbor_client/types/leaderboard_read_column_definition.py +55 -0
  269. harbor_client/types/leaderboard_read_ranking_rule.py +30 -0
  270. harbor_client/types/leaderboard_row_detail.py +17 -0
  271. harbor_client/types/leaderboard_rows_page.py +28 -0
  272. harbor_client/types/leaderboard_summary.py +64 -0
  273. harbor_client/types/leaderboard_summary_page.py +24 -0
  274. harbor_client/types/leaderboard_trial_link.py +18 -0
  275. harbor_client/types/leaderboard_trial_link_page.py +23 -0
  276. harbor_client/types/leaderboard_write_column_definition.py +55 -0
  277. harbor_client/types/leaderboard_write_ranking_rule.py +30 -0
  278. harbor_client/types/leaderboards_create_request.py +59 -0
  279. harbor_client/types/leaderboards_list_bad_request_response.py +37 -0
  280. harbor_client/types/leaderboards_list_rows_bad_request_response.py +37 -0
  281. harbor_client/types/leaderboards_list_trials_bad_request_response.py +39 -0
  282. harbor_client/types/leaderboards_update_request.py +152 -0
  283. harbor_client/types/mean_aggregate.py +19 -0
  284. harbor_client/types/metric_config.py +20 -0
  285. harbor_client/types/model_identity.py +22 -0
  286. harbor_client/types/my_organizations.py +4 -0
  287. harbor_client/types/my_organizations_item.py +36 -0
  288. harbor_client/types/not_found_encoded.py +77 -0
  289. harbor_client/types/organization_detail.py +38 -0
  290. harbor_client/types/organizations_ensure_request.py +15 -0
  291. harbor_client/types/owner_organization.py +31 -0
  292. harbor_client/types/package_access.py +46 -0
  293. harbor_client/types/package_access_grant_creator.py +22 -0
  294. harbor_client/types/package_access_organization_summary.py +30 -0
  295. harbor_client/types/package_name_reference.py +18 -0
  296. harbor_client/types/package_organization_grant.py +44 -0
  297. harbor_client/types/package_public_grant.py +40 -0
  298. harbor_client/types/package_tag.py +24 -0
  299. harbor_client/types/package_tags.py +4 -0
  300. harbor_client/types/package_version_catalog_page.py +21 -0
  301. harbor_client/types/package_version_detail.py +27 -0
  302. harbor_client/types/package_version_file_page.py +21 -0
  303. harbor_client/types/package_version_manifest.py +27 -0
  304. harbor_client/types/package_version_summary.py +69 -0
  305. harbor_client/types/packages_list_version_catalog_bad_request_response.py +41 -0
  306. harbor_client/types/packages_list_version_catalog_request_include_yanked.py +7 -0
  307. harbor_client/types/packages_list_version_catalog_request_type.py +7 -0
  308. harbor_client/types/packages_list_version_files_bad_request_response.py +41 -0
  309. harbor_client/types/packages_list_versions_bad_request_response.py +37 -0
  310. harbor_client/types/packages_list_versions_request_include_yanked.py +7 -0
  311. harbor_client/types/packages_set_visibility_request.py +27 -0
  312. harbor_client/types/packages_update_organization_access_request.py +26 -0
  313. harbor_client/types/registry_credential.py +44 -0
  314. harbor_client/types/registry_credential_replacement_required_encoded.py +86 -0
  315. harbor_client/types/registry_credential_replacement_stale_encoded.py +79 -0
  316. harbor_client/types/registry_credential_revoke_result.py +21 -0
  317. harbor_client/types/registry_credential_summary.py +46 -0
  318. harbor_client/types/registry_credential_upsert_encoded.py +48 -0
  319. harbor_client/types/registry_package.py +37 -0
  320. harbor_client/types/registry_package_version.py +44 -0
  321. harbor_client/types/registry_package_version_page.py +25 -0
  322. harbor_client/types/registry_version_file.py +47 -0
  323. harbor_client/types/rename_job_response.py +21 -0
  324. harbor_client/types/reserve_temporary_package_request.py +25 -0
  325. harbor_client/types/reserve_temporary_task_response.py +27 -0
  326. harbor_client/types/resolved_task_step.py +38 -0
  327. harbor_client/types/result_job_create.py +40 -0
  328. harbor_client/types/result_model_usage.py +31 -0
  329. harbor_client/types/result_trial_create.py +92 -0
  330. harbor_client/types/retry_rollout_response.py +15 -0
  331. harbor_client/types/retry_trial_response.py +15 -0
  332. harbor_client/types/reward_value.py +3 -0
  333. harbor_client/types/rollout_response.py +17 -0
  334. harbor_client/types/rollouts_get_filters_request_attempts.py +7 -0
  335. harbor_client/types/rollouts_get_filters_request_failed_only.py +7 -0
  336. harbor_client/types/rollouts_get_filters_request_field.py +18 -0
  337. harbor_client/types/rollouts_get_filters_request_terminal.py +7 -0
  338. harbor_client/types/rollouts_list_bad_request_response.py +34 -0
  339. harbor_client/types/rollouts_list_request_attempts.py +5 -0
  340. harbor_client/types/rollouts_list_request_failed_only.py +7 -0
  341. harbor_client/types/rollouts_list_request_sort.py +47 -0
  342. harbor_client/types/rollouts_list_request_terminal.py +5 -0
  343. harbor_client/types/run_state.py +10 -0
  344. harbor_client/types/secret_metadata.py +54 -0
  345. harbor_client/types/secret_metadata_page.py +21 -0
  346. harbor_client/types/secret_preflight.py +152 -0
  347. harbor_client/types/secret_replacement_required_encoded.py +72 -0
  348. harbor_client/types/secret_replacement_stale_encoded.py +67 -0
  349. harbor_client/types/secret_write_result.py +51 -0
  350. harbor_client/types/secrets_list_bad_request_response.py +35 -0
  351. harbor_client/types/secrets_list_registry_credentials_request_status.py +7 -0
  352. harbor_client/types/secrets_list_registry_credentials_response.py +18 -0
  353. harbor_client/types/secrets_list_request_status_filter.py +7 -0
  354. harbor_client/types/secrets_preflight_request.py +76 -0
  355. harbor_client/types/secrets_revoke_registry_credential_request_purge.py +7 -0
  356. harbor_client/types/secrets_revoke_request.py +33 -0
  357. harbor_client/types/secrets_revoke_response.py +34 -0
  358. harbor_client/types/secrets_upsert_conflict_response.py +39 -0
  359. harbor_client/types/secrets_upsert_registry_credential_conflict_response.py +40 -0
  360. harbor_client/types/secrets_upsert_request.py +43 -0
  361. harbor_client/types/selected_secret.py +48 -0
  362. harbor_client/types/service_unavailable_encoded.py +85 -0
  363. harbor_client/types/set_package_visibility_response.py +50 -0
  364. harbor_client/types/storage_copy_result.py +60 -0
  365. harbor_client/types/storage_dataset_upload_create.py +50 -0
  366. harbor_client/types/storage_dataset_upload_metadata.py +49 -0
  367. harbor_client/types/storage_dataset_upload_result.py +50 -0
  368. harbor_client/types/storage_download.py +64 -0
  369. harbor_client/types/storage_http_transfer.py +33 -0
  370. harbor_client/types/storage_job_upload_create.py +39 -0
  371. harbor_client/types/storage_job_upload_metadata.py +45 -0
  372. harbor_client/types/storage_publication_file.py +25 -0
  373. harbor_client/types/storage_result_upload_result.py +15 -0
  374. harbor_client/types/storage_task_upload_create.py +50 -0
  375. harbor_client/types/storage_task_upload_metadata.py +79 -0
  376. harbor_client/types/storage_task_upload_result.py +39 -0
  377. harbor_client/types/storage_trial_upload_create.py +41 -0
  378. harbor_client/types/storage_tus_transfer.py +56 -0
  379. harbor_client/types/storage_upload_create.py +44 -0
  380. harbor_client/types/storage_upload_file.py +63 -0
  381. harbor_client/types/storage_upload_file_input.py +32 -0
  382. harbor_client/types/storage_upload_receipt.py +53 -0
  383. harbor_client/types/storage_upload_session.py +61 -0
  384. harbor_client/types/submit_job_request.py +277 -0
  385. harbor_client/types/submit_job_response.py +51 -0
  386. harbor_client/types/sum_aggregate.py +19 -0
  387. harbor_client/types/tag_package_version_request.py +15 -0
  388. harbor_client/types/tag_package_version_response.py +18 -0
  389. harbor_client/types/task_environment_requirement.py +26 -0
  390. harbor_client/types/task_identity.py +22 -0
  391. harbor_client/types/task_publish_step.py +47 -0
  392. harbor_client/types/task_version_detail.py +115 -0
  393. harbor_client/types/task_version_manifest.py +119 -0
  394. harbor_client/types/too_many_requests_encoded.py +81 -0
  395. harbor_client/types/transfer_job_response.py +36 -0
  396. harbor_client/types/trial_artifact_type.py +5 -0
  397. harbor_client/types/trial_counts.py +33 -0
  398. harbor_client/types/trial_detail.py +103 -0
  399. harbor_client/types/trial_filter_values_response.py +76 -0
  400. harbor_client/types/trial_page.py +24 -0
  401. harbor_client/types/trial_response.py +17 -0
  402. harbor_client/types/trial_summary.py +83 -0
  403. harbor_client/types/trials_copy_request.py +22 -0
  404. harbor_client/types/trials_get_filters_request_attempts.py +7 -0
  405. harbor_client/types/trials_get_filters_request_failed_only.py +7 -0
  406. harbor_client/types/trials_get_filters_request_field.py +18 -0
  407. harbor_client/types/trials_get_filters_request_terminal.py +7 -0
  408. harbor_client/types/trials_list_bad_request_response.py +35 -0
  409. harbor_client/types/trials_list_request_attempts.py +5 -0
  410. harbor_client/types/trials_list_request_failed_only.py +5 -0
  411. harbor_client/types/trials_list_request_sort.py +47 -0
  412. harbor_client/types/trials_list_request_terminal.py +5 -0
  413. harbor_client/types/unauthorized_encoded.py +79 -0
  414. harbor_client/types/unavailable_dataset_task_dependency.py +43 -0
  415. harbor_client/types/update_job_sharing_request.py +36 -0
  416. harbor_client/types/update_leaderboard_response.py +29 -0
  417. harbor_client/types/update_package_access_response.py +65 -0
  418. harbor_client/types/usage.py +25 -0
  419. harbor_client/types/usage_aggregates.py +26 -0
  420. harbor_client/types/utils/__init__.py +0 -0
  421. harbor_client/types/utils/base_error.py +127 -0
  422. harbor_client/types/utils/base_model.py +439 -0
  423. harbor_client/types/utils/cast_models.py +226 -0
  424. harbor_client/types/utils/json_map.py +84 -0
  425. harbor_client/types/utils/one_of_base_model.py +173 -0
  426. harbor_client/types/utils/sentinel.py +19 -0
  427. harbor_client/validation.py +335 -0
  428. harbor_client/version.py +9 -0
  429. harbor_framework_client-0.1.0.dist-info/METADATA +134 -0
  430. harbor_framework_client-0.1.0.dist-info/RECORD +433 -0
  431. harbor_framework_client-0.1.0.dist-info/WHEEL +5 -0
  432. harbor_framework_client-0.1.0.dist-info/licenses/LICENSE +201 -0
  433. harbor_framework_client-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2994 @@
1
+ from typing import Any, Optional, Generator, List, Union
2
+ from ..services.utils.validator import Validator
3
+ from ..services.utils.base_service import BaseService
4
+ from ..types.utils.sentinel import SENTINEL
5
+ from ..types.utils.cast_models import cast_models
6
+ from ..types.utils.base_model import construct_lenient
7
+ from ..types.jobs_submit_response import JobsSubmitResponse_adapter
8
+ from ..types.jobs_list_tasks_bad_request_response import (
9
+ JobsListTasksBadRequestResponse_adapter,
10
+ )
11
+ from ..types.jobs_list_bad_request_response import JobsListBadRequestResponse_adapter
12
+ from ..types import (
13
+ BadRequestEncoded,
14
+ CancelJobRequest,
15
+ ConflictEncoded,
16
+ CreatedResultJob,
17
+ DeleteJobsRequest,
18
+ DeleteJobsResponse,
19
+ EvaluationComparison,
20
+ FilterValuesResponse,
21
+ ForbiddenEncoded,
22
+ InternalServerErrorEncoded,
23
+ JobArtifactType,
24
+ JobOverview,
25
+ JobPage,
26
+ JobResponse,
27
+ JobsCopyRequest,
28
+ JobsGetFiltersRequestField,
29
+ JobsGetOverviewRequestForceCombined,
30
+ JobSharing,
31
+ JobsListBadRequestResponse,
32
+ JobsListRequestSort,
33
+ JobsListTasksBadRequestResponse,
34
+ JobsListTasksRequestSortBy,
35
+ JobsListTasksRequestSortOrder,
36
+ JobsRenameRequest,
37
+ JobsSubmitResponse,
38
+ JobsTransferRequest,
39
+ JobSummary,
40
+ JobTaskPage,
41
+ JobTaskSummary,
42
+ JobTrialStatusItem,
43
+ NotFoundEncoded,
44
+ RenameJobResponse,
45
+ ResultJobCreate,
46
+ ResultJobCreateVisibility,
47
+ RunState,
48
+ ServiceUnavailableEncoded,
49
+ StorageCopyResult,
50
+ StorageDownload,
51
+ SubmitJobRequest,
52
+ SubmitJobRequestConfig,
53
+ SubmitJobRequestRegrade,
54
+ TooManyRequestsEncoded,
55
+ TransferJobResponse,
56
+ UnauthorizedEncoded,
57
+ UpdateJobSharingRequest,
58
+ UpdateJobSharingRequestVisibility,
59
+ )
60
+ from ..net.transport.serializer import Serializer
61
+ from ..net.transport.pagination import SyncPager
62
+ from ..net.transport.http_response import HttpResponse
63
+ from ..net.sdk_config import should_validate_response
64
+ from ..net.sdk_config import SdkConfig
65
+ from ..net.environment.environment import HarborApiClientEnvironment
66
+ from ..core.request_options import RequestOptions
67
+ from ..services.async_.utils.to_async import to_async
68
+ from typing import Awaitable
69
+ from ..net.transport.pagination import AsyncPager
70
+ import asyncio
71
+
72
+
73
+ class JobsClient(BaseService):
74
+ """
75
+ Fern-style resource client for JobsClient.
76
+ Exposes this resource's endpoints and, when the resource has sub-resources, lazy
77
+ accessors to its child clients (`client.<parent>.<child>.method(...)`).
78
+ Inherits authentication, base-url and request handling from BaseService.
79
+ """
80
+
81
+ def __init__(self, *args, **kwargs):
82
+ """Initialize the resource client, its child clients and method-level configs."""
83
+ super().__init__(*args, **kwargs)
84
+ self._raw_client = self.with_raw_response
85
+ self._get_sharing_config: SdkConfig = {}
86
+ self._update_sharing_config: SdkConfig = {}
87
+ self._get_trial_status_config: SdkConfig = {}
88
+ self._get_config: SdkConfig = {}
89
+ self._rename_config: SdkConfig = {}
90
+ self._get_artifact_download_config: SdkConfig = {}
91
+ self._submit_config: SdkConfig = {}
92
+ self._delete_config: SdkConfig = {}
93
+ self._transfer_config: SdkConfig = {}
94
+ self._copy_config: SdkConfig = {}
95
+ self._pause_config: SdkConfig = {}
96
+ self._resume_config: SdkConfig = {}
97
+ self._cancel_config: SdkConfig = {}
98
+ self._list_config: SdkConfig = {}
99
+ self._get_filters_config: SdkConfig = {}
100
+ self._list_tasks_config: SdkConfig = {}
101
+ self._import_results_config: SdkConfig = {}
102
+ self._get_overview_config: SdkConfig = {}
103
+ self._get_comparison_config: SdkConfig = {}
104
+
105
+ def set_get_sharing_config(self, config: SdkConfig):
106
+ """
107
+ Sets method-level configuration for get_sharing.
108
+
109
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
110
+ :return: The service instance for method chaining.
111
+ """
112
+ self._get_sharing_config = config
113
+ return self
114
+
115
+ def set_update_sharing_config(self, config: SdkConfig):
116
+ """
117
+ Sets method-level configuration for update_sharing.
118
+
119
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
120
+ :return: The service instance for method chaining.
121
+ """
122
+ self._update_sharing_config = config
123
+ return self
124
+
125
+ def set_get_trial_status_config(self, config: SdkConfig):
126
+ """
127
+ Sets method-level configuration for get_trial_status.
128
+
129
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
130
+ :return: The service instance for method chaining.
131
+ """
132
+ self._get_trial_status_config = config
133
+ return self
134
+
135
+ def set_get_config(self, config: SdkConfig):
136
+ """
137
+ Sets method-level configuration for get.
138
+
139
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
140
+ :return: The service instance for method chaining.
141
+ """
142
+ self._get_config = config
143
+ return self
144
+
145
+ def set_rename_config(self, config: SdkConfig):
146
+ """
147
+ Sets method-level configuration for rename.
148
+
149
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
150
+ :return: The service instance for method chaining.
151
+ """
152
+ self._rename_config = config
153
+ return self
154
+
155
+ def set_get_artifact_download_config(self, config: SdkConfig):
156
+ """
157
+ Sets method-level configuration for get_artifact_download.
158
+
159
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
160
+ :return: The service instance for method chaining.
161
+ """
162
+ self._get_artifact_download_config = config
163
+ return self
164
+
165
+ def set_submit_config(self, config: SdkConfig):
166
+ """
167
+ Sets method-level configuration for submit.
168
+
169
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
170
+ :return: The service instance for method chaining.
171
+ """
172
+ self._submit_config = config
173
+ return self
174
+
175
+ def set_delete_config(self, config: SdkConfig):
176
+ """
177
+ Sets method-level configuration for delete.
178
+
179
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
180
+ :return: The service instance for method chaining.
181
+ """
182
+ self._delete_config = config
183
+ return self
184
+
185
+ def set_transfer_config(self, config: SdkConfig):
186
+ """
187
+ Sets method-level configuration for transfer.
188
+
189
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
190
+ :return: The service instance for method chaining.
191
+ """
192
+ self._transfer_config = config
193
+ return self
194
+
195
+ def set_copy_config(self, config: SdkConfig):
196
+ """
197
+ Sets method-level configuration for copy.
198
+
199
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
200
+ :return: The service instance for method chaining.
201
+ """
202
+ self._copy_config = config
203
+ return self
204
+
205
+ def set_pause_config(self, config: SdkConfig):
206
+ """
207
+ Sets method-level configuration for pause.
208
+
209
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
210
+ :return: The service instance for method chaining.
211
+ """
212
+ self._pause_config = config
213
+ return self
214
+
215
+ def set_resume_config(self, config: SdkConfig):
216
+ """
217
+ Sets method-level configuration for resume.
218
+
219
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
220
+ :return: The service instance for method chaining.
221
+ """
222
+ self._resume_config = config
223
+ return self
224
+
225
+ def set_cancel_config(self, config: SdkConfig):
226
+ """
227
+ Sets method-level configuration for cancel.
228
+
229
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
230
+ :return: The service instance for method chaining.
231
+ """
232
+ self._cancel_config = config
233
+ return self
234
+
235
+ def set_list_config(self, config: SdkConfig):
236
+ """
237
+ Sets method-level configuration for list.
238
+
239
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
240
+ :return: The service instance for method chaining.
241
+ """
242
+ self._list_config = config
243
+ return self
244
+
245
+ def set_get_filters_config(self, config: SdkConfig):
246
+ """
247
+ Sets method-level configuration for get_filters.
248
+
249
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
250
+ :return: The service instance for method chaining.
251
+ """
252
+ self._get_filters_config = config
253
+ return self
254
+
255
+ def set_list_tasks_config(self, config: SdkConfig):
256
+ """
257
+ Sets method-level configuration for list_tasks.
258
+
259
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
260
+ :return: The service instance for method chaining.
261
+ """
262
+ self._list_tasks_config = config
263
+ return self
264
+
265
+ def set_import_results_config(self, config: SdkConfig):
266
+ """
267
+ Sets method-level configuration for import_results.
268
+
269
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
270
+ :return: The service instance for method chaining.
271
+ """
272
+ self._import_results_config = config
273
+ return self
274
+
275
+ def set_get_overview_config(self, config: SdkConfig):
276
+ """
277
+ Sets method-level configuration for get_overview.
278
+
279
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
280
+ :return: The service instance for method chaining.
281
+ """
282
+ self._get_overview_config = config
283
+ return self
284
+
285
+ def set_get_comparison_config(self, config: SdkConfig):
286
+ """
287
+ Sets method-level configuration for get_comparison.
288
+
289
+ :param SdkConfig config: Configuration dictionary to override service-level defaults.
290
+ :return: The service instance for method chaining.
291
+ """
292
+ self._get_comparison_config = config
293
+ return self
294
+
295
+ @property
296
+ def with_raw_response(self) -> "RawJobsClient":
297
+ """
298
+ Returns a raw-response client whose methods mirror this resource but return
299
+ ``HttpResponse[T]`` (parsed body plus the raw status code and headers) instead of
300
+ the bare deserialized body.
301
+ """
302
+ return RawJobsClient(self)
303
+
304
+ @cast_models
305
+ def get_sharing(
306
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
307
+ ) -> JobSharing:
308
+ """get_sharing
309
+
310
+ :param job_id: job_id
311
+ :type job_id: str
312
+ ...
313
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
314
+ ...
315
+ :return: The parsed response data.
316
+ :rtype: JobSharing
317
+ """
318
+
319
+ Validator(str).validate(job_id, "job_id")
320
+
321
+ resolved_config = self._get_resolved_config(
322
+ self._get_sharing_config, request_options
323
+ )
324
+
325
+ serialized_request = (
326
+ Serializer(
327
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}/shares",
328
+ [self.get_access_token(resolved_config)],
329
+ resolved_config,
330
+ )
331
+ .add_header(
332
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
333
+ )
334
+ .add_path("job_id", job_id)
335
+ .add_error(401, UnauthorizedEncoded)
336
+ .add_error(403, ForbiddenEncoded)
337
+ .add_error(404, NotFoundEncoded)
338
+ .add_error(500, InternalServerErrorEncoded)
339
+ .serialize()
340
+ .set_method("GET")
341
+ )
342
+
343
+ response, status, content = self.send_request(serialized_request)
344
+ return (
345
+ None
346
+ if response in (b"", "")
347
+ else (
348
+ JobSharing.model_validate(response)
349
+ if should_validate_response(resolved_config)
350
+ else construct_lenient(JobSharing, response)
351
+ )
352
+ )
353
+
354
+ @cast_models
355
+ def update_sharing(
356
+ self,
357
+ job_id: str,
358
+ *,
359
+ add_organization_ids: List[str] = SENTINEL,
360
+ remove_organization_ids: List[str] = SENTINEL,
361
+ add_usernames: List[str] = SENTINEL,
362
+ remove_usernames: List[str] = SENTINEL,
363
+ visibility: UpdateJobSharingRequestVisibility = SENTINEL,
364
+ confirm_non_member_organizations: bool = SENTINEL,
365
+ request_options: Optional[RequestOptions] = None,
366
+ ) -> JobSharing:
367
+ """update_sharing
368
+
369
+ :param request_body: The request body.
370
+ :type request_body: UpdateJobSharingRequest
371
+ :param job_id: job_id
372
+ :type job_id: str
373
+ ...
374
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
375
+ ...
376
+ :return: The parsed response data.
377
+ :rtype: JobSharing
378
+ """
379
+
380
+ Validator(str).validate(job_id, "job_id")
381
+
382
+ resolved_config = self._get_resolved_config(
383
+ self._update_sharing_config, request_options
384
+ )
385
+
386
+ request_body = UpdateJobSharingRequest(
387
+ **dict[str, Any](
388
+ {
389
+ k: v
390
+ for k, v in {
391
+ "add_organization_ids": add_organization_ids,
392
+ "remove_organization_ids": remove_organization_ids,
393
+ "add_usernames": add_usernames,
394
+ "remove_usernames": remove_usernames,
395
+ "visibility": visibility,
396
+ "confirm_non_member_organizations": confirm_non_member_organizations,
397
+ }.items()
398
+ if v is not SENTINEL
399
+ }
400
+ )
401
+ )
402
+ Validator(UpdateJobSharingRequest).validate(request_body, "request_body")
403
+ serialized_request = (
404
+ Serializer(
405
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}/shares",
406
+ [self.get_access_token(resolved_config)],
407
+ resolved_config,
408
+ )
409
+ .add_header(
410
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
411
+ )
412
+ .add_path("job_id", job_id)
413
+ .add_error(401, UnauthorizedEncoded)
414
+ .add_error(403, ForbiddenEncoded)
415
+ .add_error(404, NotFoundEncoded)
416
+ .add_error(500, InternalServerErrorEncoded)
417
+ .serialize()
418
+ .set_method("PATCH")
419
+ .set_body(request_body)
420
+ )
421
+
422
+ response, status, content = self.send_request(serialized_request)
423
+ return (
424
+ None
425
+ if response in (b"", "")
426
+ else (
427
+ JobSharing.model_validate(response)
428
+ if should_validate_response(resolved_config)
429
+ else construct_lenient(JobSharing, response)
430
+ )
431
+ )
432
+
433
+ @cast_models
434
+ def get_trial_status(
435
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
436
+ ) -> List[JobTrialStatusItem]:
437
+ """get_trial_status
438
+
439
+ :param job_id: job_id
440
+ :type job_id: str
441
+ ...
442
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
443
+ ...
444
+ :return: The parsed response data.
445
+ :rtype: List[JobTrialStatusItem]
446
+ """
447
+
448
+ Validator(str).validate(job_id, "job_id")
449
+
450
+ resolved_config = self._get_resolved_config(
451
+ self._get_trial_status_config, request_options
452
+ )
453
+
454
+ serialized_request = (
455
+ Serializer(
456
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}/trial-status",
457
+ [self.get_access_token(resolved_config)],
458
+ resolved_config,
459
+ )
460
+ .add_header(
461
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
462
+ )
463
+ .add_path("job_id", job_id)
464
+ .add_error(401, UnauthorizedEncoded)
465
+ .add_error(403, ForbiddenEncoded)
466
+ .add_error(404, NotFoundEncoded)
467
+ .add_error(500, InternalServerErrorEncoded)
468
+ .serialize()
469
+ .set_method("GET")
470
+ )
471
+
472
+ response, status, content = self.send_request(serialized_request)
473
+ return (
474
+ [
475
+ JobTrialStatusItem.model_validate(item)
476
+ for item in (response if isinstance(response, list) else [])
477
+ ]
478
+ if should_validate_response(resolved_config)
479
+ else construct_lenient(
480
+ List[JobTrialStatusItem],
481
+ (response if isinstance(response, list) else []),
482
+ )
483
+ )
484
+
485
+ @cast_models
486
+ def get(
487
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
488
+ ) -> JobResponse:
489
+ """get
490
+
491
+ :param job_id: job_id
492
+ :type job_id: str
493
+ ...
494
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
495
+ ...
496
+ :return: The parsed response data.
497
+ :rtype: JobResponse
498
+ """
499
+
500
+ Validator(str).validate(job_id, "job_id")
501
+
502
+ resolved_config = self._get_resolved_config(self._get_config, request_options)
503
+
504
+ serialized_request = (
505
+ Serializer(
506
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}",
507
+ [self.get_access_token(resolved_config)],
508
+ resolved_config,
509
+ )
510
+ .add_header(
511
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
512
+ )
513
+ .add_path("job_id", job_id)
514
+ .add_error(401, UnauthorizedEncoded)
515
+ .add_error(403, ForbiddenEncoded)
516
+ .add_error(404, NotFoundEncoded)
517
+ .add_error(500, InternalServerErrorEncoded)
518
+ .serialize()
519
+ .set_method("GET")
520
+ )
521
+
522
+ response, status, content = self.send_request(serialized_request)
523
+ return (
524
+ None
525
+ if response in (b"", "")
526
+ else (
527
+ JobResponse.model_validate(response)
528
+ if should_validate_response(resolved_config)
529
+ else construct_lenient(JobResponse, response)
530
+ )
531
+ )
532
+
533
+ @cast_models
534
+ def rename(
535
+ self,
536
+ job_id: str,
537
+ *,
538
+ job_name: str,
539
+ request_options: Optional[RequestOptions] = None,
540
+ ) -> RenameJobResponse:
541
+ """rename
542
+
543
+ :param request_body: The request body.
544
+ :type request_body: JobsRenameRequest
545
+ :param job_id: job_id
546
+ :type job_id: str
547
+ ...
548
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
549
+ ...
550
+ :return: The parsed response data.
551
+ :rtype: RenameJobResponse
552
+ """
553
+
554
+ Validator(str).validate(job_id, "job_id")
555
+
556
+ resolved_config = self._get_resolved_config(
557
+ self._rename_config, request_options
558
+ )
559
+
560
+ request_body = JobsRenameRequest(job_name=job_name)
561
+ Validator(JobsRenameRequest).validate(request_body, "request_body")
562
+ serialized_request = (
563
+ Serializer(
564
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}",
565
+ [self.get_access_token(resolved_config)],
566
+ resolved_config,
567
+ )
568
+ .add_header(
569
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
570
+ )
571
+ .add_path("job_id", job_id)
572
+ .add_error(401, UnauthorizedEncoded)
573
+ .add_error(403, ForbiddenEncoded)
574
+ .add_error(404, NotFoundEncoded)
575
+ .add_error(500, InternalServerErrorEncoded)
576
+ .serialize()
577
+ .set_method("PATCH")
578
+ .set_body(request_body)
579
+ )
580
+
581
+ response, status, content = self.send_request(serialized_request)
582
+ return (
583
+ None
584
+ if response in (b"", "")
585
+ else (
586
+ RenameJobResponse.model_validate(response)
587
+ if should_validate_response(resolved_config)
588
+ else construct_lenient(RenameJobResponse, response)
589
+ )
590
+ )
591
+
592
+ @cast_models
593
+ def get_artifact_download(
594
+ self,
595
+ job_id: str,
596
+ *,
597
+ artifact_type: JobArtifactType,
598
+ request_options: Optional[RequestOptions] = None,
599
+ ) -> StorageDownload:
600
+ """get_artifact_download
601
+
602
+ :param job_id: job_id
603
+ :type job_id: str
604
+ :param artifact_type: artifact_type
605
+ :type artifact_type: JobArtifactType
606
+ ...
607
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
608
+ ...
609
+ :return: The parsed response data.
610
+ :rtype: StorageDownload
611
+ """
612
+
613
+ Validator(str).validate(job_id, "job_id")
614
+ Validator(JobArtifactType).validate(artifact_type, "artifact_type")
615
+
616
+ resolved_config = self._get_resolved_config(
617
+ self._get_artifact_download_config, request_options
618
+ )
619
+
620
+ serialized_request = (
621
+ Serializer(
622
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}/artifacts",
623
+ [self.get_access_token(resolved_config)],
624
+ resolved_config,
625
+ )
626
+ .add_header(
627
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
628
+ )
629
+ .add_path("job_id", job_id)
630
+ .add_query("artifact_type", artifact_type)
631
+ .add_error(401, UnauthorizedEncoded)
632
+ .add_error(403, ForbiddenEncoded)
633
+ .add_error(404, NotFoundEncoded)
634
+ .add_error(429, TooManyRequestsEncoded)
635
+ .add_error(500, InternalServerErrorEncoded)
636
+ .serialize()
637
+ .set_method("GET")
638
+ )
639
+
640
+ response, status, content = self.send_request(serialized_request)
641
+ return (
642
+ None
643
+ if response in (b"", "")
644
+ else (
645
+ StorageDownload.model_validate(response)
646
+ if should_validate_response(resolved_config)
647
+ else construct_lenient(StorageDownload, response)
648
+ )
649
+ )
650
+
651
+ @cast_models
652
+ def submit(
653
+ self,
654
+ *,
655
+ config: SubmitJobRequestConfig,
656
+ idempotency_key: str,
657
+ dry_run: bool = SENTINEL,
658
+ job_secrets: Union[dict, None] = SENTINEL,
659
+ registry_credentials: Union[dict, None] = SENTINEL,
660
+ regrade: SubmitJobRequestRegrade = SENTINEL,
661
+ organization_id: str = SENTINEL,
662
+ relay_inference: bool = SENTINEL,
663
+ session_id: Union[str, None] = SENTINEL,
664
+ request_options: Optional[RequestOptions] = None,
665
+ ) -> JobsSubmitResponse:
666
+ """submit
667
+
668
+ :param request_body: The request body.
669
+ :type request_body: SubmitJobRequest
670
+ :param idempotency_key: idempotency_key
671
+ :type idempotency_key: str
672
+ ...
673
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
674
+ ...
675
+ :return: The parsed response data.
676
+ :rtype: JobsSubmitResponse
677
+ """
678
+
679
+ Validator(str).validate(idempotency_key, "idempotency_key")
680
+
681
+ resolved_config = self._get_resolved_config(
682
+ self._submit_config, request_options
683
+ )
684
+
685
+ request_body = SubmitJobRequest(
686
+ config=config,
687
+ **dict[str, Any](
688
+ {
689
+ k: v
690
+ for k, v in {
691
+ "dry_run": dry_run,
692
+ "job_secrets": job_secrets,
693
+ "registry_credentials": registry_credentials,
694
+ "regrade": regrade,
695
+ "organization_id": organization_id,
696
+ "relay_inference": relay_inference,
697
+ "session_id": session_id,
698
+ }.items()
699
+ if v is not SENTINEL
700
+ }
701
+ ),
702
+ )
703
+ Validator(SubmitJobRequest).validate(request_body, "request_body")
704
+ serialized_request = (
705
+ Serializer(
706
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/submit",
707
+ [self.get_access_token(resolved_config)],
708
+ resolved_config,
709
+ )
710
+ .add_header(
711
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
712
+ )
713
+ .add_header("idempotency-key", idempotency_key)
714
+ .add_error(401, UnauthorizedEncoded)
715
+ .add_error(403, ForbiddenEncoded)
716
+ .add_error(404, NotFoundEncoded)
717
+ .add_error(429, TooManyRequestsEncoded)
718
+ .add_error(500, InternalServerErrorEncoded)
719
+ .add_error(503, ServiceUnavailableEncoded)
720
+ .serialize()
721
+ .set_method("POST")
722
+ .set_body(request_body)
723
+ )
724
+
725
+ response, status, content = self.send_request(serialized_request)
726
+ return (
727
+ None
728
+ if response in (b"", "")
729
+ else (
730
+ JobsSubmitResponse_adapter.validate_python(response)
731
+ if should_validate_response(resolved_config)
732
+ else construct_lenient(JobsSubmitResponse, response)
733
+ )
734
+ )
735
+
736
+ @cast_models
737
+ def delete(
738
+ self,
739
+ *,
740
+ job_ids: Union[List[str], None] = SENTINEL,
741
+ request_options: Optional[RequestOptions] = None,
742
+ ) -> DeleteJobsResponse:
743
+ """delete
744
+
745
+ :param request_body: The request body.
746
+ :type request_body: DeleteJobsRequest
747
+ ...
748
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
749
+ ...
750
+ :return: The parsed response data.
751
+ :rtype: DeleteJobsResponse
752
+ """
753
+
754
+ resolved_config = self._get_resolved_config(
755
+ self._delete_config, request_options
756
+ )
757
+
758
+ request_body = DeleteJobsRequest(
759
+ **dict[str, Any](
760
+ {k: v for k, v in {"job_ids": job_ids}.items() if v is not SENTINEL}
761
+ )
762
+ )
763
+ Validator(DeleteJobsRequest).validate(request_body, "request_body")
764
+ serialized_request = (
765
+ Serializer(
766
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/delete",
767
+ [self.get_access_token(resolved_config)],
768
+ resolved_config,
769
+ )
770
+ .add_header(
771
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
772
+ )
773
+ .add_error(401, UnauthorizedEncoded)
774
+ .add_error(403, ForbiddenEncoded)
775
+ .add_error(404, NotFoundEncoded)
776
+ .add_error(500, InternalServerErrorEncoded)
777
+ .serialize()
778
+ .set_method("POST")
779
+ .set_body(request_body)
780
+ )
781
+
782
+ response, status, content = self.send_request(serialized_request)
783
+ return (
784
+ None
785
+ if response in (b"", "")
786
+ else (
787
+ DeleteJobsResponse.model_validate(response)
788
+ if should_validate_response(resolved_config)
789
+ else construct_lenient(DeleteJobsResponse, response)
790
+ )
791
+ )
792
+
793
+ @cast_models
794
+ def transfer(
795
+ self,
796
+ job_id: str,
797
+ *,
798
+ target_organization_id: str,
799
+ keep_source_access: Union[bool, None] = SENTINEL,
800
+ keep_job_credentials: Union[bool, None] = SENTINEL,
801
+ request_options: Optional[RequestOptions] = None,
802
+ ) -> TransferJobResponse:
803
+ """transfer
804
+
805
+ :param request_body: The request body.
806
+ :type request_body: JobsTransferRequest
807
+ :param job_id: job_id
808
+ :type job_id: str
809
+ ...
810
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
811
+ ...
812
+ :return: The parsed response data.
813
+ :rtype: TransferJobResponse
814
+ """
815
+
816
+ Validator(str).validate(job_id, "job_id")
817
+
818
+ resolved_config = self._get_resolved_config(
819
+ self._transfer_config, request_options
820
+ )
821
+
822
+ request_body = JobsTransferRequest(
823
+ target_organization_id=target_organization_id,
824
+ **dict[str, Any](
825
+ {
826
+ k: v
827
+ for k, v in {
828
+ "keep_source_access": keep_source_access,
829
+ "keep_job_credentials": keep_job_credentials,
830
+ }.items()
831
+ if v is not SENTINEL
832
+ }
833
+ ),
834
+ )
835
+ Validator(JobsTransferRequest).validate(request_body, "request_body")
836
+ serialized_request = (
837
+ Serializer(
838
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}/transfer",
839
+ [self.get_access_token(resolved_config)],
840
+ resolved_config,
841
+ )
842
+ .add_header(
843
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
844
+ )
845
+ .add_path("job_id", job_id)
846
+ .add_error(401, UnauthorizedEncoded)
847
+ .add_error(403, ForbiddenEncoded)
848
+ .add_error(404, NotFoundEncoded)
849
+ .add_error(500, InternalServerErrorEncoded)
850
+ .serialize()
851
+ .set_method("POST")
852
+ .set_body(request_body)
853
+ )
854
+
855
+ response, status, content = self.send_request(serialized_request)
856
+ return (
857
+ None
858
+ if response in (b"", "")
859
+ else (
860
+ TransferJobResponse.model_validate(response)
861
+ if should_validate_response(resolved_config)
862
+ else construct_lenient(TransferJobResponse, response)
863
+ )
864
+ )
865
+
866
+ @cast_models
867
+ def copy(
868
+ self,
869
+ source_job_id: str,
870
+ *,
871
+ new_name: Union[str, None] = SENTINEL,
872
+ overwrite: Union[bool, None] = SENTINEL,
873
+ target_organization_id: Union[str, None] = SENTINEL,
874
+ request_options: Optional[RequestOptions] = None,
875
+ ) -> StorageCopyResult:
876
+ """copy
877
+
878
+ :param request_body: The request body.
879
+ :type request_body: JobsCopyRequest
880
+ :param source_job_id: source_job_id
881
+ :type source_job_id: str
882
+ ...
883
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
884
+ ...
885
+ :return: The parsed response data.
886
+ :rtype: StorageCopyResult
887
+ """
888
+
889
+ Validator(str).validate(source_job_id, "source_job_id")
890
+
891
+ resolved_config = self._get_resolved_config(self._copy_config, request_options)
892
+
893
+ request_body = JobsCopyRequest(
894
+ **dict[str, Any](
895
+ {
896
+ k: v
897
+ for k, v in {
898
+ "new_name": new_name,
899
+ "overwrite": overwrite,
900
+ "target_organization_id": target_organization_id,
901
+ }.items()
902
+ if v is not SENTINEL
903
+ }
904
+ )
905
+ )
906
+ Validator(JobsCopyRequest).validate(request_body, "request_body")
907
+ serialized_request = (
908
+ Serializer(
909
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{source_job_id}}/copy",
910
+ [self.get_access_token(resolved_config)],
911
+ resolved_config,
912
+ )
913
+ .add_header(
914
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
915
+ )
916
+ .add_path("source_job_id", source_job_id)
917
+ .add_error(401, UnauthorizedEncoded)
918
+ .add_error(403, ForbiddenEncoded)
919
+ .add_error(404, NotFoundEncoded)
920
+ .add_error(429, TooManyRequestsEncoded)
921
+ .add_error(500, InternalServerErrorEncoded)
922
+ .serialize()
923
+ .set_method("POST")
924
+ .set_body(request_body)
925
+ )
926
+
927
+ response, status, content = self.send_request(serialized_request)
928
+ return (
929
+ None
930
+ if response in (b"", "")
931
+ else (
932
+ StorageCopyResult.model_validate(response)
933
+ if should_validate_response(resolved_config)
934
+ else construct_lenient(StorageCopyResult, response)
935
+ )
936
+ )
937
+
938
+ @cast_models
939
+ def pause(
940
+ self,
941
+ job_id: str,
942
+ *,
943
+ idempotency_key: str,
944
+ request_options: Optional[RequestOptions] = None,
945
+ ) -> JobResponse:
946
+ """pause
947
+
948
+ :param job_id: job_id
949
+ :type job_id: str
950
+ :param idempotency_key: idempotency_key
951
+ :type idempotency_key: str
952
+ ...
953
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
954
+ ...
955
+ :return: The parsed response data.
956
+ :rtype: JobResponse
957
+ """
958
+
959
+ Validator(str).validate(job_id, "job_id")
960
+ Validator(str).validate(idempotency_key, "idempotency_key")
961
+
962
+ resolved_config = self._get_resolved_config(self._pause_config, request_options)
963
+
964
+ serialized_request = (
965
+ Serializer(
966
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}/pause",
967
+ [self.get_access_token(resolved_config)],
968
+ resolved_config,
969
+ )
970
+ .add_header(
971
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
972
+ )
973
+ .add_header("idempotency-key", idempotency_key)
974
+ .add_path("job_id", job_id)
975
+ .add_error(401, UnauthorizedEncoded)
976
+ .add_error(403, ForbiddenEncoded)
977
+ .add_error(404, NotFoundEncoded)
978
+ .add_error(500, InternalServerErrorEncoded)
979
+ .serialize()
980
+ .set_method("POST")
981
+ )
982
+
983
+ response, status, content = self.send_request(serialized_request)
984
+ return (
985
+ None
986
+ if response in (b"", "")
987
+ else (
988
+ JobResponse.model_validate(response)
989
+ if should_validate_response(resolved_config)
990
+ else construct_lenient(JobResponse, response)
991
+ )
992
+ )
993
+
994
+ @cast_models
995
+ def resume(
996
+ self,
997
+ job_id: str,
998
+ *,
999
+ idempotency_key: str,
1000
+ request_options: Optional[RequestOptions] = None,
1001
+ ) -> JobResponse:
1002
+ """resume
1003
+
1004
+ :param job_id: job_id
1005
+ :type job_id: str
1006
+ :param idempotency_key: idempotency_key
1007
+ :type idempotency_key: str
1008
+ ...
1009
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
1010
+ ...
1011
+ :return: The parsed response data.
1012
+ :rtype: JobResponse
1013
+ """
1014
+
1015
+ Validator(str).validate(job_id, "job_id")
1016
+ Validator(str).validate(idempotency_key, "idempotency_key")
1017
+
1018
+ resolved_config = self._get_resolved_config(
1019
+ self._resume_config, request_options
1020
+ )
1021
+
1022
+ serialized_request = (
1023
+ Serializer(
1024
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}/resume",
1025
+ [self.get_access_token(resolved_config)],
1026
+ resolved_config,
1027
+ )
1028
+ .add_header(
1029
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
1030
+ )
1031
+ .add_header("idempotency-key", idempotency_key)
1032
+ .add_path("job_id", job_id)
1033
+ .add_error(401, UnauthorizedEncoded)
1034
+ .add_error(403, ForbiddenEncoded)
1035
+ .add_error(404, NotFoundEncoded)
1036
+ .add_error(500, InternalServerErrorEncoded)
1037
+ .serialize()
1038
+ .set_method("POST")
1039
+ )
1040
+
1041
+ response, status, content = self.send_request(serialized_request)
1042
+ return (
1043
+ None
1044
+ if response in (b"", "")
1045
+ else (
1046
+ JobResponse.model_validate(response)
1047
+ if should_validate_response(resolved_config)
1048
+ else construct_lenient(JobResponse, response)
1049
+ )
1050
+ )
1051
+
1052
+ @cast_models
1053
+ def cancel(
1054
+ self,
1055
+ job_id: str,
1056
+ *,
1057
+ idempotency_key: str,
1058
+ force: bool = SENTINEL,
1059
+ request_options: Optional[RequestOptions] = None,
1060
+ ) -> JobResponse:
1061
+ """cancel
1062
+
1063
+ :param request_body: The request body.
1064
+ :type request_body: CancelJobRequest
1065
+ :param job_id: job_id
1066
+ :type job_id: str
1067
+ :param idempotency_key: idempotency_key
1068
+ :type idempotency_key: str
1069
+ ...
1070
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
1071
+ ...
1072
+ :return: The parsed response data.
1073
+ :rtype: JobResponse
1074
+ """
1075
+
1076
+ Validator(str).validate(job_id, "job_id")
1077
+ Validator(str).validate(idempotency_key, "idempotency_key")
1078
+
1079
+ resolved_config = self._get_resolved_config(
1080
+ self._cancel_config, request_options
1081
+ )
1082
+
1083
+ request_body = CancelJobRequest(
1084
+ **dict[str, Any](
1085
+ {k: v for k, v in {"force": force}.items() if v is not SENTINEL}
1086
+ )
1087
+ )
1088
+ Validator(CancelJobRequest).validate(request_body, "request_body")
1089
+ serialized_request = (
1090
+ Serializer(
1091
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}/cancel",
1092
+ [self.get_access_token(resolved_config)],
1093
+ resolved_config,
1094
+ )
1095
+ .add_header(
1096
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
1097
+ )
1098
+ .add_header("idempotency-key", idempotency_key)
1099
+ .add_path("job_id", job_id)
1100
+ .add_error(401, UnauthorizedEncoded)
1101
+ .add_error(403, ForbiddenEncoded)
1102
+ .add_error(404, NotFoundEncoded)
1103
+ .add_error(500, InternalServerErrorEncoded)
1104
+ .serialize()
1105
+ .set_method("POST")
1106
+ .set_body(request_body)
1107
+ )
1108
+
1109
+ response, status, content = self.send_request(serialized_request)
1110
+ return (
1111
+ None
1112
+ if response in (b"", "")
1113
+ else (
1114
+ JobResponse.model_validate(response)
1115
+ if should_validate_response(resolved_config)
1116
+ else construct_lenient(JobResponse, response)
1117
+ )
1118
+ )
1119
+
1120
+ @cast_models
1121
+ def list(
1122
+ self,
1123
+ *,
1124
+ task: List[str] = SENTINEL,
1125
+ state: RunState = SENTINEL,
1126
+ name: str = SENTINEL,
1127
+ q: str = SENTINEL,
1128
+ agent_name: List[str] = SENTINEL,
1129
+ agent_version: List[str] = SENTINEL,
1130
+ model_name: List[str] = SENTINEL,
1131
+ model_provider: List[str] = SENTINEL,
1132
+ reasoning_effort: List[str] = SENTINEL,
1133
+ source: List[str] = SENTINEL,
1134
+ created_after: str = SENTINEL,
1135
+ created_before: str = SENTINEL,
1136
+ page_size: str = SENTINEL,
1137
+ page_token: str = SENTINEL,
1138
+ sort: JobsListRequestSort = SENTINEL,
1139
+ request_options: Optional[RequestOptions] = None,
1140
+ ) -> SyncPager[JobSummary]:
1141
+ """list
1142
+
1143
+ :param task: task, defaults to None
1144
+ :type task: List[str], optional
1145
+ :param state: state, defaults to None
1146
+ :type state: RunState, optional
1147
+ :param name: name, defaults to None
1148
+ :type name: str, optional
1149
+ :param q: q, defaults to None
1150
+ :type q: str, optional
1151
+ :param agent_name: agent_name, defaults to None
1152
+ :type agent_name: List[str], optional
1153
+ :param agent_version: agent_version, defaults to None
1154
+ :type agent_version: List[str], optional
1155
+ :param model_name: model_name, defaults to None
1156
+ :type model_name: List[str], optional
1157
+ :param model_provider: model_provider, defaults to None
1158
+ :type model_provider: List[str], optional
1159
+ :param reasoning_effort: reasoning_effort, defaults to None
1160
+ :type reasoning_effort: List[str], optional
1161
+ :param source: source, defaults to None
1162
+ :type source: List[str], optional
1163
+ :param created_after: created_after, defaults to None
1164
+ :type created_after: str, optional
1165
+ :param created_before: created_before, defaults to None
1166
+ :type created_before: str, optional
1167
+ :param page_size: page_size, defaults to None
1168
+ :type page_size: str, optional
1169
+ :param page_token: page_token, defaults to None
1170
+ :type page_token: str, optional
1171
+ :param sort: sort, defaults to None
1172
+ :type sort: JobsListRequestSort, optional
1173
+ ...
1174
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
1175
+ ...
1176
+ :return: The parsed response data.
1177
+ :rtype: SyncPager[JobSummary]
1178
+ """
1179
+ self = self._for_one_call()
1180
+
1181
+ Validator(str).is_array().is_optional().validate(task, "task")
1182
+ Validator(RunState).is_optional().validate(state, "state")
1183
+ Validator(str).is_optional().validate(name, "name")
1184
+ Validator(str).is_optional().validate(q, "q")
1185
+ Validator(str).is_array().is_optional().validate(agent_name, "agent_name")
1186
+ Validator(str).is_array().is_optional().validate(agent_version, "agent_version")
1187
+ Validator(str).is_array().is_optional().validate(model_name, "model_name")
1188
+ Validator(str).is_array().is_optional().validate(
1189
+ model_provider, "model_provider"
1190
+ )
1191
+ Validator(str).is_array().is_optional().validate(
1192
+ reasoning_effort, "reasoning_effort"
1193
+ )
1194
+ Validator(str).is_array().is_optional().validate(source, "source")
1195
+ Validator(str).is_optional().validate(created_after, "created_after")
1196
+ Validator(str).is_optional().validate(created_before, "created_before")
1197
+ Validator(str).is_optional().validate(page_size, "page_size")
1198
+ Validator(str).is_optional().validate(page_token, "page_token")
1199
+ Validator(JobsListRequestSort).is_optional().validate(sort, "sort")
1200
+
1201
+ resolved_config = self._get_resolved_config(self._list_config, request_options)
1202
+
1203
+ def _paginate() -> Generator[List[JobSummary], None, None]:
1204
+ nonlocal page_token
1205
+ while True:
1206
+ serialized_request = (
1207
+ Serializer(
1208
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs",
1209
+ [self.get_access_token(resolved_config)],
1210
+ resolved_config,
1211
+ )
1212
+ .add_header(
1213
+ "Harbor-API-Version",
1214
+ self._global_headers.get("Harbor-API-Version"),
1215
+ )
1216
+ .add_query("task", task)
1217
+ .add_query("state", state)
1218
+ .add_query("name", name)
1219
+ .add_query("q", q)
1220
+ .add_query("agent_name", agent_name)
1221
+ .add_query("agent_version", agent_version)
1222
+ .add_query("model_name", model_name)
1223
+ .add_query("model_provider", model_provider)
1224
+ .add_query("reasoning_effort", reasoning_effort)
1225
+ .add_query("source", source)
1226
+ .add_query("created_after", created_after)
1227
+ .add_query("created_before", created_before)
1228
+ .add_query("page_size", page_size)
1229
+ .add_query("page_token", page_token)
1230
+ .add_query("sort", sort)
1231
+ .add_error(401, UnauthorizedEncoded)
1232
+ .add_error(403, ForbiddenEncoded)
1233
+ .add_error(404, NotFoundEncoded)
1234
+ .add_error(500, InternalServerErrorEncoded)
1235
+ .serialize()
1236
+ .set_method("GET")
1237
+ )
1238
+ response, status, content = self.send_request(serialized_request)
1239
+ parsed_response = (
1240
+ JobPage.model_validate(response)
1241
+ if should_validate_response(resolved_config)
1242
+ else construct_lenient(JobPage, response)
1243
+ )
1244
+ current_page = parsed_response.items
1245
+
1246
+ yield current_page
1247
+
1248
+ next_cursor = parsed_response.next_page_token
1249
+ if not next_cursor:
1250
+ break
1251
+
1252
+ page_token = next_cursor
1253
+
1254
+ return SyncPager(_paginate(), lambda: self._last_response)
1255
+
1256
+ @cast_models
1257
+ def get_filters(
1258
+ self,
1259
+ *,
1260
+ field: JobsGetFiltersRequestField,
1261
+ task: List[str] = SENTINEL,
1262
+ state: RunState = SENTINEL,
1263
+ name: str = SENTINEL,
1264
+ q: str = SENTINEL,
1265
+ agent_name: List[str] = SENTINEL,
1266
+ agent_version: List[str] = SENTINEL,
1267
+ model_name: List[str] = SENTINEL,
1268
+ model_provider: List[str] = SENTINEL,
1269
+ reasoning_effort: List[str] = SENTINEL,
1270
+ source: List[str] = SENTINEL,
1271
+ created_after: str = SENTINEL,
1272
+ created_before: str = SENTINEL,
1273
+ limit: str = SENTINEL,
1274
+ request_options: Optional[RequestOptions] = None,
1275
+ ) -> FilterValuesResponse:
1276
+ """get_filters
1277
+
1278
+ :param field: field
1279
+ :type field: JobsGetFiltersRequestField
1280
+ :param task: task, defaults to None
1281
+ :type task: List[str], optional
1282
+ :param state: state, defaults to None
1283
+ :type state: RunState, optional
1284
+ :param name: name, defaults to None
1285
+ :type name: str, optional
1286
+ :param q: q, defaults to None
1287
+ :type q: str, optional
1288
+ :param agent_name: agent_name, defaults to None
1289
+ :type agent_name: List[str], optional
1290
+ :param agent_version: agent_version, defaults to None
1291
+ :type agent_version: List[str], optional
1292
+ :param model_name: model_name, defaults to None
1293
+ :type model_name: List[str], optional
1294
+ :param model_provider: model_provider, defaults to None
1295
+ :type model_provider: List[str], optional
1296
+ :param reasoning_effort: reasoning_effort, defaults to None
1297
+ :type reasoning_effort: List[str], optional
1298
+ :param source: source, defaults to None
1299
+ :type source: List[str], optional
1300
+ :param created_after: created_after, defaults to None
1301
+ :type created_after: str, optional
1302
+ :param created_before: created_before, defaults to None
1303
+ :type created_before: str, optional
1304
+ :param limit: limit, defaults to None
1305
+ :type limit: str, optional
1306
+ ...
1307
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
1308
+ ...
1309
+ :return: The parsed response data.
1310
+ :rtype: FilterValuesResponse
1311
+ """
1312
+
1313
+ Validator(JobsGetFiltersRequestField).validate(field, "field")
1314
+ Validator(str).is_array().is_optional().validate(task, "task")
1315
+ Validator(RunState).is_optional().validate(state, "state")
1316
+ Validator(str).is_optional().validate(name, "name")
1317
+ Validator(str).is_optional().validate(q, "q")
1318
+ Validator(str).is_array().is_optional().validate(agent_name, "agent_name")
1319
+ Validator(str).is_array().is_optional().validate(agent_version, "agent_version")
1320
+ Validator(str).is_array().is_optional().validate(model_name, "model_name")
1321
+ Validator(str).is_array().is_optional().validate(
1322
+ model_provider, "model_provider"
1323
+ )
1324
+ Validator(str).is_array().is_optional().validate(
1325
+ reasoning_effort, "reasoning_effort"
1326
+ )
1327
+ Validator(str).is_array().is_optional().validate(source, "source")
1328
+ Validator(str).is_optional().validate(created_after, "created_after")
1329
+ Validator(str).is_optional().validate(created_before, "created_before")
1330
+ Validator(str).is_optional().validate(limit, "limit")
1331
+
1332
+ resolved_config = self._get_resolved_config(
1333
+ self._get_filters_config, request_options
1334
+ )
1335
+
1336
+ serialized_request = (
1337
+ Serializer(
1338
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/filters",
1339
+ [self.get_access_token(resolved_config)],
1340
+ resolved_config,
1341
+ )
1342
+ .add_header(
1343
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
1344
+ )
1345
+ .add_query("task", task)
1346
+ .add_query("state", state)
1347
+ .add_query("name", name)
1348
+ .add_query("q", q)
1349
+ .add_query("agent_name", agent_name)
1350
+ .add_query("agent_version", agent_version)
1351
+ .add_query("model_name", model_name)
1352
+ .add_query("model_provider", model_provider)
1353
+ .add_query("reasoning_effort", reasoning_effort)
1354
+ .add_query("source", source)
1355
+ .add_query("created_after", created_after)
1356
+ .add_query("created_before", created_before)
1357
+ .add_query("field", field)
1358
+ .add_query("limit", limit)
1359
+ .add_error(401, UnauthorizedEncoded)
1360
+ .add_error(403, ForbiddenEncoded)
1361
+ .add_error(404, NotFoundEncoded)
1362
+ .add_error(500, InternalServerErrorEncoded)
1363
+ .serialize()
1364
+ .set_method("GET")
1365
+ )
1366
+
1367
+ response, status, content = self.send_request(serialized_request)
1368
+ return (
1369
+ None
1370
+ if response in (b"", "")
1371
+ else (
1372
+ FilterValuesResponse.model_validate(response)
1373
+ if should_validate_response(resolved_config)
1374
+ else construct_lenient(FilterValuesResponse, response)
1375
+ )
1376
+ )
1377
+
1378
+ @cast_models
1379
+ def list_tasks(
1380
+ self,
1381
+ job_id: str,
1382
+ *,
1383
+ page_size: str = SENTINEL,
1384
+ page_token: str = SENTINEL,
1385
+ search: str = SENTINEL,
1386
+ agents: str = SENTINEL,
1387
+ providers: str = SENTINEL,
1388
+ models: str = SENTINEL,
1389
+ tasks: str = SENTINEL,
1390
+ sort_by: JobsListTasksRequestSortBy = SENTINEL,
1391
+ sort_order: JobsListTasksRequestSortOrder = SENTINEL,
1392
+ request_options: Optional[RequestOptions] = None,
1393
+ ) -> SyncPager[JobTaskSummary]:
1394
+ """list_tasks
1395
+
1396
+ :param job_id: job_id
1397
+ :type job_id: str
1398
+ :param page_size: page_size, defaults to None
1399
+ :type page_size: str, optional
1400
+ :param page_token: page_token, defaults to None
1401
+ :type page_token: str, optional
1402
+ :param search: search, defaults to None
1403
+ :type search: str, optional
1404
+ :param agents: agents, defaults to None
1405
+ :type agents: str, optional
1406
+ :param providers: providers, defaults to None
1407
+ :type providers: str, optional
1408
+ :param models: models, defaults to None
1409
+ :type models: str, optional
1410
+ :param tasks: tasks, defaults to None
1411
+ :type tasks: str, optional
1412
+ :param sort_by: sort_by, defaults to None
1413
+ :type sort_by: JobsListTasksRequestSortBy, optional
1414
+ :param sort_order: sort_order, defaults to None
1415
+ :type sort_order: JobsListTasksRequestSortOrder, optional
1416
+ ...
1417
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
1418
+ ...
1419
+ :return: The parsed response data.
1420
+ :rtype: SyncPager[JobTaskSummary]
1421
+ """
1422
+ self = self._for_one_call()
1423
+
1424
+ Validator(str).validate(job_id, "job_id")
1425
+ Validator(str).is_optional().validate(page_size, "page_size")
1426
+ Validator(str).is_optional().validate(page_token, "page_token")
1427
+ Validator(str).is_optional().validate(search, "search")
1428
+ Validator(str).is_optional().validate(agents, "agents")
1429
+ Validator(str).is_optional().validate(providers, "providers")
1430
+ Validator(str).is_optional().validate(models, "models")
1431
+ Validator(str).is_optional().validate(tasks, "tasks")
1432
+ Validator(JobsListTasksRequestSortBy).is_optional().validate(sort_by, "sort_by")
1433
+ Validator(JobsListTasksRequestSortOrder).is_optional().validate(
1434
+ sort_order, "sort_order"
1435
+ )
1436
+
1437
+ resolved_config = self._get_resolved_config(
1438
+ self._list_tasks_config, request_options
1439
+ )
1440
+
1441
+ def _paginate() -> Generator[List[JobTaskSummary], None, None]:
1442
+ nonlocal page_token
1443
+ while True:
1444
+ serialized_request = (
1445
+ Serializer(
1446
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/{{job_id}}/tasks",
1447
+ [self.get_access_token(resolved_config)],
1448
+ resolved_config,
1449
+ )
1450
+ .add_header(
1451
+ "Harbor-API-Version",
1452
+ self._global_headers.get("Harbor-API-Version"),
1453
+ )
1454
+ .add_path("job_id", job_id)
1455
+ .add_query("page_size", page_size)
1456
+ .add_query("page_token", page_token)
1457
+ .add_query("search", search)
1458
+ .add_query("agents", agents)
1459
+ .add_query("providers", providers)
1460
+ .add_query("models", models)
1461
+ .add_query("tasks", tasks)
1462
+ .add_query("sort_by", sort_by)
1463
+ .add_query("sort_order", sort_order)
1464
+ .add_error(401, UnauthorizedEncoded)
1465
+ .add_error(403, ForbiddenEncoded)
1466
+ .add_error(404, NotFoundEncoded)
1467
+ .add_error(500, InternalServerErrorEncoded)
1468
+ .serialize()
1469
+ .set_method("GET")
1470
+ )
1471
+ response, status, content = self.send_request(serialized_request)
1472
+ parsed_response = (
1473
+ JobTaskPage.model_validate(response)
1474
+ if should_validate_response(resolved_config)
1475
+ else construct_lenient(JobTaskPage, response)
1476
+ )
1477
+ current_page = parsed_response.items
1478
+
1479
+ yield current_page
1480
+
1481
+ next_cursor = parsed_response.next_page_token
1482
+ if not next_cursor:
1483
+ break
1484
+
1485
+ page_token = next_cursor
1486
+
1487
+ return SyncPager(_paginate(), lambda: self._last_response)
1488
+
1489
+ @cast_models
1490
+ def import_results(
1491
+ self,
1492
+ *,
1493
+ job_id: str,
1494
+ job_name: str,
1495
+ config: dict,
1496
+ organization_id: Union[str, None] = SENTINEL,
1497
+ visibility: ResultJobCreateVisibility = SENTINEL,
1498
+ started_at: Union[str, None] = SENTINEL,
1499
+ n_planned_trials: Union[int, None] = SENTINEL,
1500
+ request_options: Optional[RequestOptions] = None,
1501
+ ) -> CreatedResultJob:
1502
+ """import_results
1503
+
1504
+ :param request_body: The request body.
1505
+ :type request_body: ResultJobCreate
1506
+ ...
1507
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
1508
+ ...
1509
+ :return: The parsed response data.
1510
+ :rtype: CreatedResultJob
1511
+ """
1512
+
1513
+ resolved_config = self._get_resolved_config(
1514
+ self._import_results_config, request_options
1515
+ )
1516
+
1517
+ request_body = ResultJobCreate(
1518
+ job_id=job_id,
1519
+ job_name=job_name,
1520
+ config=config,
1521
+ **dict[str, Any](
1522
+ {
1523
+ k: v
1524
+ for k, v in {
1525
+ "organization_id": organization_id,
1526
+ "visibility": visibility,
1527
+ "started_at": started_at,
1528
+ "n_planned_trials": n_planned_trials,
1529
+ }.items()
1530
+ if v is not SENTINEL
1531
+ }
1532
+ ),
1533
+ )
1534
+ Validator(ResultJobCreate).validate(request_body, "request_body")
1535
+ serialized_request = (
1536
+ Serializer(
1537
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/import",
1538
+ [self.get_access_token(resolved_config)],
1539
+ resolved_config,
1540
+ )
1541
+ .add_header(
1542
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
1543
+ )
1544
+ .add_error(401, UnauthorizedEncoded)
1545
+ .add_error(403, ForbiddenEncoded)
1546
+ .add_error(404, NotFoundEncoded)
1547
+ .add_error(500, InternalServerErrorEncoded)
1548
+ .serialize()
1549
+ .set_method("POST")
1550
+ .set_body(request_body)
1551
+ )
1552
+
1553
+ response, status, content = self.send_request(serialized_request)
1554
+ return (
1555
+ None
1556
+ if response in (b"", "")
1557
+ else (
1558
+ CreatedResultJob.model_validate(response)
1559
+ if should_validate_response(resolved_config)
1560
+ else construct_lenient(CreatedResultJob, response)
1561
+ )
1562
+ )
1563
+
1564
+ @cast_models
1565
+ def get_overview(
1566
+ self,
1567
+ *,
1568
+ job_ids: str,
1569
+ force_combined: JobsGetOverviewRequestForceCombined = SENTINEL,
1570
+ request_options: Optional[RequestOptions] = None,
1571
+ ) -> JobOverview:
1572
+ """get_overview
1573
+
1574
+ :param job_ids: job_ids
1575
+ :type job_ids: str
1576
+ :param force_combined: force_combined, defaults to None
1577
+ :type force_combined: JobsGetOverviewRequestForceCombined, optional
1578
+ ...
1579
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
1580
+ ...
1581
+ :return: The parsed response data.
1582
+ :rtype: JobOverview
1583
+ """
1584
+
1585
+ Validator(str).validate(job_ids, "job_ids")
1586
+ Validator(JobsGetOverviewRequestForceCombined).is_optional().validate(
1587
+ force_combined, "force_combined"
1588
+ )
1589
+
1590
+ resolved_config = self._get_resolved_config(
1591
+ self._get_overview_config, request_options
1592
+ )
1593
+
1594
+ serialized_request = (
1595
+ Serializer(
1596
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/overview",
1597
+ [self.get_access_token(resolved_config)],
1598
+ resolved_config,
1599
+ )
1600
+ .add_header(
1601
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
1602
+ )
1603
+ .add_query("job_ids", job_ids)
1604
+ .add_query("force_combined", force_combined)
1605
+ .add_error(401, UnauthorizedEncoded)
1606
+ .add_error(403, ForbiddenEncoded)
1607
+ .add_error(404, NotFoundEncoded)
1608
+ .add_error(500, InternalServerErrorEncoded)
1609
+ .serialize()
1610
+ .set_method("GET")
1611
+ )
1612
+
1613
+ response, status, content = self.send_request(serialized_request)
1614
+ return (
1615
+ None
1616
+ if response in (b"", "")
1617
+ else (
1618
+ JobOverview.model_validate(response)
1619
+ if should_validate_response(resolved_config)
1620
+ else construct_lenient(JobOverview, response)
1621
+ )
1622
+ )
1623
+
1624
+ @cast_models
1625
+ def get_comparison(
1626
+ self, *, job_ids: str, request_options: Optional[RequestOptions] = None
1627
+ ) -> EvaluationComparison:
1628
+ """get_comparison
1629
+
1630
+ :param job_ids: job_ids
1631
+ :type job_ids: str
1632
+ ...
1633
+ :raises RequestError: Raised when a request fails, with optional HTTP status code and details.
1634
+ ...
1635
+ :return: The parsed response data.
1636
+ :rtype: EvaluationComparison
1637
+ """
1638
+
1639
+ Validator(str).validate(job_ids, "job_ids")
1640
+
1641
+ resolved_config = self._get_resolved_config(
1642
+ self._get_comparison_config, request_options
1643
+ )
1644
+
1645
+ serialized_request = (
1646
+ Serializer(
1647
+ f"{self._resolve_base_url(resolved_config) or HarborApiClientEnvironment.DEFAULT.url}/v1/jobs/comparisons",
1648
+ [self.get_access_token(resolved_config)],
1649
+ resolved_config,
1650
+ )
1651
+ .add_header(
1652
+ "Harbor-API-Version", self._global_headers.get("Harbor-API-Version")
1653
+ )
1654
+ .add_query("job_ids", job_ids)
1655
+ .add_error(401, UnauthorizedEncoded)
1656
+ .add_error(403, ForbiddenEncoded)
1657
+ .add_error(404, NotFoundEncoded)
1658
+ .add_error(500, InternalServerErrorEncoded)
1659
+ .serialize()
1660
+ .set_method("GET")
1661
+ )
1662
+
1663
+ response, status, content = self.send_request(serialized_request)
1664
+ return (
1665
+ None
1666
+ if response in (b"", "")
1667
+ else (
1668
+ EvaluationComparison.model_validate(response)
1669
+ if should_validate_response(resolved_config)
1670
+ else construct_lenient(EvaluationComparison, response)
1671
+ )
1672
+ )
1673
+
1674
+
1675
+ class RawJobsClient:
1676
+ """
1677
+ Raw-response client for JobsClient.
1678
+
1679
+ Each method delegates to the matching :class:`JobsClient` method and wraps the result in
1680
+ an ``HttpResponse[T]`` so callers can read ``.data`` alongside ``.status_code`` and
1681
+ ``.headers``.
1682
+ """
1683
+
1684
+ def __init__(self, client: JobsClient):
1685
+ self._client = client
1686
+ self._client_wrapper = client._client_wrapper
1687
+
1688
+ def get_sharing(
1689
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
1690
+ ) -> HttpResponse[JobSharing]:
1691
+ data = JobsClient.get_sharing(
1692
+ self._client, job_id, request_options=request_options
1693
+ )
1694
+ return HttpResponse(data=data, response=self._client._last_response)
1695
+
1696
+ def update_sharing(
1697
+ self,
1698
+ job_id: str,
1699
+ *,
1700
+ add_organization_ids: List[str] = SENTINEL,
1701
+ remove_organization_ids: List[str] = SENTINEL,
1702
+ add_usernames: List[str] = SENTINEL,
1703
+ remove_usernames: List[str] = SENTINEL,
1704
+ visibility: UpdateJobSharingRequestVisibility = SENTINEL,
1705
+ confirm_non_member_organizations: bool = SENTINEL,
1706
+ request_options: Optional[RequestOptions] = None,
1707
+ ) -> HttpResponse[JobSharing]:
1708
+ data = JobsClient.update_sharing(
1709
+ self._client,
1710
+ job_id,
1711
+ **dict[str, Any](
1712
+ {
1713
+ k: v
1714
+ for k, v in {
1715
+ "add_organization_ids": add_organization_ids,
1716
+ "remove_organization_ids": remove_organization_ids,
1717
+ "add_usernames": add_usernames,
1718
+ "remove_usernames": remove_usernames,
1719
+ "visibility": visibility,
1720
+ "confirm_non_member_organizations": confirm_non_member_organizations,
1721
+ }.items()
1722
+ if v is not SENTINEL
1723
+ }
1724
+ ),
1725
+ request_options=request_options,
1726
+ )
1727
+ return HttpResponse(data=data, response=self._client._last_response)
1728
+
1729
+ def get_trial_status(
1730
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
1731
+ ) -> HttpResponse[List[JobTrialStatusItem]]:
1732
+ data = JobsClient.get_trial_status(
1733
+ self._client, job_id, request_options=request_options
1734
+ )
1735
+ return HttpResponse(data=data, response=self._client._last_response)
1736
+
1737
+ def get(
1738
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
1739
+ ) -> HttpResponse[JobResponse]:
1740
+ data = JobsClient.get(self._client, job_id, request_options=request_options)
1741
+ return HttpResponse(data=data, response=self._client._last_response)
1742
+
1743
+ def rename(
1744
+ self,
1745
+ job_id: str,
1746
+ *,
1747
+ job_name: str,
1748
+ request_options: Optional[RequestOptions] = None,
1749
+ ) -> HttpResponse[RenameJobResponse]:
1750
+ data = JobsClient.rename(
1751
+ self._client, job_id, job_name=job_name, request_options=request_options
1752
+ )
1753
+ return HttpResponse(data=data, response=self._client._last_response)
1754
+
1755
+ def get_artifact_download(
1756
+ self,
1757
+ job_id: str,
1758
+ *,
1759
+ artifact_type: JobArtifactType,
1760
+ request_options: Optional[RequestOptions] = None,
1761
+ ) -> HttpResponse[StorageDownload]:
1762
+ data = JobsClient.get_artifact_download(
1763
+ self._client,
1764
+ job_id,
1765
+ artifact_type=artifact_type,
1766
+ request_options=request_options,
1767
+ )
1768
+ return HttpResponse(data=data, response=self._client._last_response)
1769
+
1770
+ def submit(
1771
+ self,
1772
+ *,
1773
+ config: SubmitJobRequestConfig,
1774
+ idempotency_key: str,
1775
+ dry_run: bool = SENTINEL,
1776
+ job_secrets: Union[dict, None] = SENTINEL,
1777
+ registry_credentials: Union[dict, None] = SENTINEL,
1778
+ regrade: SubmitJobRequestRegrade = SENTINEL,
1779
+ organization_id: str = SENTINEL,
1780
+ relay_inference: bool = SENTINEL,
1781
+ session_id: Union[str, None] = SENTINEL,
1782
+ request_options: Optional[RequestOptions] = None,
1783
+ ) -> HttpResponse[JobsSubmitResponse]:
1784
+ data = JobsClient.submit(
1785
+ self._client,
1786
+ config=config,
1787
+ idempotency_key=idempotency_key,
1788
+ **dict[str, Any](
1789
+ {
1790
+ k: v
1791
+ for k, v in {
1792
+ "dry_run": dry_run,
1793
+ "job_secrets": job_secrets,
1794
+ "registry_credentials": registry_credentials,
1795
+ "regrade": regrade,
1796
+ "organization_id": organization_id,
1797
+ "relay_inference": relay_inference,
1798
+ "session_id": session_id,
1799
+ }.items()
1800
+ if v is not SENTINEL
1801
+ }
1802
+ ),
1803
+ request_options=request_options,
1804
+ )
1805
+ return HttpResponse(data=data, response=self._client._last_response)
1806
+
1807
+ def delete(
1808
+ self,
1809
+ *,
1810
+ job_ids: Union[List[str], None] = SENTINEL,
1811
+ request_options: Optional[RequestOptions] = None,
1812
+ ) -> HttpResponse[DeleteJobsResponse]:
1813
+ data = JobsClient.delete(
1814
+ self._client,
1815
+ **dict[str, Any](
1816
+ {k: v for k, v in {"job_ids": job_ids}.items() if v is not SENTINEL}
1817
+ ),
1818
+ request_options=request_options,
1819
+ )
1820
+ return HttpResponse(data=data, response=self._client._last_response)
1821
+
1822
+ def transfer(
1823
+ self,
1824
+ job_id: str,
1825
+ *,
1826
+ target_organization_id: str,
1827
+ keep_source_access: Union[bool, None] = SENTINEL,
1828
+ keep_job_credentials: Union[bool, None] = SENTINEL,
1829
+ request_options: Optional[RequestOptions] = None,
1830
+ ) -> HttpResponse[TransferJobResponse]:
1831
+ data = JobsClient.transfer(
1832
+ self._client,
1833
+ job_id,
1834
+ target_organization_id=target_organization_id,
1835
+ **dict[str, Any](
1836
+ {
1837
+ k: v
1838
+ for k, v in {
1839
+ "keep_source_access": keep_source_access,
1840
+ "keep_job_credentials": keep_job_credentials,
1841
+ }.items()
1842
+ if v is not SENTINEL
1843
+ }
1844
+ ),
1845
+ request_options=request_options,
1846
+ )
1847
+ return HttpResponse(data=data, response=self._client._last_response)
1848
+
1849
+ def copy(
1850
+ self,
1851
+ source_job_id: str,
1852
+ *,
1853
+ new_name: Union[str, None] = SENTINEL,
1854
+ overwrite: Union[bool, None] = SENTINEL,
1855
+ target_organization_id: Union[str, None] = SENTINEL,
1856
+ request_options: Optional[RequestOptions] = None,
1857
+ ) -> HttpResponse[StorageCopyResult]:
1858
+ data = JobsClient.copy(
1859
+ self._client,
1860
+ source_job_id,
1861
+ **dict[str, Any](
1862
+ {
1863
+ k: v
1864
+ for k, v in {
1865
+ "new_name": new_name,
1866
+ "overwrite": overwrite,
1867
+ "target_organization_id": target_organization_id,
1868
+ }.items()
1869
+ if v is not SENTINEL
1870
+ }
1871
+ ),
1872
+ request_options=request_options,
1873
+ )
1874
+ return HttpResponse(data=data, response=self._client._last_response)
1875
+
1876
+ def pause(
1877
+ self,
1878
+ job_id: str,
1879
+ *,
1880
+ idempotency_key: str,
1881
+ request_options: Optional[RequestOptions] = None,
1882
+ ) -> HttpResponse[JobResponse]:
1883
+ data = JobsClient.pause(
1884
+ self._client,
1885
+ job_id,
1886
+ idempotency_key=idempotency_key,
1887
+ request_options=request_options,
1888
+ )
1889
+ return HttpResponse(data=data, response=self._client._last_response)
1890
+
1891
+ def resume(
1892
+ self,
1893
+ job_id: str,
1894
+ *,
1895
+ idempotency_key: str,
1896
+ request_options: Optional[RequestOptions] = None,
1897
+ ) -> HttpResponse[JobResponse]:
1898
+ data = JobsClient.resume(
1899
+ self._client,
1900
+ job_id,
1901
+ idempotency_key=idempotency_key,
1902
+ request_options=request_options,
1903
+ )
1904
+ return HttpResponse(data=data, response=self._client._last_response)
1905
+
1906
+ def cancel(
1907
+ self,
1908
+ job_id: str,
1909
+ *,
1910
+ idempotency_key: str,
1911
+ force: bool = SENTINEL,
1912
+ request_options: Optional[RequestOptions] = None,
1913
+ ) -> HttpResponse[JobResponse]:
1914
+ data = JobsClient.cancel(
1915
+ self._client,
1916
+ job_id,
1917
+ idempotency_key=idempotency_key,
1918
+ **dict[str, Any](
1919
+ {k: v for k, v in {"force": force}.items() if v is not SENTINEL}
1920
+ ),
1921
+ request_options=request_options,
1922
+ )
1923
+ return HttpResponse(data=data, response=self._client._last_response)
1924
+
1925
+ def list(
1926
+ self,
1927
+ *,
1928
+ task: List[str] = SENTINEL,
1929
+ state: RunState = SENTINEL,
1930
+ name: str = SENTINEL,
1931
+ q: str = SENTINEL,
1932
+ agent_name: List[str] = SENTINEL,
1933
+ agent_version: List[str] = SENTINEL,
1934
+ model_name: List[str] = SENTINEL,
1935
+ model_provider: List[str] = SENTINEL,
1936
+ reasoning_effort: List[str] = SENTINEL,
1937
+ source: List[str] = SENTINEL,
1938
+ created_after: str = SENTINEL,
1939
+ created_before: str = SENTINEL,
1940
+ page_size: str = SENTINEL,
1941
+ page_token: str = SENTINEL,
1942
+ sort: JobsListRequestSort = SENTINEL,
1943
+ request_options: Optional[RequestOptions] = None,
1944
+ ) -> HttpResponse[SyncPager[JobSummary]]:
1945
+ data = JobsClient.list(
1946
+ self._client,
1947
+ **dict[str, Any](
1948
+ {
1949
+ k: v
1950
+ for k, v in {
1951
+ "task": task,
1952
+ "state": state,
1953
+ "name": name,
1954
+ "q": q,
1955
+ "agent_name": agent_name,
1956
+ "agent_version": agent_version,
1957
+ "model_name": model_name,
1958
+ "model_provider": model_provider,
1959
+ "reasoning_effort": reasoning_effort,
1960
+ "source": source,
1961
+ "created_after": created_after,
1962
+ "created_before": created_before,
1963
+ "page_size": page_size,
1964
+ "page_token": page_token,
1965
+ "sort": sort,
1966
+ }.items()
1967
+ if v is not SENTINEL
1968
+ }
1969
+ ),
1970
+ request_options=request_options,
1971
+ )
1972
+ return HttpResponse(data=data, response_source=lambda: data.last_response)
1973
+
1974
+ def get_filters(
1975
+ self,
1976
+ *,
1977
+ field: JobsGetFiltersRequestField,
1978
+ task: List[str] = SENTINEL,
1979
+ state: RunState = SENTINEL,
1980
+ name: str = SENTINEL,
1981
+ q: str = SENTINEL,
1982
+ agent_name: List[str] = SENTINEL,
1983
+ agent_version: List[str] = SENTINEL,
1984
+ model_name: List[str] = SENTINEL,
1985
+ model_provider: List[str] = SENTINEL,
1986
+ reasoning_effort: List[str] = SENTINEL,
1987
+ source: List[str] = SENTINEL,
1988
+ created_after: str = SENTINEL,
1989
+ created_before: str = SENTINEL,
1990
+ limit: str = SENTINEL,
1991
+ request_options: Optional[RequestOptions] = None,
1992
+ ) -> HttpResponse[FilterValuesResponse]:
1993
+ data = JobsClient.get_filters(
1994
+ self._client,
1995
+ field=field,
1996
+ **dict[str, Any](
1997
+ {
1998
+ k: v
1999
+ for k, v in {
2000
+ "task": task,
2001
+ "state": state,
2002
+ "name": name,
2003
+ "q": q,
2004
+ "agent_name": agent_name,
2005
+ "agent_version": agent_version,
2006
+ "model_name": model_name,
2007
+ "model_provider": model_provider,
2008
+ "reasoning_effort": reasoning_effort,
2009
+ "source": source,
2010
+ "created_after": created_after,
2011
+ "created_before": created_before,
2012
+ "limit": limit,
2013
+ }.items()
2014
+ if v is not SENTINEL
2015
+ }
2016
+ ),
2017
+ request_options=request_options,
2018
+ )
2019
+ return HttpResponse(data=data, response=self._client._last_response)
2020
+
2021
+ def list_tasks(
2022
+ self,
2023
+ job_id: str,
2024
+ *,
2025
+ page_size: str = SENTINEL,
2026
+ page_token: str = SENTINEL,
2027
+ search: str = SENTINEL,
2028
+ agents: str = SENTINEL,
2029
+ providers: str = SENTINEL,
2030
+ models: str = SENTINEL,
2031
+ tasks: str = SENTINEL,
2032
+ sort_by: JobsListTasksRequestSortBy = SENTINEL,
2033
+ sort_order: JobsListTasksRequestSortOrder = SENTINEL,
2034
+ request_options: Optional[RequestOptions] = None,
2035
+ ) -> HttpResponse[SyncPager[JobTaskSummary]]:
2036
+ data = JobsClient.list_tasks(
2037
+ self._client,
2038
+ job_id,
2039
+ **dict[str, Any](
2040
+ {
2041
+ k: v
2042
+ for k, v in {
2043
+ "page_size": page_size,
2044
+ "page_token": page_token,
2045
+ "search": search,
2046
+ "agents": agents,
2047
+ "providers": providers,
2048
+ "models": models,
2049
+ "tasks": tasks,
2050
+ "sort_by": sort_by,
2051
+ "sort_order": sort_order,
2052
+ }.items()
2053
+ if v is not SENTINEL
2054
+ }
2055
+ ),
2056
+ request_options=request_options,
2057
+ )
2058
+ return HttpResponse(data=data, response_source=lambda: data.last_response)
2059
+
2060
+ def import_results(
2061
+ self,
2062
+ *,
2063
+ job_id: str,
2064
+ job_name: str,
2065
+ config: dict,
2066
+ organization_id: Union[str, None] = SENTINEL,
2067
+ visibility: ResultJobCreateVisibility = SENTINEL,
2068
+ started_at: Union[str, None] = SENTINEL,
2069
+ n_planned_trials: Union[int, None] = SENTINEL,
2070
+ request_options: Optional[RequestOptions] = None,
2071
+ ) -> HttpResponse[CreatedResultJob]:
2072
+ data = JobsClient.import_results(
2073
+ self._client,
2074
+ job_id=job_id,
2075
+ job_name=job_name,
2076
+ config=config,
2077
+ **dict[str, Any](
2078
+ {
2079
+ k: v
2080
+ for k, v in {
2081
+ "organization_id": organization_id,
2082
+ "visibility": visibility,
2083
+ "started_at": started_at,
2084
+ "n_planned_trials": n_planned_trials,
2085
+ }.items()
2086
+ if v is not SENTINEL
2087
+ }
2088
+ ),
2089
+ request_options=request_options,
2090
+ )
2091
+ return HttpResponse(data=data, response=self._client._last_response)
2092
+
2093
+ def get_overview(
2094
+ self,
2095
+ *,
2096
+ job_ids: str,
2097
+ force_combined: JobsGetOverviewRequestForceCombined = SENTINEL,
2098
+ request_options: Optional[RequestOptions] = None,
2099
+ ) -> HttpResponse[JobOverview]:
2100
+ data = JobsClient.get_overview(
2101
+ self._client,
2102
+ job_ids=job_ids,
2103
+ **dict[str, Any](
2104
+ {
2105
+ k: v
2106
+ for k, v in {"force_combined": force_combined}.items()
2107
+ if v is not SENTINEL
2108
+ }
2109
+ ),
2110
+ request_options=request_options,
2111
+ )
2112
+ return HttpResponse(data=data, response=self._client._last_response)
2113
+
2114
+ def get_comparison(
2115
+ self, *, job_ids: str, request_options: Optional[RequestOptions] = None
2116
+ ) -> HttpResponse[EvaluationComparison]:
2117
+ data = JobsClient.get_comparison(
2118
+ self._client, job_ids=job_ids, request_options=request_options
2119
+ )
2120
+ return HttpResponse(data=data, response=self._client._last_response)
2121
+
2122
+
2123
+ class AsyncJobsClient(JobsClient):
2124
+ """
2125
+ Async wrapper for JobsClient. Mirrors the sync client's endpoints (awaitable) and, for a
2126
+ resource with sub-resources, its lazy child accessors (returning the async child clients).
2127
+ """
2128
+
2129
+ @property
2130
+ def with_raw_response(self) -> "AsyncRawJobsClient": # type: ignore[override]
2131
+ """
2132
+ Returns an async raw-response client whose methods mirror this resource but return
2133
+ ``HttpResponse[T]`` (parsed body plus the raw status code and headers).
2134
+ """
2135
+ return AsyncRawJobsClient(self)
2136
+
2137
+ def get_sharing(
2138
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
2139
+ ) -> Awaitable[JobSharing]: # type: ignore[override]
2140
+ return to_async(super().get_sharing)(job_id, request_options=request_options)
2141
+
2142
+ def update_sharing(
2143
+ self,
2144
+ job_id: str,
2145
+ *,
2146
+ add_organization_ids: List[str] = SENTINEL,
2147
+ remove_organization_ids: List[str] = SENTINEL,
2148
+ add_usernames: List[str] = SENTINEL,
2149
+ remove_usernames: List[str] = SENTINEL,
2150
+ visibility: UpdateJobSharingRequestVisibility = SENTINEL,
2151
+ confirm_non_member_organizations: bool = SENTINEL,
2152
+ request_options: Optional[RequestOptions] = None,
2153
+ ) -> Awaitable[JobSharing]: # type: ignore[override]
2154
+ return to_async(super().update_sharing)(
2155
+ job_id,
2156
+ **dict[str, Any](
2157
+ {
2158
+ k: v
2159
+ for k, v in {
2160
+ "add_organization_ids": add_organization_ids,
2161
+ "remove_organization_ids": remove_organization_ids,
2162
+ "add_usernames": add_usernames,
2163
+ "remove_usernames": remove_usernames,
2164
+ "visibility": visibility,
2165
+ "confirm_non_member_organizations": confirm_non_member_organizations,
2166
+ }.items()
2167
+ if v is not SENTINEL
2168
+ }
2169
+ ),
2170
+ request_options=request_options,
2171
+ )
2172
+
2173
+ def get_trial_status(
2174
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
2175
+ ) -> Awaitable[List[JobTrialStatusItem]]: # type: ignore[override]
2176
+ return to_async(super().get_trial_status)(
2177
+ job_id, request_options=request_options
2178
+ )
2179
+
2180
+ def get(
2181
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
2182
+ ) -> Awaitable[JobResponse]: # type: ignore[override]
2183
+ return to_async(super().get)(job_id, request_options=request_options)
2184
+
2185
+ def rename(
2186
+ self,
2187
+ job_id: str,
2188
+ *,
2189
+ job_name: str,
2190
+ request_options: Optional[RequestOptions] = None,
2191
+ ) -> Awaitable[RenameJobResponse]: # type: ignore[override]
2192
+ return to_async(super().rename)(
2193
+ job_id, job_name=job_name, request_options=request_options
2194
+ )
2195
+
2196
+ def get_artifact_download(
2197
+ self,
2198
+ job_id: str,
2199
+ *,
2200
+ artifact_type: JobArtifactType,
2201
+ request_options: Optional[RequestOptions] = None,
2202
+ ) -> Awaitable[StorageDownload]: # type: ignore[override]
2203
+ return to_async(super().get_artifact_download)(
2204
+ job_id, artifact_type=artifact_type, request_options=request_options
2205
+ )
2206
+
2207
+ def submit(
2208
+ self,
2209
+ *,
2210
+ config: SubmitJobRequestConfig,
2211
+ idempotency_key: str,
2212
+ dry_run: bool = SENTINEL,
2213
+ job_secrets: Union[dict, None] = SENTINEL,
2214
+ registry_credentials: Union[dict, None] = SENTINEL,
2215
+ regrade: SubmitJobRequestRegrade = SENTINEL,
2216
+ organization_id: str = SENTINEL,
2217
+ relay_inference: bool = SENTINEL,
2218
+ session_id: Union[str, None] = SENTINEL,
2219
+ request_options: Optional[RequestOptions] = None,
2220
+ ) -> Awaitable[JobsSubmitResponse]: # type: ignore[override]
2221
+ return to_async(super().submit)(
2222
+ config=config,
2223
+ idempotency_key=idempotency_key,
2224
+ **dict[str, Any](
2225
+ {
2226
+ k: v
2227
+ for k, v in {
2228
+ "dry_run": dry_run,
2229
+ "job_secrets": job_secrets,
2230
+ "registry_credentials": registry_credentials,
2231
+ "regrade": regrade,
2232
+ "organization_id": organization_id,
2233
+ "relay_inference": relay_inference,
2234
+ "session_id": session_id,
2235
+ }.items()
2236
+ if v is not SENTINEL
2237
+ }
2238
+ ),
2239
+ request_options=request_options,
2240
+ )
2241
+
2242
+ def delete(
2243
+ self,
2244
+ *,
2245
+ job_ids: Union[List[str], None] = SENTINEL,
2246
+ request_options: Optional[RequestOptions] = None,
2247
+ ) -> Awaitable[DeleteJobsResponse]: # type: ignore[override]
2248
+ return to_async(super().delete)(
2249
+ **dict[str, Any](
2250
+ {k: v for k, v in {"job_ids": job_ids}.items() if v is not SENTINEL}
2251
+ ),
2252
+ request_options=request_options,
2253
+ )
2254
+
2255
+ def transfer(
2256
+ self,
2257
+ job_id: str,
2258
+ *,
2259
+ target_organization_id: str,
2260
+ keep_source_access: Union[bool, None] = SENTINEL,
2261
+ keep_job_credentials: Union[bool, None] = SENTINEL,
2262
+ request_options: Optional[RequestOptions] = None,
2263
+ ) -> Awaitable[TransferJobResponse]: # type: ignore[override]
2264
+ return to_async(super().transfer)(
2265
+ job_id,
2266
+ target_organization_id=target_organization_id,
2267
+ **dict[str, Any](
2268
+ {
2269
+ k: v
2270
+ for k, v in {
2271
+ "keep_source_access": keep_source_access,
2272
+ "keep_job_credentials": keep_job_credentials,
2273
+ }.items()
2274
+ if v is not SENTINEL
2275
+ }
2276
+ ),
2277
+ request_options=request_options,
2278
+ )
2279
+
2280
+ def copy(
2281
+ self,
2282
+ source_job_id: str,
2283
+ *,
2284
+ new_name: Union[str, None] = SENTINEL,
2285
+ overwrite: Union[bool, None] = SENTINEL,
2286
+ target_organization_id: Union[str, None] = SENTINEL,
2287
+ request_options: Optional[RequestOptions] = None,
2288
+ ) -> Awaitable[StorageCopyResult]: # type: ignore[override]
2289
+ return to_async(super().copy)(
2290
+ source_job_id,
2291
+ **dict[str, Any](
2292
+ {
2293
+ k: v
2294
+ for k, v in {
2295
+ "new_name": new_name,
2296
+ "overwrite": overwrite,
2297
+ "target_organization_id": target_organization_id,
2298
+ }.items()
2299
+ if v is not SENTINEL
2300
+ }
2301
+ ),
2302
+ request_options=request_options,
2303
+ )
2304
+
2305
+ def pause(
2306
+ self,
2307
+ job_id: str,
2308
+ *,
2309
+ idempotency_key: str,
2310
+ request_options: Optional[RequestOptions] = None,
2311
+ ) -> Awaitable[JobResponse]: # type: ignore[override]
2312
+ return to_async(super().pause)(
2313
+ job_id, idempotency_key=idempotency_key, request_options=request_options
2314
+ )
2315
+
2316
+ def resume(
2317
+ self,
2318
+ job_id: str,
2319
+ *,
2320
+ idempotency_key: str,
2321
+ request_options: Optional[RequestOptions] = None,
2322
+ ) -> Awaitable[JobResponse]: # type: ignore[override]
2323
+ return to_async(super().resume)(
2324
+ job_id, idempotency_key=idempotency_key, request_options=request_options
2325
+ )
2326
+
2327
+ def cancel(
2328
+ self,
2329
+ job_id: str,
2330
+ *,
2331
+ idempotency_key: str,
2332
+ force: bool = SENTINEL,
2333
+ request_options: Optional[RequestOptions] = None,
2334
+ ) -> Awaitable[JobResponse]: # type: ignore[override]
2335
+ return to_async(super().cancel)(
2336
+ job_id,
2337
+ idempotency_key=idempotency_key,
2338
+ **dict[str, Any](
2339
+ {k: v for k, v in {"force": force}.items() if v is not SENTINEL}
2340
+ ),
2341
+ request_options=request_options,
2342
+ )
2343
+
2344
+ def list(
2345
+ self,
2346
+ *,
2347
+ task: List[str] = SENTINEL,
2348
+ state: RunState = SENTINEL,
2349
+ name: str = SENTINEL,
2350
+ q: str = SENTINEL,
2351
+ agent_name: List[str] = SENTINEL,
2352
+ agent_version: List[str] = SENTINEL,
2353
+ model_name: List[str] = SENTINEL,
2354
+ model_provider: List[str] = SENTINEL,
2355
+ reasoning_effort: List[str] = SENTINEL,
2356
+ source: List[str] = SENTINEL,
2357
+ created_after: str = SENTINEL,
2358
+ created_before: str = SENTINEL,
2359
+ page_size: str = SENTINEL,
2360
+ page_token: str = SENTINEL,
2361
+ sort: JobsListRequestSort = SENTINEL,
2362
+ request_options: Optional[RequestOptions] = None,
2363
+ ) -> AsyncPager[JobSummary]: # type: ignore[override]
2364
+ sync_pager = super().list(
2365
+ **dict[str, Any](
2366
+ {
2367
+ k: v
2368
+ for k, v in {
2369
+ "task": task,
2370
+ "state": state,
2371
+ "name": name,
2372
+ "q": q,
2373
+ "agent_name": agent_name,
2374
+ "agent_version": agent_version,
2375
+ "model_name": model_name,
2376
+ "model_provider": model_provider,
2377
+ "reasoning_effort": reasoning_effort,
2378
+ "source": source,
2379
+ "created_after": created_after,
2380
+ "created_before": created_before,
2381
+ "page_size": page_size,
2382
+ "page_token": page_token,
2383
+ "sort": sort,
2384
+ }.items()
2385
+ if v is not SENTINEL
2386
+ }
2387
+ ),
2388
+ request_options=request_options,
2389
+ )
2390
+
2391
+ async def _paginate():
2392
+ pages = iter(sync_pager.iter_pages())
2393
+ while True:
2394
+ page = await to_async(next)(pages, None)
2395
+ if page is None:
2396
+ break
2397
+ yield page
2398
+
2399
+ return AsyncPager(_paginate(), lambda: sync_pager.last_response)
2400
+
2401
+ def get_filters(
2402
+ self,
2403
+ *,
2404
+ field: JobsGetFiltersRequestField,
2405
+ task: List[str] = SENTINEL,
2406
+ state: RunState = SENTINEL,
2407
+ name: str = SENTINEL,
2408
+ q: str = SENTINEL,
2409
+ agent_name: List[str] = SENTINEL,
2410
+ agent_version: List[str] = SENTINEL,
2411
+ model_name: List[str] = SENTINEL,
2412
+ model_provider: List[str] = SENTINEL,
2413
+ reasoning_effort: List[str] = SENTINEL,
2414
+ source: List[str] = SENTINEL,
2415
+ created_after: str = SENTINEL,
2416
+ created_before: str = SENTINEL,
2417
+ limit: str = SENTINEL,
2418
+ request_options: Optional[RequestOptions] = None,
2419
+ ) -> Awaitable[FilterValuesResponse]: # type: ignore[override]
2420
+ return to_async(super().get_filters)(
2421
+ field=field,
2422
+ **dict[str, Any](
2423
+ {
2424
+ k: v
2425
+ for k, v in {
2426
+ "task": task,
2427
+ "state": state,
2428
+ "name": name,
2429
+ "q": q,
2430
+ "agent_name": agent_name,
2431
+ "agent_version": agent_version,
2432
+ "model_name": model_name,
2433
+ "model_provider": model_provider,
2434
+ "reasoning_effort": reasoning_effort,
2435
+ "source": source,
2436
+ "created_after": created_after,
2437
+ "created_before": created_before,
2438
+ "limit": limit,
2439
+ }.items()
2440
+ if v is not SENTINEL
2441
+ }
2442
+ ),
2443
+ request_options=request_options,
2444
+ )
2445
+
2446
+ def list_tasks(
2447
+ self,
2448
+ job_id: str,
2449
+ *,
2450
+ page_size: str = SENTINEL,
2451
+ page_token: str = SENTINEL,
2452
+ search: str = SENTINEL,
2453
+ agents: str = SENTINEL,
2454
+ providers: str = SENTINEL,
2455
+ models: str = SENTINEL,
2456
+ tasks: str = SENTINEL,
2457
+ sort_by: JobsListTasksRequestSortBy = SENTINEL,
2458
+ sort_order: JobsListTasksRequestSortOrder = SENTINEL,
2459
+ request_options: Optional[RequestOptions] = None,
2460
+ ) -> AsyncPager[JobTaskSummary]: # type: ignore[override]
2461
+ sync_pager = super().list_tasks(
2462
+ job_id,
2463
+ **dict[str, Any](
2464
+ {
2465
+ k: v
2466
+ for k, v in {
2467
+ "page_size": page_size,
2468
+ "page_token": page_token,
2469
+ "search": search,
2470
+ "agents": agents,
2471
+ "providers": providers,
2472
+ "models": models,
2473
+ "tasks": tasks,
2474
+ "sort_by": sort_by,
2475
+ "sort_order": sort_order,
2476
+ }.items()
2477
+ if v is not SENTINEL
2478
+ }
2479
+ ),
2480
+ request_options=request_options,
2481
+ )
2482
+
2483
+ async def _paginate():
2484
+ pages = iter(sync_pager.iter_pages())
2485
+ while True:
2486
+ page = await to_async(next)(pages, None)
2487
+ if page is None:
2488
+ break
2489
+ yield page
2490
+
2491
+ return AsyncPager(_paginate(), lambda: sync_pager.last_response)
2492
+
2493
+ def import_results(
2494
+ self,
2495
+ *,
2496
+ job_id: str,
2497
+ job_name: str,
2498
+ config: dict,
2499
+ organization_id: Union[str, None] = SENTINEL,
2500
+ visibility: ResultJobCreateVisibility = SENTINEL,
2501
+ started_at: Union[str, None] = SENTINEL,
2502
+ n_planned_trials: Union[int, None] = SENTINEL,
2503
+ request_options: Optional[RequestOptions] = None,
2504
+ ) -> Awaitable[CreatedResultJob]: # type: ignore[override]
2505
+ return to_async(super().import_results)(
2506
+ job_id=job_id,
2507
+ job_name=job_name,
2508
+ config=config,
2509
+ **dict[str, Any](
2510
+ {
2511
+ k: v
2512
+ for k, v in {
2513
+ "organization_id": organization_id,
2514
+ "visibility": visibility,
2515
+ "started_at": started_at,
2516
+ "n_planned_trials": n_planned_trials,
2517
+ }.items()
2518
+ if v is not SENTINEL
2519
+ }
2520
+ ),
2521
+ request_options=request_options,
2522
+ )
2523
+
2524
+ def get_overview(
2525
+ self,
2526
+ *,
2527
+ job_ids: str,
2528
+ force_combined: JobsGetOverviewRequestForceCombined = SENTINEL,
2529
+ request_options: Optional[RequestOptions] = None,
2530
+ ) -> Awaitable[JobOverview]: # type: ignore[override]
2531
+ return to_async(super().get_overview)(
2532
+ job_ids=job_ids,
2533
+ **dict[str, Any](
2534
+ {
2535
+ k: v
2536
+ for k, v in {"force_combined": force_combined}.items()
2537
+ if v is not SENTINEL
2538
+ }
2539
+ ),
2540
+ request_options=request_options,
2541
+ )
2542
+
2543
+ def get_comparison(
2544
+ self, *, job_ids: str, request_options: Optional[RequestOptions] = None
2545
+ ) -> Awaitable[EvaluationComparison]: # type: ignore[override]
2546
+ return to_async(super().get_comparison)(
2547
+ job_ids=job_ids, request_options=request_options
2548
+ )
2549
+
2550
+
2551
+ class AsyncRawJobsClient:
2552
+ """
2553
+ Async raw-response client for AsyncJobsClient.
2554
+ """
2555
+
2556
+ def __init__(self, client: AsyncJobsClient):
2557
+ self._client = client
2558
+ self._client_wrapper = client._client_wrapper
2559
+
2560
+ async def get_sharing(
2561
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
2562
+ ) -> HttpResponse[JobSharing]:
2563
+ data = await AsyncJobsClient.get_sharing(
2564
+ self._client, job_id, request_options=request_options
2565
+ )
2566
+ return HttpResponse(data=data, response=self._client._last_response)
2567
+
2568
+ async def update_sharing(
2569
+ self,
2570
+ job_id: str,
2571
+ *,
2572
+ add_organization_ids: List[str] = SENTINEL,
2573
+ remove_organization_ids: List[str] = SENTINEL,
2574
+ add_usernames: List[str] = SENTINEL,
2575
+ remove_usernames: List[str] = SENTINEL,
2576
+ visibility: UpdateJobSharingRequestVisibility = SENTINEL,
2577
+ confirm_non_member_organizations: bool = SENTINEL,
2578
+ request_options: Optional[RequestOptions] = None,
2579
+ ) -> HttpResponse[JobSharing]:
2580
+ data = await AsyncJobsClient.update_sharing(
2581
+ self._client,
2582
+ job_id,
2583
+ **dict[str, Any](
2584
+ {
2585
+ k: v
2586
+ for k, v in {
2587
+ "add_organization_ids": add_organization_ids,
2588
+ "remove_organization_ids": remove_organization_ids,
2589
+ "add_usernames": add_usernames,
2590
+ "remove_usernames": remove_usernames,
2591
+ "visibility": visibility,
2592
+ "confirm_non_member_organizations": confirm_non_member_organizations,
2593
+ }.items()
2594
+ if v is not SENTINEL
2595
+ }
2596
+ ),
2597
+ request_options=request_options,
2598
+ )
2599
+ return HttpResponse(data=data, response=self._client._last_response)
2600
+
2601
+ async def get_trial_status(
2602
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
2603
+ ) -> HttpResponse[List[JobTrialStatusItem]]:
2604
+ data = await AsyncJobsClient.get_trial_status(
2605
+ self._client, job_id, request_options=request_options
2606
+ )
2607
+ return HttpResponse(data=data, response=self._client._last_response)
2608
+
2609
+ async def get(
2610
+ self, job_id: str, *, request_options: Optional[RequestOptions] = None
2611
+ ) -> HttpResponse[JobResponse]:
2612
+ data = await AsyncJobsClient.get(
2613
+ self._client, job_id, request_options=request_options
2614
+ )
2615
+ return HttpResponse(data=data, response=self._client._last_response)
2616
+
2617
+ async def rename(
2618
+ self,
2619
+ job_id: str,
2620
+ *,
2621
+ job_name: str,
2622
+ request_options: Optional[RequestOptions] = None,
2623
+ ) -> HttpResponse[RenameJobResponse]:
2624
+ data = await AsyncJobsClient.rename(
2625
+ self._client, job_id, job_name=job_name, request_options=request_options
2626
+ )
2627
+ return HttpResponse(data=data, response=self._client._last_response)
2628
+
2629
+ async def get_artifact_download(
2630
+ self,
2631
+ job_id: str,
2632
+ *,
2633
+ artifact_type: JobArtifactType,
2634
+ request_options: Optional[RequestOptions] = None,
2635
+ ) -> HttpResponse[StorageDownload]:
2636
+ data = await AsyncJobsClient.get_artifact_download(
2637
+ self._client,
2638
+ job_id,
2639
+ artifact_type=artifact_type,
2640
+ request_options=request_options,
2641
+ )
2642
+ return HttpResponse(data=data, response=self._client._last_response)
2643
+
2644
+ async def submit(
2645
+ self,
2646
+ *,
2647
+ config: SubmitJobRequestConfig,
2648
+ idempotency_key: str,
2649
+ dry_run: bool = SENTINEL,
2650
+ job_secrets: Union[dict, None] = SENTINEL,
2651
+ registry_credentials: Union[dict, None] = SENTINEL,
2652
+ regrade: SubmitJobRequestRegrade = SENTINEL,
2653
+ organization_id: str = SENTINEL,
2654
+ relay_inference: bool = SENTINEL,
2655
+ session_id: Union[str, None] = SENTINEL,
2656
+ request_options: Optional[RequestOptions] = None,
2657
+ ) -> HttpResponse[JobsSubmitResponse]:
2658
+ data = await AsyncJobsClient.submit(
2659
+ self._client,
2660
+ config=config,
2661
+ idempotency_key=idempotency_key,
2662
+ **dict[str, Any](
2663
+ {
2664
+ k: v
2665
+ for k, v in {
2666
+ "dry_run": dry_run,
2667
+ "job_secrets": job_secrets,
2668
+ "registry_credentials": registry_credentials,
2669
+ "regrade": regrade,
2670
+ "organization_id": organization_id,
2671
+ "relay_inference": relay_inference,
2672
+ "session_id": session_id,
2673
+ }.items()
2674
+ if v is not SENTINEL
2675
+ }
2676
+ ),
2677
+ request_options=request_options,
2678
+ )
2679
+ return HttpResponse(data=data, response=self._client._last_response)
2680
+
2681
+ async def delete(
2682
+ self,
2683
+ *,
2684
+ job_ids: Union[List[str], None] = SENTINEL,
2685
+ request_options: Optional[RequestOptions] = None,
2686
+ ) -> HttpResponse[DeleteJobsResponse]:
2687
+ data = await AsyncJobsClient.delete(
2688
+ self._client,
2689
+ **dict[str, Any](
2690
+ {k: v for k, v in {"job_ids": job_ids}.items() if v is not SENTINEL}
2691
+ ),
2692
+ request_options=request_options,
2693
+ )
2694
+ return HttpResponse(data=data, response=self._client._last_response)
2695
+
2696
+ async def transfer(
2697
+ self,
2698
+ job_id: str,
2699
+ *,
2700
+ target_organization_id: str,
2701
+ keep_source_access: Union[bool, None] = SENTINEL,
2702
+ keep_job_credentials: Union[bool, None] = SENTINEL,
2703
+ request_options: Optional[RequestOptions] = None,
2704
+ ) -> HttpResponse[TransferJobResponse]:
2705
+ data = await AsyncJobsClient.transfer(
2706
+ self._client,
2707
+ job_id,
2708
+ target_organization_id=target_organization_id,
2709
+ **dict[str, Any](
2710
+ {
2711
+ k: v
2712
+ for k, v in {
2713
+ "keep_source_access": keep_source_access,
2714
+ "keep_job_credentials": keep_job_credentials,
2715
+ }.items()
2716
+ if v is not SENTINEL
2717
+ }
2718
+ ),
2719
+ request_options=request_options,
2720
+ )
2721
+ return HttpResponse(data=data, response=self._client._last_response)
2722
+
2723
+ async def copy(
2724
+ self,
2725
+ source_job_id: str,
2726
+ *,
2727
+ new_name: Union[str, None] = SENTINEL,
2728
+ overwrite: Union[bool, None] = SENTINEL,
2729
+ target_organization_id: Union[str, None] = SENTINEL,
2730
+ request_options: Optional[RequestOptions] = None,
2731
+ ) -> HttpResponse[StorageCopyResult]:
2732
+ data = await AsyncJobsClient.copy(
2733
+ self._client,
2734
+ source_job_id,
2735
+ **dict[str, Any](
2736
+ {
2737
+ k: v
2738
+ for k, v in {
2739
+ "new_name": new_name,
2740
+ "overwrite": overwrite,
2741
+ "target_organization_id": target_organization_id,
2742
+ }.items()
2743
+ if v is not SENTINEL
2744
+ }
2745
+ ),
2746
+ request_options=request_options,
2747
+ )
2748
+ return HttpResponse(data=data, response=self._client._last_response)
2749
+
2750
+ async def pause(
2751
+ self,
2752
+ job_id: str,
2753
+ *,
2754
+ idempotency_key: str,
2755
+ request_options: Optional[RequestOptions] = None,
2756
+ ) -> HttpResponse[JobResponse]:
2757
+ data = await AsyncJobsClient.pause(
2758
+ self._client,
2759
+ job_id,
2760
+ idempotency_key=idempotency_key,
2761
+ request_options=request_options,
2762
+ )
2763
+ return HttpResponse(data=data, response=self._client._last_response)
2764
+
2765
+ async def resume(
2766
+ self,
2767
+ job_id: str,
2768
+ *,
2769
+ idempotency_key: str,
2770
+ request_options: Optional[RequestOptions] = None,
2771
+ ) -> HttpResponse[JobResponse]:
2772
+ data = await AsyncJobsClient.resume(
2773
+ self._client,
2774
+ job_id,
2775
+ idempotency_key=idempotency_key,
2776
+ request_options=request_options,
2777
+ )
2778
+ return HttpResponse(data=data, response=self._client._last_response)
2779
+
2780
+ async def cancel(
2781
+ self,
2782
+ job_id: str,
2783
+ *,
2784
+ idempotency_key: str,
2785
+ force: bool = SENTINEL,
2786
+ request_options: Optional[RequestOptions] = None,
2787
+ ) -> HttpResponse[JobResponse]:
2788
+ data = await AsyncJobsClient.cancel(
2789
+ self._client,
2790
+ job_id,
2791
+ idempotency_key=idempotency_key,
2792
+ **dict[str, Any](
2793
+ {k: v for k, v in {"force": force}.items() if v is not SENTINEL}
2794
+ ),
2795
+ request_options=request_options,
2796
+ )
2797
+ return HttpResponse(data=data, response=self._client._last_response)
2798
+
2799
+ def list(
2800
+ self,
2801
+ *,
2802
+ task: List[str] = SENTINEL,
2803
+ state: RunState = SENTINEL,
2804
+ name: str = SENTINEL,
2805
+ q: str = SENTINEL,
2806
+ agent_name: List[str] = SENTINEL,
2807
+ agent_version: List[str] = SENTINEL,
2808
+ model_name: List[str] = SENTINEL,
2809
+ model_provider: List[str] = SENTINEL,
2810
+ reasoning_effort: List[str] = SENTINEL,
2811
+ source: List[str] = SENTINEL,
2812
+ created_after: str = SENTINEL,
2813
+ created_before: str = SENTINEL,
2814
+ page_size: str = SENTINEL,
2815
+ page_token: str = SENTINEL,
2816
+ sort: JobsListRequestSort = SENTINEL,
2817
+ request_options: Optional[RequestOptions] = None,
2818
+ ) -> HttpResponse[AsyncPager[JobSummary]]:
2819
+ data = AsyncJobsClient.list(
2820
+ self._client,
2821
+ **dict[str, Any](
2822
+ {
2823
+ k: v
2824
+ for k, v in {
2825
+ "task": task,
2826
+ "state": state,
2827
+ "name": name,
2828
+ "q": q,
2829
+ "agent_name": agent_name,
2830
+ "agent_version": agent_version,
2831
+ "model_name": model_name,
2832
+ "model_provider": model_provider,
2833
+ "reasoning_effort": reasoning_effort,
2834
+ "source": source,
2835
+ "created_after": created_after,
2836
+ "created_before": created_before,
2837
+ "page_size": page_size,
2838
+ "page_token": page_token,
2839
+ "sort": sort,
2840
+ }.items()
2841
+ if v is not SENTINEL
2842
+ }
2843
+ ),
2844
+ request_options=request_options,
2845
+ )
2846
+ return HttpResponse(data=data, response_source=lambda: data.last_response)
2847
+
2848
+ async def get_filters(
2849
+ self,
2850
+ *,
2851
+ field: JobsGetFiltersRequestField,
2852
+ task: List[str] = SENTINEL,
2853
+ state: RunState = SENTINEL,
2854
+ name: str = SENTINEL,
2855
+ q: str = SENTINEL,
2856
+ agent_name: List[str] = SENTINEL,
2857
+ agent_version: List[str] = SENTINEL,
2858
+ model_name: List[str] = SENTINEL,
2859
+ model_provider: List[str] = SENTINEL,
2860
+ reasoning_effort: List[str] = SENTINEL,
2861
+ source: List[str] = SENTINEL,
2862
+ created_after: str = SENTINEL,
2863
+ created_before: str = SENTINEL,
2864
+ limit: str = SENTINEL,
2865
+ request_options: Optional[RequestOptions] = None,
2866
+ ) -> HttpResponse[FilterValuesResponse]:
2867
+ data = await AsyncJobsClient.get_filters(
2868
+ self._client,
2869
+ field=field,
2870
+ **dict[str, Any](
2871
+ {
2872
+ k: v
2873
+ for k, v in {
2874
+ "task": task,
2875
+ "state": state,
2876
+ "name": name,
2877
+ "q": q,
2878
+ "agent_name": agent_name,
2879
+ "agent_version": agent_version,
2880
+ "model_name": model_name,
2881
+ "model_provider": model_provider,
2882
+ "reasoning_effort": reasoning_effort,
2883
+ "source": source,
2884
+ "created_after": created_after,
2885
+ "created_before": created_before,
2886
+ "limit": limit,
2887
+ }.items()
2888
+ if v is not SENTINEL
2889
+ }
2890
+ ),
2891
+ request_options=request_options,
2892
+ )
2893
+ return HttpResponse(data=data, response=self._client._last_response)
2894
+
2895
+ def list_tasks(
2896
+ self,
2897
+ job_id: str,
2898
+ *,
2899
+ page_size: str = SENTINEL,
2900
+ page_token: str = SENTINEL,
2901
+ search: str = SENTINEL,
2902
+ agents: str = SENTINEL,
2903
+ providers: str = SENTINEL,
2904
+ models: str = SENTINEL,
2905
+ tasks: str = SENTINEL,
2906
+ sort_by: JobsListTasksRequestSortBy = SENTINEL,
2907
+ sort_order: JobsListTasksRequestSortOrder = SENTINEL,
2908
+ request_options: Optional[RequestOptions] = None,
2909
+ ) -> HttpResponse[AsyncPager[JobTaskSummary]]:
2910
+ data = AsyncJobsClient.list_tasks(
2911
+ self._client,
2912
+ job_id,
2913
+ **dict[str, Any](
2914
+ {
2915
+ k: v
2916
+ for k, v in {
2917
+ "page_size": page_size,
2918
+ "page_token": page_token,
2919
+ "search": search,
2920
+ "agents": agents,
2921
+ "providers": providers,
2922
+ "models": models,
2923
+ "tasks": tasks,
2924
+ "sort_by": sort_by,
2925
+ "sort_order": sort_order,
2926
+ }.items()
2927
+ if v is not SENTINEL
2928
+ }
2929
+ ),
2930
+ request_options=request_options,
2931
+ )
2932
+ return HttpResponse(data=data, response_source=lambda: data.last_response)
2933
+
2934
+ async def import_results(
2935
+ self,
2936
+ *,
2937
+ job_id: str,
2938
+ job_name: str,
2939
+ config: dict,
2940
+ organization_id: Union[str, None] = SENTINEL,
2941
+ visibility: ResultJobCreateVisibility = SENTINEL,
2942
+ started_at: Union[str, None] = SENTINEL,
2943
+ n_planned_trials: Union[int, None] = SENTINEL,
2944
+ request_options: Optional[RequestOptions] = None,
2945
+ ) -> HttpResponse[CreatedResultJob]:
2946
+ data = await AsyncJobsClient.import_results(
2947
+ self._client,
2948
+ job_id=job_id,
2949
+ job_name=job_name,
2950
+ config=config,
2951
+ **dict[str, Any](
2952
+ {
2953
+ k: v
2954
+ for k, v in {
2955
+ "organization_id": organization_id,
2956
+ "visibility": visibility,
2957
+ "started_at": started_at,
2958
+ "n_planned_trials": n_planned_trials,
2959
+ }.items()
2960
+ if v is not SENTINEL
2961
+ }
2962
+ ),
2963
+ request_options=request_options,
2964
+ )
2965
+ return HttpResponse(data=data, response=self._client._last_response)
2966
+
2967
+ async def get_overview(
2968
+ self,
2969
+ *,
2970
+ job_ids: str,
2971
+ force_combined: JobsGetOverviewRequestForceCombined = SENTINEL,
2972
+ request_options: Optional[RequestOptions] = None,
2973
+ ) -> HttpResponse[JobOverview]:
2974
+ data = await AsyncJobsClient.get_overview(
2975
+ self._client,
2976
+ job_ids=job_ids,
2977
+ **dict[str, Any](
2978
+ {
2979
+ k: v
2980
+ for k, v in {"force_combined": force_combined}.items()
2981
+ if v is not SENTINEL
2982
+ }
2983
+ ),
2984
+ request_options=request_options,
2985
+ )
2986
+ return HttpResponse(data=data, response=self._client._last_response)
2987
+
2988
+ async def get_comparison(
2989
+ self, *, job_ids: str, request_options: Optional[RequestOptions] = None
2990
+ ) -> HttpResponse[EvaluationComparison]:
2991
+ data = await AsyncJobsClient.get_comparison(
2992
+ self._client, job_ids=job_ids, request_options=request_options
2993
+ )
2994
+ return HttpResponse(data=data, response=self._client._last_response)