hatchet-sdk 0.46.1__py3-none-any.whl → 1.0.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 (303) hide show
  1. hatchet_sdk/__init__.py +25 -16
  2. hatchet_sdk/client.py +14 -39
  3. hatchet_sdk/clients/admin.py +203 -362
  4. hatchet_sdk/clients/dispatcher/action_listener.py +106 -84
  5. hatchet_sdk/clients/dispatcher/dispatcher.py +21 -21
  6. hatchet_sdk/clients/event_ts.py +23 -10
  7. hatchet_sdk/clients/events.py +96 -99
  8. hatchet_sdk/clients/rest/__init__.py +24 -0
  9. hatchet_sdk/clients/rest/api/__init__.py +2 -0
  10. hatchet_sdk/clients/rest/api/task_api.py +2174 -0
  11. hatchet_sdk/clients/rest/api/workflow_runs_api.py +638 -106
  12. hatchet_sdk/clients/rest/api_client.py +1 -1
  13. hatchet_sdk/clients/rest/configuration.py +8 -1
  14. hatchet_sdk/clients/rest/exceptions.py +21 -0
  15. hatchet_sdk/clients/rest/models/__init__.py +22 -0
  16. hatchet_sdk/clients/rest/models/tenant.py +4 -0
  17. hatchet_sdk/clients/rest/models/tenant_version.py +37 -0
  18. hatchet_sdk/clients/rest/models/update_tenant_request.py +7 -0
  19. hatchet_sdk/clients/rest/models/v1_cancel_task_request.py +104 -0
  20. hatchet_sdk/clients/rest/models/v1_dag_children.py +102 -0
  21. hatchet_sdk/clients/rest/models/v1_replay_task_request.py +104 -0
  22. hatchet_sdk/clients/rest/models/v1_task.py +174 -0
  23. hatchet_sdk/clients/rest/models/v1_task_event.py +118 -0
  24. hatchet_sdk/clients/rest/models/v1_task_event_list.py +110 -0
  25. hatchet_sdk/clients/rest/models/v1_task_event_type.py +55 -0
  26. hatchet_sdk/clients/rest/models/v1_task_filter.py +106 -0
  27. hatchet_sdk/clients/rest/models/v1_task_point_metric.py +92 -0
  28. hatchet_sdk/clients/rest/models/v1_task_point_metrics.py +100 -0
  29. hatchet_sdk/clients/rest/models/v1_task_run_metric.py +88 -0
  30. hatchet_sdk/clients/rest/models/v1_task_run_status.py +40 -0
  31. hatchet_sdk/clients/rest/models/v1_task_status.py +40 -0
  32. hatchet_sdk/clients/rest/models/v1_task_summary.py +212 -0
  33. hatchet_sdk/clients/rest/models/v1_task_summary_list.py +110 -0
  34. hatchet_sdk/clients/rest/models/v1_workflow_run.py +171 -0
  35. hatchet_sdk/clients/rest/models/v1_workflow_run_details.py +145 -0
  36. hatchet_sdk/clients/rest/models/v1_workflow_type.py +37 -0
  37. hatchet_sdk/clients/rest/models/workflow_run_shape_item_for_workflow_run_details.py +99 -0
  38. hatchet_sdk/clients/rest/rest.py +37 -26
  39. hatchet_sdk/clients/rest/tenacity_utils.py +1 -1
  40. hatchet_sdk/clients/rest_client.py +141 -116
  41. hatchet_sdk/clients/run_event_listener.py +66 -60
  42. hatchet_sdk/clients/workflow_listener.py +77 -64
  43. hatchet_sdk/config.py +117 -0
  44. hatchet_sdk/connection.py +27 -13
  45. hatchet_sdk/context/__init__.py +0 -1
  46. hatchet_sdk/context/context.py +143 -202
  47. hatchet_sdk/features/cron.py +43 -57
  48. hatchet_sdk/features/scheduled.py +60 -74
  49. hatchet_sdk/hatchet.py +192 -195
  50. hatchet_sdk/labels.py +4 -6
  51. hatchet_sdk/metadata.py +1 -1
  52. hatchet_sdk/opentelemetry/instrumentor.py +112 -35
  53. hatchet_sdk/rate_limit.py +9 -18
  54. hatchet_sdk/token.py +13 -9
  55. hatchet_sdk/utils/aio_utils.py +0 -40
  56. hatchet_sdk/utils/proto_enums.py +54 -0
  57. hatchet_sdk/utils/typing.py +9 -1
  58. hatchet_sdk/v0/__init__.py +251 -0
  59. hatchet_sdk/v0/client.py +119 -0
  60. hatchet_sdk/v0/clients/admin.py +541 -0
  61. hatchet_sdk/v0/clients/dispatcher/action_listener.py +422 -0
  62. hatchet_sdk/v0/clients/dispatcher/dispatcher.py +204 -0
  63. hatchet_sdk/v0/clients/event_ts.py +28 -0
  64. hatchet_sdk/v0/clients/events.py +182 -0
  65. hatchet_sdk/v0/clients/rest/__init__.py +307 -0
  66. hatchet_sdk/v0/clients/rest/api/__init__.py +19 -0
  67. hatchet_sdk/v0/clients/rest/api/api_token_api.py +858 -0
  68. hatchet_sdk/v0/clients/rest/api/default_api.py +2259 -0
  69. hatchet_sdk/v0/clients/rest/api/event_api.py +2548 -0
  70. hatchet_sdk/v0/clients/rest/api/github_api.py +331 -0
  71. hatchet_sdk/v0/clients/rest/api/healthcheck_api.py +483 -0
  72. hatchet_sdk/v0/clients/rest/api/log_api.py +449 -0
  73. hatchet_sdk/v0/clients/rest/api/metadata_api.py +728 -0
  74. hatchet_sdk/v0/clients/rest/api/rate_limits_api.py +423 -0
  75. hatchet_sdk/v0/clients/rest/api/slack_api.py +577 -0
  76. hatchet_sdk/v0/clients/rest/api/sns_api.py +872 -0
  77. hatchet_sdk/v0/clients/rest/api/step_run_api.py +2202 -0
  78. hatchet_sdk/v0/clients/rest/api/tenant_api.py +4430 -0
  79. hatchet_sdk/v0/clients/rest/api/user_api.py +2888 -0
  80. hatchet_sdk/v0/clients/rest/api/worker_api.py +858 -0
  81. hatchet_sdk/v0/clients/rest/api/workflow_api.py +6312 -0
  82. hatchet_sdk/v0/clients/rest/api/workflow_run_api.py +1932 -0
  83. hatchet_sdk/v0/clients/rest/api/workflow_runs_api.py +610 -0
  84. hatchet_sdk/v0/clients/rest/api_client.py +759 -0
  85. hatchet_sdk/v0/clients/rest/api_response.py +22 -0
  86. hatchet_sdk/v0/clients/rest/configuration.py +611 -0
  87. hatchet_sdk/v0/clients/rest/exceptions.py +200 -0
  88. hatchet_sdk/v0/clients/rest/models/__init__.py +274 -0
  89. hatchet_sdk/v0/clients/rest/models/accept_invite_request.py +83 -0
  90. hatchet_sdk/v0/clients/rest/models/api_error.py +102 -0
  91. hatchet_sdk/v0/clients/rest/models/api_errors.py +100 -0
  92. hatchet_sdk/v0/clients/rest/models/api_meta.py +144 -0
  93. hatchet_sdk/v0/clients/rest/models/api_meta_auth.py +85 -0
  94. hatchet_sdk/v0/clients/rest/models/api_meta_integration.py +88 -0
  95. hatchet_sdk/v0/clients/rest/models/api_meta_posthog.py +90 -0
  96. hatchet_sdk/v0/clients/rest/models/api_resource_meta.py +98 -0
  97. hatchet_sdk/v0/clients/rest/models/api_token.py +105 -0
  98. hatchet_sdk/v0/clients/rest/models/bulk_create_event_request.py +100 -0
  99. hatchet_sdk/v0/clients/rest/models/bulk_create_event_response.py +110 -0
  100. hatchet_sdk/v0/clients/rest/models/cancel_event_request.py +85 -0
  101. hatchet_sdk/v0/clients/rest/models/cancel_step_run_request.py +83 -0
  102. hatchet_sdk/v0/clients/rest/models/concurrency_limit_strategy.py +39 -0
  103. hatchet_sdk/v0/clients/rest/models/create_api_token_request.py +92 -0
  104. hatchet_sdk/v0/clients/rest/models/create_api_token_response.py +83 -0
  105. hatchet_sdk/v0/clients/rest/models/create_cron_workflow_trigger_request.py +98 -0
  106. hatchet_sdk/v0/clients/rest/models/create_event_request.py +95 -0
  107. hatchet_sdk/v0/clients/rest/models/create_pull_request_from_step_run.py +83 -0
  108. hatchet_sdk/v0/clients/rest/models/create_sns_integration_request.py +85 -0
  109. hatchet_sdk/v0/clients/rest/models/create_tenant_alert_email_group_request.py +83 -0
  110. hatchet_sdk/v0/clients/rest/models/create_tenant_invite_request.py +86 -0
  111. hatchet_sdk/v0/clients/rest/models/create_tenant_request.py +84 -0
  112. hatchet_sdk/v0/clients/rest/models/cron_workflows.py +131 -0
  113. hatchet_sdk/v0/clients/rest/models/cron_workflows_list.py +110 -0
  114. hatchet_sdk/v0/clients/rest/models/cron_workflows_method.py +37 -0
  115. hatchet_sdk/v0/clients/rest/models/cron_workflows_order_by_field.py +37 -0
  116. hatchet_sdk/v0/clients/rest/models/event.py +143 -0
  117. hatchet_sdk/v0/clients/rest/models/event_data.py +83 -0
  118. hatchet_sdk/v0/clients/rest/models/event_key_list.py +98 -0
  119. hatchet_sdk/v0/clients/rest/models/event_list.py +110 -0
  120. hatchet_sdk/v0/clients/rest/models/event_order_by_direction.py +37 -0
  121. hatchet_sdk/v0/clients/rest/models/event_order_by_field.py +36 -0
  122. hatchet_sdk/v0/clients/rest/models/event_update_cancel200_response.py +85 -0
  123. hatchet_sdk/v0/clients/rest/models/event_workflow_run_summary.py +116 -0
  124. hatchet_sdk/v0/clients/rest/models/events.py +110 -0
  125. hatchet_sdk/v0/clients/rest/models/get_step_run_diff_response.py +100 -0
  126. hatchet_sdk/v0/clients/rest/models/github_app_installation.py +107 -0
  127. hatchet_sdk/v0/clients/rest/models/github_branch.py +86 -0
  128. hatchet_sdk/v0/clients/rest/models/github_repo.py +86 -0
  129. hatchet_sdk/v0/clients/rest/models/info_get_version200_response.py +83 -0
  130. hatchet_sdk/v0/clients/rest/models/job.py +132 -0
  131. hatchet_sdk/v0/clients/rest/models/job_run.py +176 -0
  132. hatchet_sdk/v0/clients/rest/models/job_run_status.py +41 -0
  133. hatchet_sdk/v0/clients/rest/models/link_github_repository_request.py +106 -0
  134. hatchet_sdk/v0/clients/rest/models/list_api_tokens_response.py +110 -0
  135. hatchet_sdk/v0/clients/rest/models/list_github_app_installations_response.py +112 -0
  136. hatchet_sdk/v0/clients/rest/models/list_pull_requests_response.py +100 -0
  137. hatchet_sdk/v0/clients/rest/models/list_slack_webhooks.py +110 -0
  138. hatchet_sdk/v0/clients/rest/models/list_sns_integrations.py +110 -0
  139. hatchet_sdk/v0/clients/rest/models/log_line.py +94 -0
  140. hatchet_sdk/v0/clients/rest/models/log_line_level.py +39 -0
  141. hatchet_sdk/v0/clients/rest/models/log_line_list.py +110 -0
  142. hatchet_sdk/v0/clients/rest/models/log_line_order_by_direction.py +37 -0
  143. hatchet_sdk/v0/clients/rest/models/log_line_order_by_field.py +36 -0
  144. hatchet_sdk/v0/clients/rest/models/pagination_response.py +95 -0
  145. hatchet_sdk/v0/clients/rest/models/pull_request.py +112 -0
  146. hatchet_sdk/v0/clients/rest/models/pull_request_state.py +37 -0
  147. hatchet_sdk/v0/clients/rest/models/queue_metrics.py +97 -0
  148. hatchet_sdk/v0/clients/rest/models/rate_limit.py +117 -0
  149. hatchet_sdk/v0/clients/rest/models/rate_limit_list.py +110 -0
  150. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_direction.py +37 -0
  151. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_field.py +38 -0
  152. hatchet_sdk/v0/clients/rest/models/recent_step_runs.py +118 -0
  153. hatchet_sdk/v0/clients/rest/models/reject_invite_request.py +83 -0
  154. hatchet_sdk/v0/clients/rest/models/replay_event_request.py +85 -0
  155. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_request.py +85 -0
  156. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_response.py +100 -0
  157. hatchet_sdk/v0/clients/rest/models/rerun_step_run_request.py +83 -0
  158. hatchet_sdk/v0/clients/rest/models/schedule_workflow_run_request.py +92 -0
  159. hatchet_sdk/v0/clients/rest/models/scheduled_run_status.py +42 -0
  160. hatchet_sdk/v0/clients/rest/models/scheduled_workflows.py +149 -0
  161. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_list.py +110 -0
  162. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_method.py +37 -0
  163. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_order_by_field.py +37 -0
  164. hatchet_sdk/v0/clients/rest/models/semaphore_slots.py +113 -0
  165. hatchet_sdk/v0/clients/rest/models/slack_webhook.py +127 -0
  166. hatchet_sdk/v0/clients/rest/models/sns_integration.py +114 -0
  167. hatchet_sdk/v0/clients/rest/models/step.py +123 -0
  168. hatchet_sdk/v0/clients/rest/models/step_run.py +202 -0
  169. hatchet_sdk/v0/clients/rest/models/step_run_archive.py +142 -0
  170. hatchet_sdk/v0/clients/rest/models/step_run_archive_list.py +110 -0
  171. hatchet_sdk/v0/clients/rest/models/step_run_diff.py +91 -0
  172. hatchet_sdk/v0/clients/rest/models/step_run_event.py +122 -0
  173. hatchet_sdk/v0/clients/rest/models/step_run_event_list.py +110 -0
  174. hatchet_sdk/v0/clients/rest/models/step_run_event_reason.py +52 -0
  175. hatchet_sdk/v0/clients/rest/models/step_run_event_severity.py +38 -0
  176. hatchet_sdk/v0/clients/rest/models/step_run_status.py +44 -0
  177. hatchet_sdk/v0/clients/rest/models/tenant.py +118 -0
  178. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group.py +98 -0
  179. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group_list.py +112 -0
  180. hatchet_sdk/v0/clients/rest/models/tenant_alerting_settings.py +143 -0
  181. hatchet_sdk/v0/clients/rest/models/tenant_invite.py +120 -0
  182. hatchet_sdk/v0/clients/rest/models/tenant_invite_list.py +110 -0
  183. hatchet_sdk/v0/clients/rest/models/tenant_list.py +110 -0
  184. hatchet_sdk/v0/clients/rest/models/tenant_member.py +123 -0
  185. hatchet_sdk/v0/clients/rest/models/tenant_member_list.py +110 -0
  186. hatchet_sdk/v0/clients/rest/models/tenant_member_role.py +38 -0
  187. hatchet_sdk/v0/clients/rest/models/tenant_queue_metrics.py +116 -0
  188. hatchet_sdk/v0/clients/rest/models/tenant_resource.py +40 -0
  189. hatchet_sdk/v0/clients/rest/models/tenant_resource_limit.py +135 -0
  190. hatchet_sdk/v0/clients/rest/models/tenant_resource_policy.py +102 -0
  191. hatchet_sdk/v0/clients/rest/models/tenant_step_run_queue_metrics.py +83 -0
  192. hatchet_sdk/v0/clients/rest/models/trigger_workflow_run_request.py +91 -0
  193. hatchet_sdk/v0/clients/rest/models/update_tenant_alert_email_group_request.py +83 -0
  194. hatchet_sdk/v0/clients/rest/models/update_tenant_invite_request.py +85 -0
  195. hatchet_sdk/v0/clients/rest/models/update_tenant_request.py +137 -0
  196. hatchet_sdk/v0/clients/rest/models/update_worker_request.py +87 -0
  197. hatchet_sdk/v0/clients/rest/models/user.py +126 -0
  198. hatchet_sdk/v0/clients/rest/models/user_change_password_request.py +88 -0
  199. hatchet_sdk/v0/clients/rest/models/user_login_request.py +86 -0
  200. hatchet_sdk/v0/clients/rest/models/user_register_request.py +91 -0
  201. hatchet_sdk/v0/clients/rest/models/user_tenant_memberships_list.py +110 -0
  202. hatchet_sdk/v0/clients/rest/models/user_tenant_public.py +86 -0
  203. hatchet_sdk/v0/clients/rest/models/webhook_worker.py +100 -0
  204. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_request.py +94 -0
  205. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_response.py +98 -0
  206. hatchet_sdk/v0/clients/rest/models/webhook_worker_created.py +102 -0
  207. hatchet_sdk/v0/clients/rest/models/webhook_worker_list_response.py +110 -0
  208. hatchet_sdk/v0/clients/rest/models/webhook_worker_request.py +102 -0
  209. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_list_response.py +104 -0
  210. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_method.py +38 -0
  211. hatchet_sdk/v0/clients/rest/models/worker.py +239 -0
  212. hatchet_sdk/v0/clients/rest/models/worker_label.py +102 -0
  213. hatchet_sdk/v0/clients/rest/models/worker_list.py +110 -0
  214. hatchet_sdk/v0/clients/rest/models/worker_runtime_info.py +103 -0
  215. hatchet_sdk/v0/clients/rest/models/worker_runtime_sdks.py +38 -0
  216. hatchet_sdk/v0/clients/rest/models/worker_type.py +38 -0
  217. hatchet_sdk/v0/clients/rest/models/workflow.py +165 -0
  218. hatchet_sdk/v0/clients/rest/models/workflow_concurrency.py +107 -0
  219. hatchet_sdk/v0/clients/rest/models/workflow_deployment_config.py +136 -0
  220. hatchet_sdk/v0/clients/rest/models/workflow_kind.py +38 -0
  221. hatchet_sdk/v0/clients/rest/models/workflow_list.py +120 -0
  222. hatchet_sdk/v0/clients/rest/models/workflow_metrics.py +97 -0
  223. hatchet_sdk/v0/clients/rest/models/workflow_run.py +188 -0
  224. hatchet_sdk/v0/clients/rest/models/workflow_run_cancel200_response.py +85 -0
  225. hatchet_sdk/v0/clients/rest/models/workflow_run_list.py +110 -0
  226. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_direction.py +37 -0
  227. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_field.py +39 -0
  228. hatchet_sdk/v0/clients/rest/models/workflow_run_shape.py +186 -0
  229. hatchet_sdk/v0/clients/rest/models/workflow_run_status.py +42 -0
  230. hatchet_sdk/v0/clients/rest/models/workflow_run_triggered_by.py +112 -0
  231. hatchet_sdk/v0/clients/rest/models/workflow_runs_cancel_request.py +85 -0
  232. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics.py +94 -0
  233. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics_counts.py +104 -0
  234. hatchet_sdk/v0/clients/rest/models/workflow_tag.py +84 -0
  235. hatchet_sdk/v0/clients/rest/models/workflow_trigger_cron_ref.py +86 -0
  236. hatchet_sdk/v0/clients/rest/models/workflow_trigger_event_ref.py +86 -0
  237. hatchet_sdk/v0/clients/rest/models/workflow_triggers.py +141 -0
  238. hatchet_sdk/v0/clients/rest/models/workflow_update_request.py +85 -0
  239. hatchet_sdk/v0/clients/rest/models/workflow_version.py +170 -0
  240. hatchet_sdk/v0/clients/rest/models/workflow_version_concurrency.py +114 -0
  241. hatchet_sdk/v0/clients/rest/models/workflow_version_definition.py +85 -0
  242. hatchet_sdk/v0/clients/rest/models/workflow_version_meta.py +123 -0
  243. hatchet_sdk/v0/clients/rest/models/workflow_workers_count.py +95 -0
  244. hatchet_sdk/v0/clients/rest/rest.py +187 -0
  245. hatchet_sdk/v0/clients/rest/tenacity_utils.py +39 -0
  246. hatchet_sdk/v0/clients/rest_client.py +613 -0
  247. hatchet_sdk/v0/clients/run_event_listener.py +260 -0
  248. hatchet_sdk/v0/clients/workflow_listener.py +277 -0
  249. hatchet_sdk/v0/connection.py +63 -0
  250. hatchet_sdk/v0/context/__init__.py +1 -0
  251. hatchet_sdk/v0/context/context.py +446 -0
  252. hatchet_sdk/v0/context/worker_context.py +28 -0
  253. hatchet_sdk/v0/contracts/dispatcher_pb2.py +102 -0
  254. hatchet_sdk/v0/contracts/dispatcher_pb2.pyi +387 -0
  255. hatchet_sdk/v0/contracts/dispatcher_pb2_grpc.py +621 -0
  256. hatchet_sdk/v0/contracts/events_pb2.py +46 -0
  257. hatchet_sdk/v0/contracts/events_pb2.pyi +87 -0
  258. hatchet_sdk/v0/contracts/events_pb2_grpc.py +274 -0
  259. hatchet_sdk/v0/contracts/workflows_pb2.py +80 -0
  260. hatchet_sdk/v0/contracts/workflows_pb2.pyi +312 -0
  261. hatchet_sdk/v0/contracts/workflows_pb2_grpc.py +277 -0
  262. hatchet_sdk/v0/features/cron.py +286 -0
  263. hatchet_sdk/v0/features/scheduled.py +248 -0
  264. hatchet_sdk/v0/hatchet.py +310 -0
  265. hatchet_sdk/v0/labels.py +10 -0
  266. hatchet_sdk/{loader.py → v0/loader.py} +11 -0
  267. hatchet_sdk/v0/logger.py +13 -0
  268. hatchet_sdk/v0/metadata.py +2 -0
  269. hatchet_sdk/v0/opentelemetry/instrumentor.py +396 -0
  270. hatchet_sdk/v0/rate_limit.py +126 -0
  271. hatchet_sdk/v0/semver.py +30 -0
  272. hatchet_sdk/v0/token.py +27 -0
  273. hatchet_sdk/v0/utils/aio_utils.py +137 -0
  274. hatchet_sdk/v0/utils/backoff.py +9 -0
  275. hatchet_sdk/v0/utils/typing.py +12 -0
  276. hatchet_sdk/{v2 → v0/v2}/callable.py +8 -8
  277. hatchet_sdk/{v2 → v0/v2}/concurrency.py +2 -2
  278. hatchet_sdk/{v2 → v0/v2}/hatchet.py +10 -10
  279. hatchet_sdk/v0/worker/__init__.py +1 -0
  280. hatchet_sdk/v0/worker/action_listener_process.py +278 -0
  281. hatchet_sdk/v0/worker/runner/run_loop_manager.py +112 -0
  282. hatchet_sdk/v0/worker/runner/runner.py +460 -0
  283. hatchet_sdk/v0/worker/runner/utils/capture_logs.py +81 -0
  284. hatchet_sdk/v0/worker/runner/utils/error_with_traceback.py +6 -0
  285. hatchet_sdk/v0/worker/worker.py +391 -0
  286. hatchet_sdk/v0/workflow.py +261 -0
  287. hatchet_sdk/v0/workflow_run.py +59 -0
  288. hatchet_sdk/worker/__init__.py +0 -1
  289. hatchet_sdk/worker/action_listener_process.py +36 -33
  290. hatchet_sdk/worker/runner/run_loop_manager.py +18 -16
  291. hatchet_sdk/worker/runner/runner.py +37 -59
  292. hatchet_sdk/worker/runner/utils/capture_logs.py +25 -14
  293. hatchet_sdk/worker/runner/utils/error_with_traceback.py +1 -1
  294. hatchet_sdk/worker/worker.py +61 -75
  295. hatchet_sdk/workflow.py +473 -207
  296. hatchet_sdk/workflow_run.py +14 -25
  297. {hatchet_sdk-0.46.1.dist-info → hatchet_sdk-1.0.0.dist-info}/METADATA +3 -2
  298. hatchet_sdk-1.0.0.dist-info/RECORD +485 -0
  299. {hatchet_sdk-0.46.1.dist-info → hatchet_sdk-1.0.0.dist-info}/entry_points.txt +1 -0
  300. hatchet_sdk/utils/serialization.py +0 -18
  301. hatchet_sdk-0.46.1.dist-info/RECORD +0 -237
  302. /hatchet_sdk/{utils → v0/utils}/types.py +0 -0
  303. {hatchet_sdk-0.46.1.dist-info → hatchet_sdk-1.0.0.dist-info}/WHEEL +0 -0
@@ -12,19 +12,18 @@
12
12
  """ # noqa: E501
13
13
 
14
14
  import warnings
15
+ from datetime import datetime
15
16
  from typing import Any, Dict, List, Optional, Tuple, Union
16
17
 
17
- from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
18
+ from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call
18
19
  from typing_extensions import Annotated
19
20
 
20
21
  from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
21
22
  from hatchet_sdk.clients.rest.api_response import ApiResponse
22
- from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import (
23
- ReplayWorkflowRunsRequest,
24
- )
25
- from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import (
26
- ReplayWorkflowRunsResponse,
27
- )
23
+ from hatchet_sdk.clients.rest.models.v1_task_event_list import V1TaskEventList
24
+ from hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus
25
+ from hatchet_sdk.clients.rest.models.v1_task_summary_list import V1TaskSummaryList
26
+ from hatchet_sdk.clients.rest.models.v1_workflow_run_details import V1WorkflowRunDetails
28
27
  from hatchet_sdk.clients.rest.rest import RESTResponseType
29
28
 
30
29
 
@@ -41,15 +40,15 @@ class WorkflowRunsApi:
41
40
  self.api_client = api_client
42
41
 
43
42
  @validate_call
44
- async def workflow_run_get_input(
43
+ async def v1_workflow_run_get(
45
44
  self,
46
- workflow_run: Annotated[
45
+ v1_workflow_run: Annotated[
47
46
  str,
48
47
  Field(
49
48
  min_length=36,
50
49
  strict=True,
51
50
  max_length=36,
52
- description="The workflow run id",
51
+ description="The workflow run id to get",
53
52
  ),
54
53
  ],
55
54
  _request_timeout: Union[
@@ -63,13 +62,13 @@ class WorkflowRunsApi:
63
62
  _content_type: Optional[StrictStr] = None,
64
63
  _headers: Optional[Dict[StrictStr, Any]] = None,
65
64
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
66
- ) -> Dict[str, object]:
67
- """Get workflow run input
65
+ ) -> V1WorkflowRunDetails:
66
+ """List tasks
68
67
 
69
- Get the input for a workflow run.
68
+ Get a workflow run and its metadata to display on the \"detail\" page
70
69
 
71
- :param workflow_run: The workflow run id (required)
72
- :type workflow_run: str
70
+ :param v1_workflow_run: The workflow run id to get (required)
71
+ :type v1_workflow_run: str
73
72
  :param _request_timeout: timeout setting for this request. If one
74
73
  number provided, it will be total request
75
74
  timeout. It can also be a pair (tuple) of
@@ -92,8 +91,8 @@ class WorkflowRunsApi:
92
91
  :return: Returns the result object.
93
92
  """ # noqa: E501
94
93
 
95
- _param = self._workflow_run_get_input_serialize(
96
- workflow_run=workflow_run,
94
+ _param = self._v1_workflow_run_get_serialize(
95
+ v1_workflow_run=v1_workflow_run,
97
96
  _request_auth=_request_auth,
98
97
  _content_type=_content_type,
99
98
  _headers=_headers,
@@ -101,10 +100,10 @@ class WorkflowRunsApi:
101
100
  )
102
101
 
103
102
  _response_types_map: Dict[str, Optional[str]] = {
104
- "200": "Dict[str, object]",
103
+ "200": "V1WorkflowRunDetails",
105
104
  "400": "APIErrors",
106
105
  "403": "APIErrors",
107
- "404": "APIErrors",
106
+ "501": "APIErrors",
108
107
  }
109
108
  response_data = await self.api_client.call_api(
110
109
  *_param, _request_timeout=_request_timeout
@@ -116,15 +115,15 @@ class WorkflowRunsApi:
116
115
  ).data
117
116
 
118
117
  @validate_call
119
- async def workflow_run_get_input_with_http_info(
118
+ async def v1_workflow_run_get_with_http_info(
120
119
  self,
121
- workflow_run: Annotated[
120
+ v1_workflow_run: Annotated[
122
121
  str,
123
122
  Field(
124
123
  min_length=36,
125
124
  strict=True,
126
125
  max_length=36,
127
- description="The workflow run id",
126
+ description="The workflow run id to get",
128
127
  ),
129
128
  ],
130
129
  _request_timeout: Union[
@@ -138,13 +137,13 @@ class WorkflowRunsApi:
138
137
  _content_type: Optional[StrictStr] = None,
139
138
  _headers: Optional[Dict[StrictStr, Any]] = None,
140
139
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
141
- ) -> ApiResponse[Dict[str, object]]:
142
- """Get workflow run input
140
+ ) -> ApiResponse[V1WorkflowRunDetails]:
141
+ """List tasks
143
142
 
144
- Get the input for a workflow run.
143
+ Get a workflow run and its metadata to display on the \"detail\" page
145
144
 
146
- :param workflow_run: The workflow run id (required)
147
- :type workflow_run: str
145
+ :param v1_workflow_run: The workflow run id to get (required)
146
+ :type v1_workflow_run: str
148
147
  :param _request_timeout: timeout setting for this request. If one
149
148
  number provided, it will be total request
150
149
  timeout. It can also be a pair (tuple) of
@@ -167,8 +166,8 @@ class WorkflowRunsApi:
167
166
  :return: Returns the result object.
168
167
  """ # noqa: E501
169
168
 
170
- _param = self._workflow_run_get_input_serialize(
171
- workflow_run=workflow_run,
169
+ _param = self._v1_workflow_run_get_serialize(
170
+ v1_workflow_run=v1_workflow_run,
172
171
  _request_auth=_request_auth,
173
172
  _content_type=_content_type,
174
173
  _headers=_headers,
@@ -176,10 +175,10 @@ class WorkflowRunsApi:
176
175
  )
177
176
 
178
177
  _response_types_map: Dict[str, Optional[str]] = {
179
- "200": "Dict[str, object]",
178
+ "200": "V1WorkflowRunDetails",
180
179
  "400": "APIErrors",
181
180
  "403": "APIErrors",
182
- "404": "APIErrors",
181
+ "501": "APIErrors",
183
182
  }
184
183
  response_data = await self.api_client.call_api(
185
184
  *_param, _request_timeout=_request_timeout
@@ -191,15 +190,15 @@ class WorkflowRunsApi:
191
190
  )
192
191
 
193
192
  @validate_call
194
- async def workflow_run_get_input_without_preload_content(
193
+ async def v1_workflow_run_get_without_preload_content(
195
194
  self,
196
- workflow_run: Annotated[
195
+ v1_workflow_run: Annotated[
197
196
  str,
198
197
  Field(
199
198
  min_length=36,
200
199
  strict=True,
201
200
  max_length=36,
202
- description="The workflow run id",
201
+ description="The workflow run id to get",
203
202
  ),
204
203
  ],
205
204
  _request_timeout: Union[
@@ -214,12 +213,12 @@ class WorkflowRunsApi:
214
213
  _headers: Optional[Dict[StrictStr, Any]] = None,
215
214
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
216
215
  ) -> RESTResponseType:
217
- """Get workflow run input
216
+ """List tasks
218
217
 
219
- Get the input for a workflow run.
218
+ Get a workflow run and its metadata to display on the \"detail\" page
220
219
 
221
- :param workflow_run: The workflow run id (required)
222
- :type workflow_run: str
220
+ :param v1_workflow_run: The workflow run id to get (required)
221
+ :type v1_workflow_run: str
223
222
  :param _request_timeout: timeout setting for this request. If one
224
223
  number provided, it will be total request
225
224
  timeout. It can also be a pair (tuple) of
@@ -242,8 +241,8 @@ class WorkflowRunsApi:
242
241
  :return: Returns the result object.
243
242
  """ # noqa: E501
244
243
 
245
- _param = self._workflow_run_get_input_serialize(
246
- workflow_run=workflow_run,
244
+ _param = self._v1_workflow_run_get_serialize(
245
+ v1_workflow_run=v1_workflow_run,
247
246
  _request_auth=_request_auth,
248
247
  _content_type=_content_type,
249
248
  _headers=_headers,
@@ -251,19 +250,19 @@ class WorkflowRunsApi:
251
250
  )
252
251
 
253
252
  _response_types_map: Dict[str, Optional[str]] = {
254
- "200": "Dict[str, object]",
253
+ "200": "V1WorkflowRunDetails",
255
254
  "400": "APIErrors",
256
255
  "403": "APIErrors",
257
- "404": "APIErrors",
256
+ "501": "APIErrors",
258
257
  }
259
258
  response_data = await self.api_client.call_api(
260
259
  *_param, _request_timeout=_request_timeout
261
260
  )
262
261
  return response_data.response
263
262
 
264
- def _workflow_run_get_input_serialize(
263
+ def _v1_workflow_run_get_serialize(
265
264
  self,
266
- workflow_run,
265
+ v1_workflow_run,
267
266
  _request_auth,
268
267
  _content_type,
269
268
  _headers,
@@ -278,28 +277,31 @@ class WorkflowRunsApi:
278
277
  _query_params: List[Tuple[str, str]] = []
279
278
  _header_params: Dict[str, Optional[str]] = _headers or {}
280
279
  _form_params: List[Tuple[str, str]] = []
281
- _files: Dict[str, Union[str, bytes]] = {}
280
+ _files: Dict[
281
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
282
+ ] = {}
282
283
  _body_params: Optional[bytes] = None
283
284
 
284
285
  # process the path parameters
285
- if workflow_run is not None:
286
- _path_params["workflow-run"] = workflow_run
286
+ if v1_workflow_run is not None:
287
+ _path_params["v1-workflow-run"] = v1_workflow_run
287
288
  # process the query parameters
288
289
  # process the header parameters
289
290
  # process the form parameters
290
291
  # process the body parameter
291
292
 
292
293
  # set the HTTP header `Accept`
293
- _header_params["Accept"] = self.api_client.select_header_accept(
294
- ["application/json"]
295
- )
294
+ if "Accept" not in _header_params:
295
+ _header_params["Accept"] = self.api_client.select_header_accept(
296
+ ["application/json"]
297
+ )
296
298
 
297
299
  # authentication setting
298
300
  _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
299
301
 
300
302
  return self.api_client.param_serialize(
301
303
  method="GET",
302
- resource_path="/api/v1/workflow-runs/{workflow-run}/input",
304
+ resource_path="/api/v1/stable/workflow-runs/{v1-workflow-run}",
303
305
  path_params=_path_params,
304
306
  query_params=_query_params,
305
307
  header_params=_header_params,
@@ -313,7 +315,7 @@ class WorkflowRunsApi:
313
315
  )
314
316
 
315
317
  @validate_call
316
- async def workflow_run_update_replay(
318
+ async def v1_workflow_run_list(
317
319
  self,
318
320
  tenant: Annotated[
319
321
  str,
@@ -321,10 +323,38 @@ class WorkflowRunsApi:
321
323
  min_length=36, strict=True, max_length=36, description="The tenant id"
322
324
  ),
323
325
  ],
324
- replay_workflow_runs_request: Annotated[
325
- ReplayWorkflowRunsRequest,
326
- Field(description="The workflow run ids to replay"),
326
+ since: Annotated[datetime, Field(description="The earliest date to filter by")],
327
+ only_tasks: Annotated[
328
+ StrictBool,
329
+ Field(description="Whether to include DAGs or only to include tasks"),
327
330
  ],
331
+ offset: Annotated[
332
+ Optional[StrictInt], Field(description="The number to skip")
333
+ ] = None,
334
+ limit: Annotated[
335
+ Optional[StrictInt], Field(description="The number to limit by")
336
+ ] = None,
337
+ statuses: Annotated[
338
+ Optional[List[V1TaskStatus]],
339
+ Field(description="A list of statuses to filter by"),
340
+ ] = None,
341
+ until: Annotated[
342
+ Optional[datetime], Field(description="The latest date to filter by")
343
+ ] = None,
344
+ additional_metadata: Annotated[
345
+ Optional[List[StrictStr]],
346
+ Field(description="Additional metadata k-v pairs to filter by"),
347
+ ] = None,
348
+ workflow_ids: Annotated[
349
+ Optional[
350
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]
351
+ ],
352
+ Field(description="The workflow ids to find runs for"),
353
+ ] = None,
354
+ worker_id: Annotated[
355
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
356
+ Field(description="The worker id to filter by"),
357
+ ] = None,
328
358
  _request_timeout: Union[
329
359
  None,
330
360
  Annotated[StrictFloat, Field(gt=0)],
@@ -336,15 +366,31 @@ class WorkflowRunsApi:
336
366
  _content_type: Optional[StrictStr] = None,
337
367
  _headers: Optional[Dict[StrictStr, Any]] = None,
338
368
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
339
- ) -> ReplayWorkflowRunsResponse:
340
- """Replay workflow runs
369
+ ) -> V1TaskSummaryList:
370
+ """List workflow runs
341
371
 
342
- Replays a list of workflow runs.
372
+ Lists workflow runs for a tenant.
343
373
 
344
374
  :param tenant: The tenant id (required)
345
375
  :type tenant: str
346
- :param replay_workflow_runs_request: The workflow run ids to replay (required)
347
- :type replay_workflow_runs_request: ReplayWorkflowRunsRequest
376
+ :param since: The earliest date to filter by (required)
377
+ :type since: datetime
378
+ :param only_tasks: Whether to include DAGs or only to include tasks (required)
379
+ :type only_tasks: bool
380
+ :param offset: The number to skip
381
+ :type offset: int
382
+ :param limit: The number to limit by
383
+ :type limit: int
384
+ :param statuses: A list of statuses to filter by
385
+ :type statuses: List[V1TaskStatus]
386
+ :param until: The latest date to filter by
387
+ :type until: datetime
388
+ :param additional_metadata: Additional metadata k-v pairs to filter by
389
+ :type additional_metadata: List[str]
390
+ :param workflow_ids: The workflow ids to find runs for
391
+ :type workflow_ids: List[str]
392
+ :param worker_id: The worker id to filter by
393
+ :type worker_id: str
348
394
  :param _request_timeout: timeout setting for this request. If one
349
395
  number provided, it will be total request
350
396
  timeout. It can also be a pair (tuple) of
@@ -367,9 +413,17 @@ class WorkflowRunsApi:
367
413
  :return: Returns the result object.
368
414
  """ # noqa: E501
369
415
 
370
- _param = self._workflow_run_update_replay_serialize(
416
+ _param = self._v1_workflow_run_list_serialize(
371
417
  tenant=tenant,
372
- replay_workflow_runs_request=replay_workflow_runs_request,
418
+ since=since,
419
+ only_tasks=only_tasks,
420
+ offset=offset,
421
+ limit=limit,
422
+ statuses=statuses,
423
+ until=until,
424
+ additional_metadata=additional_metadata,
425
+ workflow_ids=workflow_ids,
426
+ worker_id=worker_id,
373
427
  _request_auth=_request_auth,
374
428
  _content_type=_content_type,
375
429
  _headers=_headers,
@@ -377,10 +431,10 @@ class WorkflowRunsApi:
377
431
  )
378
432
 
379
433
  _response_types_map: Dict[str, Optional[str]] = {
380
- "200": "ReplayWorkflowRunsResponse",
434
+ "200": "V1TaskSummaryList",
381
435
  "400": "APIErrors",
382
436
  "403": "APIErrors",
383
- "429": "APIErrors",
437
+ "501": "APIErrors",
384
438
  }
385
439
  response_data = await self.api_client.call_api(
386
440
  *_param, _request_timeout=_request_timeout
@@ -392,7 +446,7 @@ class WorkflowRunsApi:
392
446
  ).data
393
447
 
394
448
  @validate_call
395
- async def workflow_run_update_replay_with_http_info(
449
+ async def v1_workflow_run_list_with_http_info(
396
450
  self,
397
451
  tenant: Annotated[
398
452
  str,
@@ -400,10 +454,38 @@ class WorkflowRunsApi:
400
454
  min_length=36, strict=True, max_length=36, description="The tenant id"
401
455
  ),
402
456
  ],
403
- replay_workflow_runs_request: Annotated[
404
- ReplayWorkflowRunsRequest,
405
- Field(description="The workflow run ids to replay"),
457
+ since: Annotated[datetime, Field(description="The earliest date to filter by")],
458
+ only_tasks: Annotated[
459
+ StrictBool,
460
+ Field(description="Whether to include DAGs or only to include tasks"),
406
461
  ],
462
+ offset: Annotated[
463
+ Optional[StrictInt], Field(description="The number to skip")
464
+ ] = None,
465
+ limit: Annotated[
466
+ Optional[StrictInt], Field(description="The number to limit by")
467
+ ] = None,
468
+ statuses: Annotated[
469
+ Optional[List[V1TaskStatus]],
470
+ Field(description="A list of statuses to filter by"),
471
+ ] = None,
472
+ until: Annotated[
473
+ Optional[datetime], Field(description="The latest date to filter by")
474
+ ] = None,
475
+ additional_metadata: Annotated[
476
+ Optional[List[StrictStr]],
477
+ Field(description="Additional metadata k-v pairs to filter by"),
478
+ ] = None,
479
+ workflow_ids: Annotated[
480
+ Optional[
481
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]
482
+ ],
483
+ Field(description="The workflow ids to find runs for"),
484
+ ] = None,
485
+ worker_id: Annotated[
486
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
487
+ Field(description="The worker id to filter by"),
488
+ ] = None,
407
489
  _request_timeout: Union[
408
490
  None,
409
491
  Annotated[StrictFloat, Field(gt=0)],
@@ -415,15 +497,31 @@ class WorkflowRunsApi:
415
497
  _content_type: Optional[StrictStr] = None,
416
498
  _headers: Optional[Dict[StrictStr, Any]] = None,
417
499
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
418
- ) -> ApiResponse[ReplayWorkflowRunsResponse]:
419
- """Replay workflow runs
500
+ ) -> ApiResponse[V1TaskSummaryList]:
501
+ """List workflow runs
420
502
 
421
- Replays a list of workflow runs.
503
+ Lists workflow runs for a tenant.
422
504
 
423
505
  :param tenant: The tenant id (required)
424
506
  :type tenant: str
425
- :param replay_workflow_runs_request: The workflow run ids to replay (required)
426
- :type replay_workflow_runs_request: ReplayWorkflowRunsRequest
507
+ :param since: The earliest date to filter by (required)
508
+ :type since: datetime
509
+ :param only_tasks: Whether to include DAGs or only to include tasks (required)
510
+ :type only_tasks: bool
511
+ :param offset: The number to skip
512
+ :type offset: int
513
+ :param limit: The number to limit by
514
+ :type limit: int
515
+ :param statuses: A list of statuses to filter by
516
+ :type statuses: List[V1TaskStatus]
517
+ :param until: The latest date to filter by
518
+ :type until: datetime
519
+ :param additional_metadata: Additional metadata k-v pairs to filter by
520
+ :type additional_metadata: List[str]
521
+ :param workflow_ids: The workflow ids to find runs for
522
+ :type workflow_ids: List[str]
523
+ :param worker_id: The worker id to filter by
524
+ :type worker_id: str
427
525
  :param _request_timeout: timeout setting for this request. If one
428
526
  number provided, it will be total request
429
527
  timeout. It can also be a pair (tuple) of
@@ -446,9 +544,17 @@ class WorkflowRunsApi:
446
544
  :return: Returns the result object.
447
545
  """ # noqa: E501
448
546
 
449
- _param = self._workflow_run_update_replay_serialize(
547
+ _param = self._v1_workflow_run_list_serialize(
450
548
  tenant=tenant,
451
- replay_workflow_runs_request=replay_workflow_runs_request,
549
+ since=since,
550
+ only_tasks=only_tasks,
551
+ offset=offset,
552
+ limit=limit,
553
+ statuses=statuses,
554
+ until=until,
555
+ additional_metadata=additional_metadata,
556
+ workflow_ids=workflow_ids,
557
+ worker_id=worker_id,
452
558
  _request_auth=_request_auth,
453
559
  _content_type=_content_type,
454
560
  _headers=_headers,
@@ -456,10 +562,10 @@ class WorkflowRunsApi:
456
562
  )
457
563
 
458
564
  _response_types_map: Dict[str, Optional[str]] = {
459
- "200": "ReplayWorkflowRunsResponse",
565
+ "200": "V1TaskSummaryList",
460
566
  "400": "APIErrors",
461
567
  "403": "APIErrors",
462
- "429": "APIErrors",
568
+ "501": "APIErrors",
463
569
  }
464
570
  response_data = await self.api_client.call_api(
465
571
  *_param, _request_timeout=_request_timeout
@@ -471,7 +577,7 @@ class WorkflowRunsApi:
471
577
  )
472
578
 
473
579
  @validate_call
474
- async def workflow_run_update_replay_without_preload_content(
580
+ async def v1_workflow_run_list_without_preload_content(
475
581
  self,
476
582
  tenant: Annotated[
477
583
  str,
@@ -479,10 +585,38 @@ class WorkflowRunsApi:
479
585
  min_length=36, strict=True, max_length=36, description="The tenant id"
480
586
  ),
481
587
  ],
482
- replay_workflow_runs_request: Annotated[
483
- ReplayWorkflowRunsRequest,
484
- Field(description="The workflow run ids to replay"),
588
+ since: Annotated[datetime, Field(description="The earliest date to filter by")],
589
+ only_tasks: Annotated[
590
+ StrictBool,
591
+ Field(description="Whether to include DAGs or only to include tasks"),
485
592
  ],
593
+ offset: Annotated[
594
+ Optional[StrictInt], Field(description="The number to skip")
595
+ ] = None,
596
+ limit: Annotated[
597
+ Optional[StrictInt], Field(description="The number to limit by")
598
+ ] = None,
599
+ statuses: Annotated[
600
+ Optional[List[V1TaskStatus]],
601
+ Field(description="A list of statuses to filter by"),
602
+ ] = None,
603
+ until: Annotated[
604
+ Optional[datetime], Field(description="The latest date to filter by")
605
+ ] = None,
606
+ additional_metadata: Annotated[
607
+ Optional[List[StrictStr]],
608
+ Field(description="Additional metadata k-v pairs to filter by"),
609
+ ] = None,
610
+ workflow_ids: Annotated[
611
+ Optional[
612
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]
613
+ ],
614
+ Field(description="The workflow ids to find runs for"),
615
+ ] = None,
616
+ worker_id: Annotated[
617
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
618
+ Field(description="The worker id to filter by"),
619
+ ] = None,
486
620
  _request_timeout: Union[
487
621
  None,
488
622
  Annotated[StrictFloat, Field(gt=0)],
@@ -495,14 +629,30 @@ class WorkflowRunsApi:
495
629
  _headers: Optional[Dict[StrictStr, Any]] = None,
496
630
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
497
631
  ) -> RESTResponseType:
498
- """Replay workflow runs
632
+ """List workflow runs
499
633
 
500
- Replays a list of workflow runs.
634
+ Lists workflow runs for a tenant.
501
635
 
502
636
  :param tenant: The tenant id (required)
503
637
  :type tenant: str
504
- :param replay_workflow_runs_request: The workflow run ids to replay (required)
505
- :type replay_workflow_runs_request: ReplayWorkflowRunsRequest
638
+ :param since: The earliest date to filter by (required)
639
+ :type since: datetime
640
+ :param only_tasks: Whether to include DAGs or only to include tasks (required)
641
+ :type only_tasks: bool
642
+ :param offset: The number to skip
643
+ :type offset: int
644
+ :param limit: The number to limit by
645
+ :type limit: int
646
+ :param statuses: A list of statuses to filter by
647
+ :type statuses: List[V1TaskStatus]
648
+ :param until: The latest date to filter by
649
+ :type until: datetime
650
+ :param additional_metadata: Additional metadata k-v pairs to filter by
651
+ :type additional_metadata: List[str]
652
+ :param workflow_ids: The workflow ids to find runs for
653
+ :type workflow_ids: List[str]
654
+ :param worker_id: The worker id to filter by
655
+ :type worker_id: str
506
656
  :param _request_timeout: timeout setting for this request. If one
507
657
  number provided, it will be total request
508
658
  timeout. It can also be a pair (tuple) of
@@ -525,9 +675,17 @@ class WorkflowRunsApi:
525
675
  :return: Returns the result object.
526
676
  """ # noqa: E501
527
677
 
528
- _param = self._workflow_run_update_replay_serialize(
678
+ _param = self._v1_workflow_run_list_serialize(
529
679
  tenant=tenant,
530
- replay_workflow_runs_request=replay_workflow_runs_request,
680
+ since=since,
681
+ only_tasks=only_tasks,
682
+ offset=offset,
683
+ limit=limit,
684
+ statuses=statuses,
685
+ until=until,
686
+ additional_metadata=additional_metadata,
687
+ workflow_ids=workflow_ids,
688
+ worker_id=worker_id,
531
689
  _request_auth=_request_auth,
532
690
  _content_type=_content_type,
533
691
  _headers=_headers,
@@ -535,20 +693,28 @@ class WorkflowRunsApi:
535
693
  )
536
694
 
537
695
  _response_types_map: Dict[str, Optional[str]] = {
538
- "200": "ReplayWorkflowRunsResponse",
696
+ "200": "V1TaskSummaryList",
539
697
  "400": "APIErrors",
540
698
  "403": "APIErrors",
541
- "429": "APIErrors",
699
+ "501": "APIErrors",
542
700
  }
543
701
  response_data = await self.api_client.call_api(
544
702
  *_param, _request_timeout=_request_timeout
545
703
  )
546
704
  return response_data.response
547
705
 
548
- def _workflow_run_update_replay_serialize(
706
+ def _v1_workflow_run_list_serialize(
549
707
  self,
550
708
  tenant,
551
- replay_workflow_runs_request,
709
+ since,
710
+ only_tasks,
711
+ offset,
712
+ limit,
713
+ statuses,
714
+ until,
715
+ additional_metadata,
716
+ workflow_ids,
717
+ worker_id,
552
718
  _request_auth,
553
719
  _content_type,
554
720
  _headers,
@@ -557,46 +723,412 @@ class WorkflowRunsApi:
557
723
 
558
724
  _host = None
559
725
 
560
- _collection_formats: Dict[str, str] = {}
726
+ _collection_formats: Dict[str, str] = {
727
+ "statuses": "multi",
728
+ "additional_metadata": "multi",
729
+ "workflow_ids": "multi",
730
+ }
561
731
 
562
732
  _path_params: Dict[str, str] = {}
563
733
  _query_params: List[Tuple[str, str]] = []
564
734
  _header_params: Dict[str, Optional[str]] = _headers or {}
565
735
  _form_params: List[Tuple[str, str]] = []
566
- _files: Dict[str, Union[str, bytes]] = {}
736
+ _files: Dict[
737
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
738
+ ] = {}
567
739
  _body_params: Optional[bytes] = None
568
740
 
569
741
  # process the path parameters
570
742
  if tenant is not None:
571
743
  _path_params["tenant"] = tenant
572
744
  # process the query parameters
745
+ if offset is not None:
746
+
747
+ _query_params.append(("offset", offset))
748
+
749
+ if limit is not None:
750
+
751
+ _query_params.append(("limit", limit))
752
+
753
+ if statuses is not None:
754
+
755
+ _query_params.append(("statuses", statuses))
756
+
757
+ if since is not None:
758
+ if isinstance(since, datetime):
759
+ _query_params.append(
760
+ (
761
+ "since",
762
+ since.strftime(self.api_client.configuration.datetime_format),
763
+ )
764
+ )
765
+ else:
766
+ _query_params.append(("since", since))
767
+
768
+ if until is not None:
769
+ if isinstance(until, datetime):
770
+ _query_params.append(
771
+ (
772
+ "until",
773
+ until.strftime(self.api_client.configuration.datetime_format),
774
+ )
775
+ )
776
+ else:
777
+ _query_params.append(("until", until))
778
+
779
+ if additional_metadata is not None:
780
+
781
+ _query_params.append(("additional_metadata", additional_metadata))
782
+
783
+ if workflow_ids is not None:
784
+
785
+ _query_params.append(("workflow_ids", workflow_ids))
786
+
787
+ if worker_id is not None:
788
+
789
+ _query_params.append(("worker_id", worker_id))
790
+
791
+ if only_tasks is not None:
792
+
793
+ _query_params.append(("only_tasks", only_tasks))
794
+
573
795
  # process the header parameters
574
796
  # process the form parameters
575
797
  # process the body parameter
576
- if replay_workflow_runs_request is not None:
577
- _body_params = replay_workflow_runs_request
578
798
 
579
799
  # set the HTTP header `Accept`
580
- _header_params["Accept"] = self.api_client.select_header_accept(
581
- ["application/json"]
800
+ if "Accept" not in _header_params:
801
+ _header_params["Accept"] = self.api_client.select_header_accept(
802
+ ["application/json"]
803
+ )
804
+
805
+ # authentication setting
806
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
807
+
808
+ return self.api_client.param_serialize(
809
+ method="GET",
810
+ resource_path="/api/v1/stable/tenants/{tenant}/workflow-runs",
811
+ path_params=_path_params,
812
+ query_params=_query_params,
813
+ header_params=_header_params,
814
+ body=_body_params,
815
+ post_params=_form_params,
816
+ files=_files,
817
+ auth_settings=_auth_settings,
818
+ collection_formats=_collection_formats,
819
+ _host=_host,
820
+ _request_auth=_request_auth,
821
+ )
822
+
823
+ @validate_call
824
+ async def v1_workflow_run_task_events_list(
825
+ self,
826
+ v1_workflow_run: Annotated[
827
+ str,
828
+ Field(
829
+ min_length=36,
830
+ strict=True,
831
+ max_length=36,
832
+ description="The workflow run id to find runs for",
833
+ ),
834
+ ],
835
+ offset: Annotated[
836
+ Optional[StrictInt], Field(description="The number to skip")
837
+ ] = None,
838
+ limit: Annotated[
839
+ Optional[StrictInt], Field(description="The number to limit by")
840
+ ] = None,
841
+ _request_timeout: Union[
842
+ None,
843
+ Annotated[StrictFloat, Field(gt=0)],
844
+ Tuple[
845
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
846
+ ],
847
+ ] = None,
848
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
849
+ _content_type: Optional[StrictStr] = None,
850
+ _headers: Optional[Dict[StrictStr, Any]] = None,
851
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
852
+ ) -> V1TaskEventList:
853
+ """List tasks
854
+
855
+ List all tasks for a workflow run
856
+
857
+ :param v1_workflow_run: The workflow run id to find runs for (required)
858
+ :type v1_workflow_run: str
859
+ :param offset: The number to skip
860
+ :type offset: int
861
+ :param limit: The number to limit by
862
+ :type limit: int
863
+ :param _request_timeout: timeout setting for this request. If one
864
+ number provided, it will be total request
865
+ timeout. It can also be a pair (tuple) of
866
+ (connection, read) timeouts.
867
+ :type _request_timeout: int, tuple(int, int), optional
868
+ :param _request_auth: set to override the auth_settings for an a single
869
+ request; this effectively ignores the
870
+ authentication in the spec for a single request.
871
+ :type _request_auth: dict, optional
872
+ :param _content_type: force content-type for the request.
873
+ :type _content_type: str, Optional
874
+ :param _headers: set to override the headers for a single
875
+ request; this effectively ignores the headers
876
+ in the spec for a single request.
877
+ :type _headers: dict, optional
878
+ :param _host_index: set to override the host_index for a single
879
+ request; this effectively ignores the host_index
880
+ in the spec for a single request.
881
+ :type _host_index: int, optional
882
+ :return: Returns the result object.
883
+ """ # noqa: E501
884
+
885
+ _param = self._v1_workflow_run_task_events_list_serialize(
886
+ v1_workflow_run=v1_workflow_run,
887
+ offset=offset,
888
+ limit=limit,
889
+ _request_auth=_request_auth,
890
+ _content_type=_content_type,
891
+ _headers=_headers,
892
+ _host_index=_host_index,
893
+ )
894
+
895
+ _response_types_map: Dict[str, Optional[str]] = {
896
+ "200": "V1TaskEventList",
897
+ "400": "APIErrors",
898
+ "403": "APIErrors",
899
+ "501": "APIErrors",
900
+ }
901
+ response_data = await self.api_client.call_api(
902
+ *_param, _request_timeout=_request_timeout
903
+ )
904
+ await response_data.read()
905
+ return self.api_client.response_deserialize(
906
+ response_data=response_data,
907
+ response_types_map=_response_types_map,
908
+ ).data
909
+
910
+ @validate_call
911
+ async def v1_workflow_run_task_events_list_with_http_info(
912
+ self,
913
+ v1_workflow_run: Annotated[
914
+ str,
915
+ Field(
916
+ min_length=36,
917
+ strict=True,
918
+ max_length=36,
919
+ description="The workflow run id to find runs for",
920
+ ),
921
+ ],
922
+ offset: Annotated[
923
+ Optional[StrictInt], Field(description="The number to skip")
924
+ ] = None,
925
+ limit: Annotated[
926
+ Optional[StrictInt], Field(description="The number to limit by")
927
+ ] = None,
928
+ _request_timeout: Union[
929
+ None,
930
+ Annotated[StrictFloat, Field(gt=0)],
931
+ Tuple[
932
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
933
+ ],
934
+ ] = None,
935
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
936
+ _content_type: Optional[StrictStr] = None,
937
+ _headers: Optional[Dict[StrictStr, Any]] = None,
938
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
939
+ ) -> ApiResponse[V1TaskEventList]:
940
+ """List tasks
941
+
942
+ List all tasks for a workflow run
943
+
944
+ :param v1_workflow_run: The workflow run id to find runs for (required)
945
+ :type v1_workflow_run: str
946
+ :param offset: The number to skip
947
+ :type offset: int
948
+ :param limit: The number to limit by
949
+ :type limit: int
950
+ :param _request_timeout: timeout setting for this request. If one
951
+ number provided, it will be total request
952
+ timeout. It can also be a pair (tuple) of
953
+ (connection, read) timeouts.
954
+ :type _request_timeout: int, tuple(int, int), optional
955
+ :param _request_auth: set to override the auth_settings for an a single
956
+ request; this effectively ignores the
957
+ authentication in the spec for a single request.
958
+ :type _request_auth: dict, optional
959
+ :param _content_type: force content-type for the request.
960
+ :type _content_type: str, Optional
961
+ :param _headers: set to override the headers for a single
962
+ request; this effectively ignores the headers
963
+ in the spec for a single request.
964
+ :type _headers: dict, optional
965
+ :param _host_index: set to override the host_index for a single
966
+ request; this effectively ignores the host_index
967
+ in the spec for a single request.
968
+ :type _host_index: int, optional
969
+ :return: Returns the result object.
970
+ """ # noqa: E501
971
+
972
+ _param = self._v1_workflow_run_task_events_list_serialize(
973
+ v1_workflow_run=v1_workflow_run,
974
+ offset=offset,
975
+ limit=limit,
976
+ _request_auth=_request_auth,
977
+ _content_type=_content_type,
978
+ _headers=_headers,
979
+ _host_index=_host_index,
980
+ )
981
+
982
+ _response_types_map: Dict[str, Optional[str]] = {
983
+ "200": "V1TaskEventList",
984
+ "400": "APIErrors",
985
+ "403": "APIErrors",
986
+ "501": "APIErrors",
987
+ }
988
+ response_data = await self.api_client.call_api(
989
+ *_param, _request_timeout=_request_timeout
990
+ )
991
+ await response_data.read()
992
+ return self.api_client.response_deserialize(
993
+ response_data=response_data,
994
+ response_types_map=_response_types_map,
995
+ )
996
+
997
+ @validate_call
998
+ async def v1_workflow_run_task_events_list_without_preload_content(
999
+ self,
1000
+ v1_workflow_run: Annotated[
1001
+ str,
1002
+ Field(
1003
+ min_length=36,
1004
+ strict=True,
1005
+ max_length=36,
1006
+ description="The workflow run id to find runs for",
1007
+ ),
1008
+ ],
1009
+ offset: Annotated[
1010
+ Optional[StrictInt], Field(description="The number to skip")
1011
+ ] = None,
1012
+ limit: Annotated[
1013
+ Optional[StrictInt], Field(description="The number to limit by")
1014
+ ] = None,
1015
+ _request_timeout: Union[
1016
+ None,
1017
+ Annotated[StrictFloat, Field(gt=0)],
1018
+ Tuple[
1019
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1020
+ ],
1021
+ ] = None,
1022
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1023
+ _content_type: Optional[StrictStr] = None,
1024
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1025
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1026
+ ) -> RESTResponseType:
1027
+ """List tasks
1028
+
1029
+ List all tasks for a workflow run
1030
+
1031
+ :param v1_workflow_run: The workflow run id to find runs for (required)
1032
+ :type v1_workflow_run: str
1033
+ :param offset: The number to skip
1034
+ :type offset: int
1035
+ :param limit: The number to limit by
1036
+ :type limit: int
1037
+ :param _request_timeout: timeout setting for this request. If one
1038
+ number provided, it will be total request
1039
+ timeout. It can also be a pair (tuple) of
1040
+ (connection, read) timeouts.
1041
+ :type _request_timeout: int, tuple(int, int), optional
1042
+ :param _request_auth: set to override the auth_settings for an a single
1043
+ request; this effectively ignores the
1044
+ authentication in the spec for a single request.
1045
+ :type _request_auth: dict, optional
1046
+ :param _content_type: force content-type for the request.
1047
+ :type _content_type: str, Optional
1048
+ :param _headers: set to override the headers for a single
1049
+ request; this effectively ignores the headers
1050
+ in the spec for a single request.
1051
+ :type _headers: dict, optional
1052
+ :param _host_index: set to override the host_index for a single
1053
+ request; this effectively ignores the host_index
1054
+ in the spec for a single request.
1055
+ :type _host_index: int, optional
1056
+ :return: Returns the result object.
1057
+ """ # noqa: E501
1058
+
1059
+ _param = self._v1_workflow_run_task_events_list_serialize(
1060
+ v1_workflow_run=v1_workflow_run,
1061
+ offset=offset,
1062
+ limit=limit,
1063
+ _request_auth=_request_auth,
1064
+ _content_type=_content_type,
1065
+ _headers=_headers,
1066
+ _host_index=_host_index,
582
1067
  )
583
1068
 
584
- # set the HTTP header `Content-Type`
585
- if _content_type:
586
- _header_params["Content-Type"] = _content_type
587
- else:
588
- _default_content_type = self.api_client.select_header_content_type(
1069
+ _response_types_map: Dict[str, Optional[str]] = {
1070
+ "200": "V1TaskEventList",
1071
+ "400": "APIErrors",
1072
+ "403": "APIErrors",
1073
+ "501": "APIErrors",
1074
+ }
1075
+ response_data = await self.api_client.call_api(
1076
+ *_param, _request_timeout=_request_timeout
1077
+ )
1078
+ return response_data.response
1079
+
1080
+ def _v1_workflow_run_task_events_list_serialize(
1081
+ self,
1082
+ v1_workflow_run,
1083
+ offset,
1084
+ limit,
1085
+ _request_auth,
1086
+ _content_type,
1087
+ _headers,
1088
+ _host_index,
1089
+ ) -> RequestSerialized:
1090
+
1091
+ _host = None
1092
+
1093
+ _collection_formats: Dict[str, str] = {}
1094
+
1095
+ _path_params: Dict[str, str] = {}
1096
+ _query_params: List[Tuple[str, str]] = []
1097
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1098
+ _form_params: List[Tuple[str, str]] = []
1099
+ _files: Dict[
1100
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1101
+ ] = {}
1102
+ _body_params: Optional[bytes] = None
1103
+
1104
+ # process the path parameters
1105
+ if v1_workflow_run is not None:
1106
+ _path_params["v1-workflow-run"] = v1_workflow_run
1107
+ # process the query parameters
1108
+ if offset is not None:
1109
+
1110
+ _query_params.append(("offset", offset))
1111
+
1112
+ if limit is not None:
1113
+
1114
+ _query_params.append(("limit", limit))
1115
+
1116
+ # process the header parameters
1117
+ # process the form parameters
1118
+ # process the body parameter
1119
+
1120
+ # set the HTTP header `Accept`
1121
+ if "Accept" not in _header_params:
1122
+ _header_params["Accept"] = self.api_client.select_header_accept(
589
1123
  ["application/json"]
590
1124
  )
591
- if _default_content_type is not None:
592
- _header_params["Content-Type"] = _default_content_type
593
1125
 
594
1126
  # authentication setting
595
1127
  _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
596
1128
 
597
1129
  return self.api_client.param_serialize(
598
- method="POST",
599
- resource_path="/api/v1/tenants/{tenant}/workflow-runs/replay",
1130
+ method="GET",
1131
+ resource_path="/api/v1/stable/workflow-runs/{v1-workflow-run}/task-events",
600
1132
  path_params=_path_params,
601
1133
  query_params=_query_params,
602
1134
  header_params=_header_params,