hatchet-sdk 0.47.1__py3-none-any.whl → 1.0.0a1__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.

Potentially problematic release.


This version of hatchet-sdk might be problematic. Click here for more details.

Files changed (329) hide show
  1. hatchet_sdk/__init__.py +45 -25
  2. hatchet_sdk/client.py +19 -94
  3. hatchet_sdk/clients/admin.py +309 -389
  4. hatchet_sdk/clients/dispatcher/action_listener.py +131 -109
  5. hatchet_sdk/clients/dispatcher/dispatcher.py +39 -37
  6. hatchet_sdk/clients/durable_event_listener.py +327 -0
  7. hatchet_sdk/clients/event_ts.py +23 -10
  8. hatchet_sdk/clients/events.py +96 -99
  9. hatchet_sdk/clients/rest/__init__.py +35 -0
  10. hatchet_sdk/clients/rest/api/__init__.py +2 -0
  11. hatchet_sdk/clients/rest/api/log_api.py +258 -0
  12. hatchet_sdk/clients/rest/api/task_api.py +2200 -0
  13. hatchet_sdk/clients/rest/api/workflow_runs_api.py +1274 -116
  14. hatchet_sdk/clients/rest/api_client.py +1 -1
  15. hatchet_sdk/clients/rest/configuration.py +8 -1
  16. hatchet_sdk/clients/rest/exceptions.py +21 -0
  17. hatchet_sdk/clients/rest/models/__init__.py +33 -0
  18. hatchet_sdk/clients/rest/models/tenant.py +4 -0
  19. hatchet_sdk/clients/rest/models/tenant_version.py +37 -0
  20. hatchet_sdk/clients/rest/models/update_tenant_request.py +7 -0
  21. hatchet_sdk/clients/rest/models/v1_cancel_task_request.py +104 -0
  22. hatchet_sdk/clients/rest/models/v1_dag_children.py +102 -0
  23. hatchet_sdk/clients/rest/models/v1_log_line.py +94 -0
  24. hatchet_sdk/clients/rest/models/v1_log_line_level.py +39 -0
  25. hatchet_sdk/clients/rest/models/v1_log_line_list.py +110 -0
  26. hatchet_sdk/clients/rest/models/v1_replay_task_request.py +104 -0
  27. hatchet_sdk/clients/rest/models/v1_task.py +174 -0
  28. hatchet_sdk/clients/rest/models/v1_task_event.py +118 -0
  29. hatchet_sdk/clients/rest/models/v1_task_event_list.py +110 -0
  30. hatchet_sdk/clients/rest/models/v1_task_event_type.py +55 -0
  31. hatchet_sdk/clients/rest/models/v1_task_filter.py +106 -0
  32. hatchet_sdk/clients/rest/models/v1_task_point_metric.py +92 -0
  33. hatchet_sdk/clients/rest/models/v1_task_point_metrics.py +100 -0
  34. hatchet_sdk/clients/rest/models/v1_task_run_metric.py +88 -0
  35. hatchet_sdk/clients/rest/models/v1_task_run_status.py +40 -0
  36. hatchet_sdk/clients/rest/models/v1_task_status.py +40 -0
  37. hatchet_sdk/clients/rest/models/v1_task_summary.py +228 -0
  38. hatchet_sdk/clients/rest/models/v1_task_summary_list.py +110 -0
  39. hatchet_sdk/clients/rest/models/v1_trigger_workflow_run_request.py +95 -0
  40. hatchet_sdk/clients/rest/models/v1_workflow_run.py +171 -0
  41. hatchet_sdk/clients/rest/models/v1_workflow_run_details.py +145 -0
  42. hatchet_sdk/clients/rest/models/v1_workflow_run_display_name.py +98 -0
  43. hatchet_sdk/clients/rest/models/v1_workflow_run_display_name_list.py +114 -0
  44. hatchet_sdk/clients/rest/models/v1_workflow_type.py +37 -0
  45. hatchet_sdk/clients/rest/models/workflow_run_shape_item_for_workflow_run_details.py +104 -0
  46. hatchet_sdk/clients/rest/rest.py +37 -26
  47. hatchet_sdk/clients/rest/tenacity_utils.py +1 -1
  48. hatchet_sdk/clients/rest_client.py +153 -116
  49. hatchet_sdk/clients/run_event_listener.py +65 -60
  50. hatchet_sdk/clients/workflow_listener.py +75 -66
  51. hatchet_sdk/config.py +117 -0
  52. hatchet_sdk/connection.py +27 -13
  53. hatchet_sdk/context/__init__.py +0 -1
  54. hatchet_sdk/context/context.py +118 -280
  55. hatchet_sdk/contracts/dispatcher_pb2_grpc.py +1 -1
  56. hatchet_sdk/contracts/events_pb2.py +2 -2
  57. hatchet_sdk/contracts/events_pb2_grpc.py +1 -1
  58. hatchet_sdk/contracts/v1/dispatcher_pb2.py +36 -0
  59. hatchet_sdk/contracts/v1/dispatcher_pb2.pyi +38 -0
  60. hatchet_sdk/contracts/v1/dispatcher_pb2_grpc.py +145 -0
  61. hatchet_sdk/contracts/v1/shared/condition_pb2.py +39 -0
  62. hatchet_sdk/contracts/v1/shared/condition_pb2.pyi +72 -0
  63. hatchet_sdk/contracts/v1/shared/condition_pb2_grpc.py +29 -0
  64. hatchet_sdk/contracts/v1/workflows_pb2.py +67 -0
  65. hatchet_sdk/contracts/v1/workflows_pb2.pyi +228 -0
  66. hatchet_sdk/contracts/v1/workflows_pb2_grpc.py +234 -0
  67. hatchet_sdk/contracts/workflows_pb2_grpc.py +1 -1
  68. hatchet_sdk/features/cron.py +43 -57
  69. hatchet_sdk/features/scheduled.py +60 -74
  70. hatchet_sdk/hatchet.py +491 -218
  71. hatchet_sdk/labels.py +4 -6
  72. hatchet_sdk/metadata.py +1 -1
  73. hatchet_sdk/opentelemetry/instrumentor.py +17 -18
  74. hatchet_sdk/rate_limit.py +40 -55
  75. hatchet_sdk/runnables/contextvars.py +12 -0
  76. hatchet_sdk/runnables/standalone.py +194 -0
  77. hatchet_sdk/runnables/task.py +144 -0
  78. hatchet_sdk/runnables/types.py +138 -0
  79. hatchet_sdk/runnables/workflow.py +764 -0
  80. hatchet_sdk/token.py +13 -9
  81. hatchet_sdk/utils/aio_utils.py +0 -119
  82. hatchet_sdk/utils/proto_enums.py +47 -0
  83. hatchet_sdk/utils/timedelta_to_expression.py +23 -0
  84. hatchet_sdk/utils/typing.py +10 -2
  85. hatchet_sdk/v0/__init__.py +251 -0
  86. hatchet_sdk/v0/client.py +119 -0
  87. hatchet_sdk/v0/clients/admin.py +541 -0
  88. hatchet_sdk/v0/clients/dispatcher/action_listener.py +422 -0
  89. hatchet_sdk/v0/clients/dispatcher/dispatcher.py +204 -0
  90. hatchet_sdk/v0/clients/event_ts.py +28 -0
  91. hatchet_sdk/v0/clients/events.py +182 -0
  92. hatchet_sdk/v0/clients/rest/__init__.py +307 -0
  93. hatchet_sdk/v0/clients/rest/api/__init__.py +19 -0
  94. hatchet_sdk/v0/clients/rest/api/api_token_api.py +858 -0
  95. hatchet_sdk/v0/clients/rest/api/default_api.py +2259 -0
  96. hatchet_sdk/v0/clients/rest/api/event_api.py +2548 -0
  97. hatchet_sdk/v0/clients/rest/api/github_api.py +331 -0
  98. hatchet_sdk/v0/clients/rest/api/healthcheck_api.py +483 -0
  99. hatchet_sdk/v0/clients/rest/api/log_api.py +449 -0
  100. hatchet_sdk/v0/clients/rest/api/metadata_api.py +728 -0
  101. hatchet_sdk/v0/clients/rest/api/rate_limits_api.py +423 -0
  102. hatchet_sdk/v0/clients/rest/api/slack_api.py +577 -0
  103. hatchet_sdk/v0/clients/rest/api/sns_api.py +872 -0
  104. hatchet_sdk/v0/clients/rest/api/step_run_api.py +2202 -0
  105. hatchet_sdk/v0/clients/rest/api/tenant_api.py +4430 -0
  106. hatchet_sdk/v0/clients/rest/api/user_api.py +2888 -0
  107. hatchet_sdk/v0/clients/rest/api/worker_api.py +858 -0
  108. hatchet_sdk/v0/clients/rest/api/workflow_api.py +6312 -0
  109. hatchet_sdk/v0/clients/rest/api/workflow_run_api.py +1932 -0
  110. hatchet_sdk/v0/clients/rest/api/workflow_runs_api.py +610 -0
  111. hatchet_sdk/v0/clients/rest/api_client.py +759 -0
  112. hatchet_sdk/v0/clients/rest/api_response.py +22 -0
  113. hatchet_sdk/v0/clients/rest/configuration.py +611 -0
  114. hatchet_sdk/v0/clients/rest/exceptions.py +200 -0
  115. hatchet_sdk/v0/clients/rest/models/__init__.py +274 -0
  116. hatchet_sdk/v0/clients/rest/models/accept_invite_request.py +83 -0
  117. hatchet_sdk/v0/clients/rest/models/api_error.py +102 -0
  118. hatchet_sdk/v0/clients/rest/models/api_errors.py +100 -0
  119. hatchet_sdk/v0/clients/rest/models/api_meta.py +144 -0
  120. hatchet_sdk/v0/clients/rest/models/api_meta_auth.py +85 -0
  121. hatchet_sdk/v0/clients/rest/models/api_meta_integration.py +88 -0
  122. hatchet_sdk/v0/clients/rest/models/api_meta_posthog.py +90 -0
  123. hatchet_sdk/v0/clients/rest/models/api_resource_meta.py +98 -0
  124. hatchet_sdk/v0/clients/rest/models/api_token.py +105 -0
  125. hatchet_sdk/v0/clients/rest/models/bulk_create_event_request.py +100 -0
  126. hatchet_sdk/v0/clients/rest/models/bulk_create_event_response.py +110 -0
  127. hatchet_sdk/v0/clients/rest/models/cancel_event_request.py +85 -0
  128. hatchet_sdk/v0/clients/rest/models/cancel_step_run_request.py +83 -0
  129. hatchet_sdk/v0/clients/rest/models/concurrency_limit_strategy.py +39 -0
  130. hatchet_sdk/v0/clients/rest/models/create_api_token_request.py +92 -0
  131. hatchet_sdk/v0/clients/rest/models/create_api_token_response.py +83 -0
  132. hatchet_sdk/v0/clients/rest/models/create_cron_workflow_trigger_request.py +98 -0
  133. hatchet_sdk/v0/clients/rest/models/create_event_request.py +95 -0
  134. hatchet_sdk/v0/clients/rest/models/create_pull_request_from_step_run.py +83 -0
  135. hatchet_sdk/v0/clients/rest/models/create_sns_integration_request.py +85 -0
  136. hatchet_sdk/v0/clients/rest/models/create_tenant_alert_email_group_request.py +83 -0
  137. hatchet_sdk/v0/clients/rest/models/create_tenant_invite_request.py +86 -0
  138. hatchet_sdk/v0/clients/rest/models/create_tenant_request.py +84 -0
  139. hatchet_sdk/v0/clients/rest/models/cron_workflows.py +131 -0
  140. hatchet_sdk/v0/clients/rest/models/cron_workflows_list.py +110 -0
  141. hatchet_sdk/v0/clients/rest/models/cron_workflows_method.py +37 -0
  142. hatchet_sdk/v0/clients/rest/models/cron_workflows_order_by_field.py +37 -0
  143. hatchet_sdk/v0/clients/rest/models/event.py +143 -0
  144. hatchet_sdk/v0/clients/rest/models/event_data.py +83 -0
  145. hatchet_sdk/v0/clients/rest/models/event_key_list.py +98 -0
  146. hatchet_sdk/v0/clients/rest/models/event_list.py +110 -0
  147. hatchet_sdk/v0/clients/rest/models/event_order_by_direction.py +37 -0
  148. hatchet_sdk/v0/clients/rest/models/event_order_by_field.py +36 -0
  149. hatchet_sdk/v0/clients/rest/models/event_update_cancel200_response.py +85 -0
  150. hatchet_sdk/v0/clients/rest/models/event_workflow_run_summary.py +116 -0
  151. hatchet_sdk/v0/clients/rest/models/events.py +110 -0
  152. hatchet_sdk/v0/clients/rest/models/get_step_run_diff_response.py +100 -0
  153. hatchet_sdk/v0/clients/rest/models/github_app_installation.py +107 -0
  154. hatchet_sdk/v0/clients/rest/models/github_branch.py +86 -0
  155. hatchet_sdk/v0/clients/rest/models/github_repo.py +86 -0
  156. hatchet_sdk/v0/clients/rest/models/info_get_version200_response.py +83 -0
  157. hatchet_sdk/v0/clients/rest/models/job.py +132 -0
  158. hatchet_sdk/v0/clients/rest/models/job_run.py +176 -0
  159. hatchet_sdk/v0/clients/rest/models/job_run_status.py +41 -0
  160. hatchet_sdk/v0/clients/rest/models/link_github_repository_request.py +106 -0
  161. hatchet_sdk/v0/clients/rest/models/list_api_tokens_response.py +110 -0
  162. hatchet_sdk/v0/clients/rest/models/list_github_app_installations_response.py +112 -0
  163. hatchet_sdk/v0/clients/rest/models/list_pull_requests_response.py +100 -0
  164. hatchet_sdk/v0/clients/rest/models/list_slack_webhooks.py +110 -0
  165. hatchet_sdk/v0/clients/rest/models/list_sns_integrations.py +110 -0
  166. hatchet_sdk/v0/clients/rest/models/log_line.py +94 -0
  167. hatchet_sdk/v0/clients/rest/models/log_line_level.py +39 -0
  168. hatchet_sdk/v0/clients/rest/models/log_line_list.py +110 -0
  169. hatchet_sdk/v0/clients/rest/models/log_line_order_by_direction.py +37 -0
  170. hatchet_sdk/v0/clients/rest/models/log_line_order_by_field.py +36 -0
  171. hatchet_sdk/v0/clients/rest/models/pagination_response.py +95 -0
  172. hatchet_sdk/v0/clients/rest/models/pull_request.py +112 -0
  173. hatchet_sdk/v0/clients/rest/models/pull_request_state.py +37 -0
  174. hatchet_sdk/v0/clients/rest/models/queue_metrics.py +97 -0
  175. hatchet_sdk/v0/clients/rest/models/rate_limit.py +117 -0
  176. hatchet_sdk/v0/clients/rest/models/rate_limit_list.py +110 -0
  177. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_direction.py +37 -0
  178. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_field.py +38 -0
  179. hatchet_sdk/v0/clients/rest/models/recent_step_runs.py +118 -0
  180. hatchet_sdk/v0/clients/rest/models/reject_invite_request.py +83 -0
  181. hatchet_sdk/v0/clients/rest/models/replay_event_request.py +85 -0
  182. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_request.py +85 -0
  183. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_response.py +100 -0
  184. hatchet_sdk/v0/clients/rest/models/rerun_step_run_request.py +83 -0
  185. hatchet_sdk/v0/clients/rest/models/schedule_workflow_run_request.py +92 -0
  186. hatchet_sdk/v0/clients/rest/models/scheduled_run_status.py +42 -0
  187. hatchet_sdk/v0/clients/rest/models/scheduled_workflows.py +149 -0
  188. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_list.py +110 -0
  189. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_method.py +37 -0
  190. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_order_by_field.py +37 -0
  191. hatchet_sdk/v0/clients/rest/models/semaphore_slots.py +113 -0
  192. hatchet_sdk/v0/clients/rest/models/slack_webhook.py +127 -0
  193. hatchet_sdk/v0/clients/rest/models/sns_integration.py +114 -0
  194. hatchet_sdk/v0/clients/rest/models/step.py +123 -0
  195. hatchet_sdk/v0/clients/rest/models/step_run.py +202 -0
  196. hatchet_sdk/v0/clients/rest/models/step_run_archive.py +142 -0
  197. hatchet_sdk/v0/clients/rest/models/step_run_archive_list.py +110 -0
  198. hatchet_sdk/v0/clients/rest/models/step_run_diff.py +91 -0
  199. hatchet_sdk/v0/clients/rest/models/step_run_event.py +122 -0
  200. hatchet_sdk/v0/clients/rest/models/step_run_event_list.py +110 -0
  201. hatchet_sdk/v0/clients/rest/models/step_run_event_reason.py +52 -0
  202. hatchet_sdk/v0/clients/rest/models/step_run_event_severity.py +38 -0
  203. hatchet_sdk/v0/clients/rest/models/step_run_status.py +44 -0
  204. hatchet_sdk/v0/clients/rest/models/tenant.py +118 -0
  205. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group.py +98 -0
  206. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group_list.py +112 -0
  207. hatchet_sdk/v0/clients/rest/models/tenant_alerting_settings.py +143 -0
  208. hatchet_sdk/v0/clients/rest/models/tenant_invite.py +120 -0
  209. hatchet_sdk/v0/clients/rest/models/tenant_invite_list.py +110 -0
  210. hatchet_sdk/v0/clients/rest/models/tenant_list.py +110 -0
  211. hatchet_sdk/v0/clients/rest/models/tenant_member.py +123 -0
  212. hatchet_sdk/v0/clients/rest/models/tenant_member_list.py +110 -0
  213. hatchet_sdk/v0/clients/rest/models/tenant_member_role.py +38 -0
  214. hatchet_sdk/v0/clients/rest/models/tenant_queue_metrics.py +116 -0
  215. hatchet_sdk/v0/clients/rest/models/tenant_resource.py +40 -0
  216. hatchet_sdk/v0/clients/rest/models/tenant_resource_limit.py +135 -0
  217. hatchet_sdk/v0/clients/rest/models/tenant_resource_policy.py +102 -0
  218. hatchet_sdk/v0/clients/rest/models/tenant_step_run_queue_metrics.py +83 -0
  219. hatchet_sdk/v0/clients/rest/models/trigger_workflow_run_request.py +91 -0
  220. hatchet_sdk/v0/clients/rest/models/update_tenant_alert_email_group_request.py +83 -0
  221. hatchet_sdk/v0/clients/rest/models/update_tenant_invite_request.py +85 -0
  222. hatchet_sdk/v0/clients/rest/models/update_tenant_request.py +137 -0
  223. hatchet_sdk/v0/clients/rest/models/update_worker_request.py +87 -0
  224. hatchet_sdk/v0/clients/rest/models/user.py +126 -0
  225. hatchet_sdk/v0/clients/rest/models/user_change_password_request.py +88 -0
  226. hatchet_sdk/v0/clients/rest/models/user_login_request.py +86 -0
  227. hatchet_sdk/v0/clients/rest/models/user_register_request.py +91 -0
  228. hatchet_sdk/v0/clients/rest/models/user_tenant_memberships_list.py +110 -0
  229. hatchet_sdk/v0/clients/rest/models/user_tenant_public.py +86 -0
  230. hatchet_sdk/v0/clients/rest/models/webhook_worker.py +100 -0
  231. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_request.py +94 -0
  232. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_response.py +98 -0
  233. hatchet_sdk/v0/clients/rest/models/webhook_worker_created.py +102 -0
  234. hatchet_sdk/v0/clients/rest/models/webhook_worker_list_response.py +110 -0
  235. hatchet_sdk/v0/clients/rest/models/webhook_worker_request.py +102 -0
  236. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_list_response.py +104 -0
  237. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_method.py +38 -0
  238. hatchet_sdk/v0/clients/rest/models/worker.py +239 -0
  239. hatchet_sdk/v0/clients/rest/models/worker_label.py +102 -0
  240. hatchet_sdk/v0/clients/rest/models/worker_list.py +110 -0
  241. hatchet_sdk/v0/clients/rest/models/worker_runtime_info.py +103 -0
  242. hatchet_sdk/v0/clients/rest/models/worker_runtime_sdks.py +38 -0
  243. hatchet_sdk/v0/clients/rest/models/worker_type.py +38 -0
  244. hatchet_sdk/v0/clients/rest/models/workflow.py +165 -0
  245. hatchet_sdk/v0/clients/rest/models/workflow_concurrency.py +107 -0
  246. hatchet_sdk/v0/clients/rest/models/workflow_deployment_config.py +136 -0
  247. hatchet_sdk/v0/clients/rest/models/workflow_kind.py +38 -0
  248. hatchet_sdk/v0/clients/rest/models/workflow_list.py +120 -0
  249. hatchet_sdk/v0/clients/rest/models/workflow_metrics.py +97 -0
  250. hatchet_sdk/v0/clients/rest/models/workflow_run.py +188 -0
  251. hatchet_sdk/v0/clients/rest/models/workflow_run_cancel200_response.py +85 -0
  252. hatchet_sdk/v0/clients/rest/models/workflow_run_list.py +110 -0
  253. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_direction.py +37 -0
  254. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_field.py +39 -0
  255. hatchet_sdk/v0/clients/rest/models/workflow_run_shape.py +186 -0
  256. hatchet_sdk/v0/clients/rest/models/workflow_run_status.py +42 -0
  257. hatchet_sdk/v0/clients/rest/models/workflow_run_triggered_by.py +112 -0
  258. hatchet_sdk/v0/clients/rest/models/workflow_runs_cancel_request.py +85 -0
  259. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics.py +94 -0
  260. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics_counts.py +104 -0
  261. hatchet_sdk/v0/clients/rest/models/workflow_tag.py +84 -0
  262. hatchet_sdk/v0/clients/rest/models/workflow_trigger_cron_ref.py +86 -0
  263. hatchet_sdk/v0/clients/rest/models/workflow_trigger_event_ref.py +86 -0
  264. hatchet_sdk/v0/clients/rest/models/workflow_triggers.py +141 -0
  265. hatchet_sdk/v0/clients/rest/models/workflow_update_request.py +85 -0
  266. hatchet_sdk/v0/clients/rest/models/workflow_version.py +170 -0
  267. hatchet_sdk/v0/clients/rest/models/workflow_version_concurrency.py +114 -0
  268. hatchet_sdk/v0/clients/rest/models/workflow_version_definition.py +85 -0
  269. hatchet_sdk/v0/clients/rest/models/workflow_version_meta.py +123 -0
  270. hatchet_sdk/v0/clients/rest/models/workflow_workers_count.py +95 -0
  271. hatchet_sdk/v0/clients/rest/rest.py +187 -0
  272. hatchet_sdk/v0/clients/rest/tenacity_utils.py +39 -0
  273. hatchet_sdk/v0/clients/rest_client.py +622 -0
  274. hatchet_sdk/v0/clients/run_event_listener.py +260 -0
  275. hatchet_sdk/v0/clients/workflow_listener.py +277 -0
  276. hatchet_sdk/v0/connection.py +63 -0
  277. hatchet_sdk/v0/context/__init__.py +1 -0
  278. hatchet_sdk/v0/context/context.py +446 -0
  279. hatchet_sdk/v0/context/worker_context.py +28 -0
  280. hatchet_sdk/v0/contracts/dispatcher_pb2.py +102 -0
  281. hatchet_sdk/v0/contracts/dispatcher_pb2.pyi +387 -0
  282. hatchet_sdk/v0/contracts/dispatcher_pb2_grpc.py +621 -0
  283. hatchet_sdk/v0/contracts/events_pb2.py +46 -0
  284. hatchet_sdk/v0/contracts/events_pb2.pyi +87 -0
  285. hatchet_sdk/v0/contracts/events_pb2_grpc.py +274 -0
  286. hatchet_sdk/v0/contracts/workflows_pb2.py +80 -0
  287. hatchet_sdk/v0/contracts/workflows_pb2.pyi +312 -0
  288. hatchet_sdk/v0/contracts/workflows_pb2_grpc.py +277 -0
  289. hatchet_sdk/v0/features/cron.py +286 -0
  290. hatchet_sdk/v0/features/scheduled.py +248 -0
  291. hatchet_sdk/v0/hatchet.py +310 -0
  292. hatchet_sdk/v0/labels.py +10 -0
  293. hatchet_sdk/v0/logger.py +13 -0
  294. hatchet_sdk/v0/metadata.py +2 -0
  295. hatchet_sdk/v0/opentelemetry/instrumentor.py +396 -0
  296. hatchet_sdk/v0/rate_limit.py +126 -0
  297. hatchet_sdk/v0/token.py +27 -0
  298. hatchet_sdk/v0/utils/aio_utils.py +137 -0
  299. hatchet_sdk/v0/utils/backoff.py +9 -0
  300. hatchet_sdk/v0/utils/typing.py +12 -0
  301. hatchet_sdk/{v2 → v0/v2}/callable.py +8 -8
  302. hatchet_sdk/{v2 → v0/v2}/concurrency.py +2 -2
  303. hatchet_sdk/{v2 → v0/v2}/hatchet.py +10 -10
  304. hatchet_sdk/v0/worker/__init__.py +1 -0
  305. hatchet_sdk/v0/worker/action_listener_process.py +294 -0
  306. hatchet_sdk/v0/worker/runner/run_loop_manager.py +112 -0
  307. hatchet_sdk/v0/worker/runner/runner.py +460 -0
  308. hatchet_sdk/v0/worker/runner/utils/capture_logs.py +81 -0
  309. hatchet_sdk/v0/worker/worker.py +391 -0
  310. hatchet_sdk/{workflow.py → v0/workflow.py} +4 -4
  311. hatchet_sdk/v0/workflow_run.py +59 -0
  312. hatchet_sdk/waits.py +120 -0
  313. hatchet_sdk/worker/__init__.py +0 -1
  314. hatchet_sdk/worker/action_listener_process.py +80 -55
  315. hatchet_sdk/worker/runner/run_loop_manager.py +46 -34
  316. hatchet_sdk/worker/runner/runner.py +82 -87
  317. hatchet_sdk/worker/runner/utils/capture_logs.py +26 -23
  318. hatchet_sdk/worker/worker.py +172 -149
  319. hatchet_sdk/workflow_run.py +7 -21
  320. {hatchet_sdk-0.47.1.dist-info → hatchet_sdk-1.0.0a1.dist-info}/METADATA +2 -2
  321. hatchet_sdk-1.0.0a1.dist-info/RECORD +505 -0
  322. {hatchet_sdk-0.47.1.dist-info → hatchet_sdk-1.0.0a1.dist-info}/entry_points.txt +2 -0
  323. hatchet_sdk/utils/serialization.py +0 -18
  324. hatchet_sdk-0.47.1.dist-info/RECORD +0 -237
  325. /hatchet_sdk/{loader.py → v0/loader.py} +0 -0
  326. /hatchet_sdk/{semver.py → v0/semver.py} +0 -0
  327. /hatchet_sdk/{utils → v0/utils}/types.py +0 -0
  328. /hatchet_sdk/{worker → v0/worker}/runner/utils/error_with_traceback.py +0 -0
  329. {hatchet_sdk-0.47.1.dist-info → hatchet_sdk-1.0.0a1.dist-info}/WHEEL +0 -0
@@ -12,18 +12,23 @@
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,
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_trigger_workflow_run_request import (
27
+ V1TriggerWorkflowRunRequest,
24
28
  )
25
- from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import (
26
- ReplayWorkflowRunsResponse,
29
+ from hatchet_sdk.clients.rest.models.v1_workflow_run_details import V1WorkflowRunDetails
30
+ from hatchet_sdk.clients.rest.models.v1_workflow_run_display_name_list import (
31
+ V1WorkflowRunDisplayNameList,
27
32
  )
28
33
  from hatchet_sdk.clients.rest.rest import RESTResponseType
29
34
 
@@ -41,17 +46,17 @@ class WorkflowRunsApi:
41
46
  self.api_client = api_client
42
47
 
43
48
  @validate_call
44
- async def workflow_run_get_input(
49
+ async def v1_workflow_run_create(
45
50
  self,
46
- workflow_run: Annotated[
51
+ tenant: Annotated[
47
52
  str,
48
53
  Field(
49
- min_length=36,
50
- strict=True,
51
- max_length=36,
52
- description="The workflow run id",
54
+ min_length=36, strict=True, max_length=36, description="The tenant id"
53
55
  ),
54
56
  ],
57
+ v1_trigger_workflow_run_request: Annotated[
58
+ V1TriggerWorkflowRunRequest, Field(description="The workflow run to create")
59
+ ],
55
60
  _request_timeout: Union[
56
61
  None,
57
62
  Annotated[StrictFloat, Field(gt=0)],
@@ -63,13 +68,15 @@ class WorkflowRunsApi:
63
68
  _content_type: Optional[StrictStr] = None,
64
69
  _headers: Optional[Dict[StrictStr, Any]] = None,
65
70
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
66
- ) -> Dict[str, object]:
67
- """Get workflow run input
71
+ ) -> V1WorkflowRunDetails:
72
+ """Create workflow run
68
73
 
69
- Get the input for a workflow run.
74
+ Trigger a new workflow run
70
75
 
71
- :param workflow_run: The workflow run id (required)
72
- :type workflow_run: str
76
+ :param tenant: The tenant id (required)
77
+ :type tenant: str
78
+ :param v1_trigger_workflow_run_request: The workflow run to create (required)
79
+ :type v1_trigger_workflow_run_request: V1TriggerWorkflowRunRequest
73
80
  :param _request_timeout: timeout setting for this request. If one
74
81
  number provided, it will be total request
75
82
  timeout. It can also be a pair (tuple) of
@@ -92,8 +99,9 @@ class WorkflowRunsApi:
92
99
  :return: Returns the result object.
93
100
  """ # noqa: E501
94
101
 
95
- _param = self._workflow_run_get_input_serialize(
96
- workflow_run=workflow_run,
102
+ _param = self._v1_workflow_run_create_serialize(
103
+ tenant=tenant,
104
+ v1_trigger_workflow_run_request=v1_trigger_workflow_run_request,
97
105
  _request_auth=_request_auth,
98
106
  _content_type=_content_type,
99
107
  _headers=_headers,
@@ -101,10 +109,9 @@ class WorkflowRunsApi:
101
109
  )
102
110
 
103
111
  _response_types_map: Dict[str, Optional[str]] = {
104
- "200": "Dict[str, object]",
112
+ "200": "V1WorkflowRunDetails",
105
113
  "400": "APIErrors",
106
114
  "403": "APIErrors",
107
- "404": "APIErrors",
108
115
  }
109
116
  response_data = await self.api_client.call_api(
110
117
  *_param, _request_timeout=_request_timeout
@@ -116,17 +123,17 @@ class WorkflowRunsApi:
116
123
  ).data
117
124
 
118
125
  @validate_call
119
- async def workflow_run_get_input_with_http_info(
126
+ async def v1_workflow_run_create_with_http_info(
120
127
  self,
121
- workflow_run: Annotated[
128
+ tenant: Annotated[
122
129
  str,
123
130
  Field(
124
- min_length=36,
125
- strict=True,
126
- max_length=36,
127
- description="The workflow run id",
131
+ min_length=36, strict=True, max_length=36, description="The tenant id"
128
132
  ),
129
133
  ],
134
+ v1_trigger_workflow_run_request: Annotated[
135
+ V1TriggerWorkflowRunRequest, Field(description="The workflow run to create")
136
+ ],
130
137
  _request_timeout: Union[
131
138
  None,
132
139
  Annotated[StrictFloat, Field(gt=0)],
@@ -138,13 +145,15 @@ class WorkflowRunsApi:
138
145
  _content_type: Optional[StrictStr] = None,
139
146
  _headers: Optional[Dict[StrictStr, Any]] = None,
140
147
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
141
- ) -> ApiResponse[Dict[str, object]]:
142
- """Get workflow run input
148
+ ) -> ApiResponse[V1WorkflowRunDetails]:
149
+ """Create workflow run
143
150
 
144
- Get the input for a workflow run.
151
+ Trigger a new workflow run
145
152
 
146
- :param workflow_run: The workflow run id (required)
147
- :type workflow_run: str
153
+ :param tenant: The tenant id (required)
154
+ :type tenant: str
155
+ :param v1_trigger_workflow_run_request: The workflow run to create (required)
156
+ :type v1_trigger_workflow_run_request: V1TriggerWorkflowRunRequest
148
157
  :param _request_timeout: timeout setting for this request. If one
149
158
  number provided, it will be total request
150
159
  timeout. It can also be a pair (tuple) of
@@ -167,8 +176,9 @@ class WorkflowRunsApi:
167
176
  :return: Returns the result object.
168
177
  """ # noqa: E501
169
178
 
170
- _param = self._workflow_run_get_input_serialize(
171
- workflow_run=workflow_run,
179
+ _param = self._v1_workflow_run_create_serialize(
180
+ tenant=tenant,
181
+ v1_trigger_workflow_run_request=v1_trigger_workflow_run_request,
172
182
  _request_auth=_request_auth,
173
183
  _content_type=_content_type,
174
184
  _headers=_headers,
@@ -176,10 +186,9 @@ class WorkflowRunsApi:
176
186
  )
177
187
 
178
188
  _response_types_map: Dict[str, Optional[str]] = {
179
- "200": "Dict[str, object]",
189
+ "200": "V1WorkflowRunDetails",
180
190
  "400": "APIErrors",
181
191
  "403": "APIErrors",
182
- "404": "APIErrors",
183
192
  }
184
193
  response_data = await self.api_client.call_api(
185
194
  *_param, _request_timeout=_request_timeout
@@ -191,17 +200,17 @@ class WorkflowRunsApi:
191
200
  )
192
201
 
193
202
  @validate_call
194
- async def workflow_run_get_input_without_preload_content(
203
+ async def v1_workflow_run_create_without_preload_content(
195
204
  self,
196
- workflow_run: Annotated[
205
+ tenant: Annotated[
197
206
  str,
198
207
  Field(
199
- min_length=36,
200
- strict=True,
201
- max_length=36,
202
- description="The workflow run id",
208
+ min_length=36, strict=True, max_length=36, description="The tenant id"
203
209
  ),
204
210
  ],
211
+ v1_trigger_workflow_run_request: Annotated[
212
+ V1TriggerWorkflowRunRequest, Field(description="The workflow run to create")
213
+ ],
205
214
  _request_timeout: Union[
206
215
  None,
207
216
  Annotated[StrictFloat, Field(gt=0)],
@@ -214,12 +223,14 @@ class WorkflowRunsApi:
214
223
  _headers: Optional[Dict[StrictStr, Any]] = None,
215
224
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
216
225
  ) -> RESTResponseType:
217
- """Get workflow run input
226
+ """Create workflow run
218
227
 
219
- Get the input for a workflow run.
228
+ Trigger a new workflow run
220
229
 
221
- :param workflow_run: The workflow run id (required)
222
- :type workflow_run: str
230
+ :param tenant: The tenant id (required)
231
+ :type tenant: str
232
+ :param v1_trigger_workflow_run_request: The workflow run to create (required)
233
+ :type v1_trigger_workflow_run_request: V1TriggerWorkflowRunRequest
223
234
  :param _request_timeout: timeout setting for this request. If one
224
235
  number provided, it will be total request
225
236
  timeout. It can also be a pair (tuple) of
@@ -242,8 +253,9 @@ class WorkflowRunsApi:
242
253
  :return: Returns the result object.
243
254
  """ # noqa: E501
244
255
 
245
- _param = self._workflow_run_get_input_serialize(
246
- workflow_run=workflow_run,
256
+ _param = self._v1_workflow_run_create_serialize(
257
+ tenant=tenant,
258
+ v1_trigger_workflow_run_request=v1_trigger_workflow_run_request,
247
259
  _request_auth=_request_auth,
248
260
  _content_type=_content_type,
249
261
  _headers=_headers,
@@ -251,19 +263,19 @@ class WorkflowRunsApi:
251
263
  )
252
264
 
253
265
  _response_types_map: Dict[str, Optional[str]] = {
254
- "200": "Dict[str, object]",
266
+ "200": "V1WorkflowRunDetails",
255
267
  "400": "APIErrors",
256
268
  "403": "APIErrors",
257
- "404": "APIErrors",
258
269
  }
259
270
  response_data = await self.api_client.call_api(
260
271
  *_param, _request_timeout=_request_timeout
261
272
  )
262
273
  return response_data.response
263
274
 
264
- def _workflow_run_get_input_serialize(
275
+ def _v1_workflow_run_create_serialize(
265
276
  self,
266
- workflow_run,
277
+ tenant,
278
+ v1_trigger_workflow_run_request,
267
279
  _request_auth,
268
280
  _content_type,
269
281
  _headers,
@@ -278,28 +290,43 @@ class WorkflowRunsApi:
278
290
  _query_params: List[Tuple[str, str]] = []
279
291
  _header_params: Dict[str, Optional[str]] = _headers or {}
280
292
  _form_params: List[Tuple[str, str]] = []
281
- _files: Dict[str, Union[str, bytes]] = {}
293
+ _files: Dict[
294
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
295
+ ] = {}
282
296
  _body_params: Optional[bytes] = None
283
297
 
284
298
  # process the path parameters
285
- if workflow_run is not None:
286
- _path_params["workflow-run"] = workflow_run
299
+ if tenant is not None:
300
+ _path_params["tenant"] = tenant
287
301
  # process the query parameters
288
302
  # process the header parameters
289
303
  # process the form parameters
290
304
  # process the body parameter
305
+ if v1_trigger_workflow_run_request is not None:
306
+ _body_params = v1_trigger_workflow_run_request
291
307
 
292
308
  # set the HTTP header `Accept`
293
- _header_params["Accept"] = self.api_client.select_header_accept(
294
- ["application/json"]
295
- )
309
+ if "Accept" not in _header_params:
310
+ _header_params["Accept"] = self.api_client.select_header_accept(
311
+ ["application/json"]
312
+ )
313
+
314
+ # set the HTTP header `Content-Type`
315
+ if _content_type:
316
+ _header_params["Content-Type"] = _content_type
317
+ else:
318
+ _default_content_type = self.api_client.select_header_content_type(
319
+ ["application/json"]
320
+ )
321
+ if _default_content_type is not None:
322
+ _header_params["Content-Type"] = _default_content_type
296
323
 
297
324
  # authentication setting
298
325
  _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
299
326
 
300
327
  return self.api_client.param_serialize(
301
- method="GET",
302
- resource_path="/api/v1/workflow-runs/{workflow-run}/input",
328
+ method="POST",
329
+ resource_path="/api/v1/stable/tenants/{tenant}/workflow-runs/trigger",
303
330
  path_params=_path_params,
304
331
  query_params=_query_params,
305
332
  header_params=_header_params,
@@ -313,7 +340,7 @@ class WorkflowRunsApi:
313
340
  )
314
341
 
315
342
  @validate_call
316
- async def workflow_run_update_replay(
343
+ async def v1_workflow_run_display_names_list(
317
344
  self,
318
345
  tenant: Annotated[
319
346
  str,
@@ -321,9 +348,11 @@ class WorkflowRunsApi:
321
348
  min_length=36, strict=True, max_length=36, description="The tenant id"
322
349
  ),
323
350
  ],
324
- replay_workflow_runs_request: Annotated[
325
- ReplayWorkflowRunsRequest,
326
- Field(description="The workflow run ids to replay"),
351
+ external_ids: Annotated[
352
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
353
+ Field(
354
+ description="The external ids of the workflow runs to get display names for"
355
+ ),
327
356
  ],
328
357
  _request_timeout: Union[
329
358
  None,
@@ -336,15 +365,15 @@ class WorkflowRunsApi:
336
365
  _content_type: Optional[StrictStr] = None,
337
366
  _headers: Optional[Dict[StrictStr, Any]] = None,
338
367
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
339
- ) -> ReplayWorkflowRunsResponse:
340
- """Replay workflow runs
368
+ ) -> V1WorkflowRunDisplayNameList:
369
+ """List workflow runs
341
370
 
342
- Replays a list of workflow runs.
371
+ Lists displayable names of workflow runs for a tenant
343
372
 
344
373
  :param tenant: The tenant id (required)
345
374
  :type tenant: str
346
- :param replay_workflow_runs_request: The workflow run ids to replay (required)
347
- :type replay_workflow_runs_request: ReplayWorkflowRunsRequest
375
+ :param external_ids: The external ids of the workflow runs to get display names for (required)
376
+ :type external_ids: List[str]
348
377
  :param _request_timeout: timeout setting for this request. If one
349
378
  number provided, it will be total request
350
379
  timeout. It can also be a pair (tuple) of
@@ -367,9 +396,9 @@ class WorkflowRunsApi:
367
396
  :return: Returns the result object.
368
397
  """ # noqa: E501
369
398
 
370
- _param = self._workflow_run_update_replay_serialize(
399
+ _param = self._v1_workflow_run_display_names_list_serialize(
371
400
  tenant=tenant,
372
- replay_workflow_runs_request=replay_workflow_runs_request,
401
+ external_ids=external_ids,
373
402
  _request_auth=_request_auth,
374
403
  _content_type=_content_type,
375
404
  _headers=_headers,
@@ -377,10 +406,10 @@ class WorkflowRunsApi:
377
406
  )
378
407
 
379
408
  _response_types_map: Dict[str, Optional[str]] = {
380
- "200": "ReplayWorkflowRunsResponse",
409
+ "200": "V1WorkflowRunDisplayNameList",
381
410
  "400": "APIErrors",
382
411
  "403": "APIErrors",
383
- "429": "APIErrors",
412
+ "501": "APIErrors",
384
413
  }
385
414
  response_data = await self.api_client.call_api(
386
415
  *_param, _request_timeout=_request_timeout
@@ -392,7 +421,7 @@ class WorkflowRunsApi:
392
421
  ).data
393
422
 
394
423
  @validate_call
395
- async def workflow_run_update_replay_with_http_info(
424
+ async def v1_workflow_run_display_names_list_with_http_info(
396
425
  self,
397
426
  tenant: Annotated[
398
427
  str,
@@ -400,9 +429,11 @@ class WorkflowRunsApi:
400
429
  min_length=36, strict=True, max_length=36, description="The tenant id"
401
430
  ),
402
431
  ],
403
- replay_workflow_runs_request: Annotated[
404
- ReplayWorkflowRunsRequest,
405
- Field(description="The workflow run ids to replay"),
432
+ external_ids: Annotated[
433
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
434
+ Field(
435
+ description="The external ids of the workflow runs to get display names for"
436
+ ),
406
437
  ],
407
438
  _request_timeout: Union[
408
439
  None,
@@ -415,15 +446,15 @@ class WorkflowRunsApi:
415
446
  _content_type: Optional[StrictStr] = None,
416
447
  _headers: Optional[Dict[StrictStr, Any]] = None,
417
448
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
418
- ) -> ApiResponse[ReplayWorkflowRunsResponse]:
419
- """Replay workflow runs
449
+ ) -> ApiResponse[V1WorkflowRunDisplayNameList]:
450
+ """List workflow runs
420
451
 
421
- Replays a list of workflow runs.
452
+ Lists displayable names of workflow runs for a tenant
422
453
 
423
454
  :param tenant: The tenant id (required)
424
455
  :type tenant: str
425
- :param replay_workflow_runs_request: The workflow run ids to replay (required)
426
- :type replay_workflow_runs_request: ReplayWorkflowRunsRequest
456
+ :param external_ids: The external ids of the workflow runs to get display names for (required)
457
+ :type external_ids: List[str]
427
458
  :param _request_timeout: timeout setting for this request. If one
428
459
  number provided, it will be total request
429
460
  timeout. It can also be a pair (tuple) of
@@ -446,9 +477,9 @@ class WorkflowRunsApi:
446
477
  :return: Returns the result object.
447
478
  """ # noqa: E501
448
479
 
449
- _param = self._workflow_run_update_replay_serialize(
480
+ _param = self._v1_workflow_run_display_names_list_serialize(
450
481
  tenant=tenant,
451
- replay_workflow_runs_request=replay_workflow_runs_request,
482
+ external_ids=external_ids,
452
483
  _request_auth=_request_auth,
453
484
  _content_type=_content_type,
454
485
  _headers=_headers,
@@ -456,10 +487,10 @@ class WorkflowRunsApi:
456
487
  )
457
488
 
458
489
  _response_types_map: Dict[str, Optional[str]] = {
459
- "200": "ReplayWorkflowRunsResponse",
490
+ "200": "V1WorkflowRunDisplayNameList",
460
491
  "400": "APIErrors",
461
492
  "403": "APIErrors",
462
- "429": "APIErrors",
493
+ "501": "APIErrors",
463
494
  }
464
495
  response_data = await self.api_client.call_api(
465
496
  *_param, _request_timeout=_request_timeout
@@ -471,7 +502,7 @@ class WorkflowRunsApi:
471
502
  )
472
503
 
473
504
  @validate_call
474
- async def workflow_run_update_replay_without_preload_content(
505
+ async def v1_workflow_run_display_names_list_without_preload_content(
475
506
  self,
476
507
  tenant: Annotated[
477
508
  str,
@@ -479,9 +510,11 @@ class WorkflowRunsApi:
479
510
  min_length=36, strict=True, max_length=36, description="The tenant id"
480
511
  ),
481
512
  ],
482
- replay_workflow_runs_request: Annotated[
483
- ReplayWorkflowRunsRequest,
484
- Field(description="The workflow run ids to replay"),
513
+ external_ids: Annotated[
514
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
515
+ Field(
516
+ description="The external ids of the workflow runs to get display names for"
517
+ ),
485
518
  ],
486
519
  _request_timeout: Union[
487
520
  None,
@@ -495,14 +528,14 @@ class WorkflowRunsApi:
495
528
  _headers: Optional[Dict[StrictStr, Any]] = None,
496
529
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
497
530
  ) -> RESTResponseType:
498
- """Replay workflow runs
531
+ """List workflow runs
499
532
 
500
- Replays a list of workflow runs.
533
+ Lists displayable names of workflow runs for a tenant
501
534
 
502
535
  :param tenant: The tenant id (required)
503
536
  :type tenant: str
504
- :param replay_workflow_runs_request: The workflow run ids to replay (required)
505
- :type replay_workflow_runs_request: ReplayWorkflowRunsRequest
537
+ :param external_ids: The external ids of the workflow runs to get display names for (required)
538
+ :type external_ids: List[str]
506
539
  :param _request_timeout: timeout setting for this request. If one
507
540
  number provided, it will be total request
508
541
  timeout. It can also be a pair (tuple) of
@@ -525,9 +558,9 @@ class WorkflowRunsApi:
525
558
  :return: Returns the result object.
526
559
  """ # noqa: E501
527
560
 
528
- _param = self._workflow_run_update_replay_serialize(
561
+ _param = self._v1_workflow_run_display_names_list_serialize(
529
562
  tenant=tenant,
530
- replay_workflow_runs_request=replay_workflow_runs_request,
563
+ external_ids=external_ids,
531
564
  _request_auth=_request_auth,
532
565
  _content_type=_content_type,
533
566
  _headers=_headers,
@@ -535,20 +568,20 @@ class WorkflowRunsApi:
535
568
  )
536
569
 
537
570
  _response_types_map: Dict[str, Optional[str]] = {
538
- "200": "ReplayWorkflowRunsResponse",
571
+ "200": "V1WorkflowRunDisplayNameList",
539
572
  "400": "APIErrors",
540
573
  "403": "APIErrors",
541
- "429": "APIErrors",
574
+ "501": "APIErrors",
542
575
  }
543
576
  response_data = await self.api_client.call_api(
544
577
  *_param, _request_timeout=_request_timeout
545
578
  )
546
579
  return response_data.response
547
580
 
548
- def _workflow_run_update_replay_serialize(
581
+ def _v1_workflow_run_display_names_list_serialize(
549
582
  self,
550
583
  tenant,
551
- replay_workflow_runs_request,
584
+ external_ids,
552
585
  _request_auth,
553
586
  _content_type,
554
587
  _headers,
@@ -557,46 +590,1171 @@ class WorkflowRunsApi:
557
590
 
558
591
  _host = None
559
592
 
560
- _collection_formats: Dict[str, str] = {}
593
+ _collection_formats: Dict[str, str] = {
594
+ "external_ids": "multi",
595
+ }
561
596
 
562
597
  _path_params: Dict[str, str] = {}
563
598
  _query_params: List[Tuple[str, str]] = []
564
599
  _header_params: Dict[str, Optional[str]] = _headers or {}
565
600
  _form_params: List[Tuple[str, str]] = []
566
- _files: Dict[str, Union[str, bytes]] = {}
601
+ _files: Dict[
602
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
603
+ ] = {}
567
604
  _body_params: Optional[bytes] = None
568
605
 
569
606
  # process the path parameters
570
607
  if tenant is not None:
571
608
  _path_params["tenant"] = tenant
572
609
  # process the query parameters
610
+ if external_ids is not None:
611
+
612
+ _query_params.append(("external_ids", external_ids))
613
+
573
614
  # process the header parameters
574
615
  # process the form parameters
575
616
  # process the body parameter
576
- if replay_workflow_runs_request is not None:
577
- _body_params = replay_workflow_runs_request
578
617
 
579
618
  # set the HTTP header `Accept`
580
- _header_params["Accept"] = self.api_client.select_header_accept(
581
- ["application/json"]
582
- )
583
-
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(
619
+ if "Accept" not in _header_params:
620
+ _header_params["Accept"] = self.api_client.select_header_accept(
589
621
  ["application/json"]
590
622
  )
591
- if _default_content_type is not None:
592
- _header_params["Content-Type"] = _default_content_type
593
623
 
594
624
  # authentication setting
595
625
  _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
596
626
 
597
627
  return self.api_client.param_serialize(
598
- method="POST",
599
- resource_path="/api/v1/tenants/{tenant}/workflow-runs/replay",
628
+ method="GET",
629
+ resource_path="/api/v1/stable/tenants/{tenant}/workflow-runs/display-names",
630
+ path_params=_path_params,
631
+ query_params=_query_params,
632
+ header_params=_header_params,
633
+ body=_body_params,
634
+ post_params=_form_params,
635
+ files=_files,
636
+ auth_settings=_auth_settings,
637
+ collection_formats=_collection_formats,
638
+ _host=_host,
639
+ _request_auth=_request_auth,
640
+ )
641
+
642
+ @validate_call
643
+ async def v1_workflow_run_get(
644
+ self,
645
+ v1_workflow_run: Annotated[
646
+ str,
647
+ Field(
648
+ min_length=36,
649
+ strict=True,
650
+ max_length=36,
651
+ description="The workflow run id to get",
652
+ ),
653
+ ],
654
+ _request_timeout: Union[
655
+ None,
656
+ Annotated[StrictFloat, Field(gt=0)],
657
+ Tuple[
658
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
659
+ ],
660
+ ] = None,
661
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
662
+ _content_type: Optional[StrictStr] = None,
663
+ _headers: Optional[Dict[StrictStr, Any]] = None,
664
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
665
+ ) -> V1WorkflowRunDetails:
666
+ """List tasks
667
+
668
+ Get a workflow run and its metadata to display on the \"detail\" page
669
+
670
+ :param v1_workflow_run: The workflow run id to get (required)
671
+ :type v1_workflow_run: str
672
+ :param _request_timeout: timeout setting for this request. If one
673
+ number provided, it will be total request
674
+ timeout. It can also be a pair (tuple) of
675
+ (connection, read) timeouts.
676
+ :type _request_timeout: int, tuple(int, int), optional
677
+ :param _request_auth: set to override the auth_settings for an a single
678
+ request; this effectively ignores the
679
+ authentication in the spec for a single request.
680
+ :type _request_auth: dict, optional
681
+ :param _content_type: force content-type for the request.
682
+ :type _content_type: str, Optional
683
+ :param _headers: set to override the headers for a single
684
+ request; this effectively ignores the headers
685
+ in the spec for a single request.
686
+ :type _headers: dict, optional
687
+ :param _host_index: set to override the host_index for a single
688
+ request; this effectively ignores the host_index
689
+ in the spec for a single request.
690
+ :type _host_index: int, optional
691
+ :return: Returns the result object.
692
+ """ # noqa: E501
693
+
694
+ _param = self._v1_workflow_run_get_serialize(
695
+ v1_workflow_run=v1_workflow_run,
696
+ _request_auth=_request_auth,
697
+ _content_type=_content_type,
698
+ _headers=_headers,
699
+ _host_index=_host_index,
700
+ )
701
+
702
+ _response_types_map: Dict[str, Optional[str]] = {
703
+ "200": "V1WorkflowRunDetails",
704
+ "400": "APIErrors",
705
+ "403": "APIErrors",
706
+ "501": "APIErrors",
707
+ }
708
+ response_data = await self.api_client.call_api(
709
+ *_param, _request_timeout=_request_timeout
710
+ )
711
+ await response_data.read()
712
+ return self.api_client.response_deserialize(
713
+ response_data=response_data,
714
+ response_types_map=_response_types_map,
715
+ ).data
716
+
717
+ @validate_call
718
+ async def v1_workflow_run_get_with_http_info(
719
+ self,
720
+ v1_workflow_run: Annotated[
721
+ str,
722
+ Field(
723
+ min_length=36,
724
+ strict=True,
725
+ max_length=36,
726
+ description="The workflow run id to get",
727
+ ),
728
+ ],
729
+ _request_timeout: Union[
730
+ None,
731
+ Annotated[StrictFloat, Field(gt=0)],
732
+ Tuple[
733
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
734
+ ],
735
+ ] = None,
736
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
737
+ _content_type: Optional[StrictStr] = None,
738
+ _headers: Optional[Dict[StrictStr, Any]] = None,
739
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
740
+ ) -> ApiResponse[V1WorkflowRunDetails]:
741
+ """List tasks
742
+
743
+ Get a workflow run and its metadata to display on the \"detail\" page
744
+
745
+ :param v1_workflow_run: The workflow run id to get (required)
746
+ :type v1_workflow_run: str
747
+ :param _request_timeout: timeout setting for this request. If one
748
+ number provided, it will be total request
749
+ timeout. It can also be a pair (tuple) of
750
+ (connection, read) timeouts.
751
+ :type _request_timeout: int, tuple(int, int), optional
752
+ :param _request_auth: set to override the auth_settings for an a single
753
+ request; this effectively ignores the
754
+ authentication in the spec for a single request.
755
+ :type _request_auth: dict, optional
756
+ :param _content_type: force content-type for the request.
757
+ :type _content_type: str, Optional
758
+ :param _headers: set to override the headers for a single
759
+ request; this effectively ignores the headers
760
+ in the spec for a single request.
761
+ :type _headers: dict, optional
762
+ :param _host_index: set to override the host_index for a single
763
+ request; this effectively ignores the host_index
764
+ in the spec for a single request.
765
+ :type _host_index: int, optional
766
+ :return: Returns the result object.
767
+ """ # noqa: E501
768
+
769
+ _param = self._v1_workflow_run_get_serialize(
770
+ v1_workflow_run=v1_workflow_run,
771
+ _request_auth=_request_auth,
772
+ _content_type=_content_type,
773
+ _headers=_headers,
774
+ _host_index=_host_index,
775
+ )
776
+
777
+ _response_types_map: Dict[str, Optional[str]] = {
778
+ "200": "V1WorkflowRunDetails",
779
+ "400": "APIErrors",
780
+ "403": "APIErrors",
781
+ "501": "APIErrors",
782
+ }
783
+ response_data = await self.api_client.call_api(
784
+ *_param, _request_timeout=_request_timeout
785
+ )
786
+ await response_data.read()
787
+ return self.api_client.response_deserialize(
788
+ response_data=response_data,
789
+ response_types_map=_response_types_map,
790
+ )
791
+
792
+ @validate_call
793
+ async def v1_workflow_run_get_without_preload_content(
794
+ self,
795
+ v1_workflow_run: Annotated[
796
+ str,
797
+ Field(
798
+ min_length=36,
799
+ strict=True,
800
+ max_length=36,
801
+ description="The workflow run id to get",
802
+ ),
803
+ ],
804
+ _request_timeout: Union[
805
+ None,
806
+ Annotated[StrictFloat, Field(gt=0)],
807
+ Tuple[
808
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
809
+ ],
810
+ ] = None,
811
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
812
+ _content_type: Optional[StrictStr] = None,
813
+ _headers: Optional[Dict[StrictStr, Any]] = None,
814
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
815
+ ) -> RESTResponseType:
816
+ """List tasks
817
+
818
+ Get a workflow run and its metadata to display on the \"detail\" page
819
+
820
+ :param v1_workflow_run: The workflow run id to get (required)
821
+ :type v1_workflow_run: str
822
+ :param _request_timeout: timeout setting for this request. If one
823
+ number provided, it will be total request
824
+ timeout. It can also be a pair (tuple) of
825
+ (connection, read) timeouts.
826
+ :type _request_timeout: int, tuple(int, int), optional
827
+ :param _request_auth: set to override the auth_settings for an a single
828
+ request; this effectively ignores the
829
+ authentication in the spec for a single request.
830
+ :type _request_auth: dict, optional
831
+ :param _content_type: force content-type for the request.
832
+ :type _content_type: str, Optional
833
+ :param _headers: set to override the headers for a single
834
+ request; this effectively ignores the headers
835
+ in the spec for a single request.
836
+ :type _headers: dict, optional
837
+ :param _host_index: set to override the host_index for a single
838
+ request; this effectively ignores the host_index
839
+ in the spec for a single request.
840
+ :type _host_index: int, optional
841
+ :return: Returns the result object.
842
+ """ # noqa: E501
843
+
844
+ _param = self._v1_workflow_run_get_serialize(
845
+ v1_workflow_run=v1_workflow_run,
846
+ _request_auth=_request_auth,
847
+ _content_type=_content_type,
848
+ _headers=_headers,
849
+ _host_index=_host_index,
850
+ )
851
+
852
+ _response_types_map: Dict[str, Optional[str]] = {
853
+ "200": "V1WorkflowRunDetails",
854
+ "400": "APIErrors",
855
+ "403": "APIErrors",
856
+ "501": "APIErrors",
857
+ }
858
+ response_data = await self.api_client.call_api(
859
+ *_param, _request_timeout=_request_timeout
860
+ )
861
+ return response_data.response
862
+
863
+ def _v1_workflow_run_get_serialize(
864
+ self,
865
+ v1_workflow_run,
866
+ _request_auth,
867
+ _content_type,
868
+ _headers,
869
+ _host_index,
870
+ ) -> RequestSerialized:
871
+
872
+ _host = None
873
+
874
+ _collection_formats: Dict[str, str] = {}
875
+
876
+ _path_params: Dict[str, str] = {}
877
+ _query_params: List[Tuple[str, str]] = []
878
+ _header_params: Dict[str, Optional[str]] = _headers or {}
879
+ _form_params: List[Tuple[str, str]] = []
880
+ _files: Dict[
881
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
882
+ ] = {}
883
+ _body_params: Optional[bytes] = None
884
+
885
+ # process the path parameters
886
+ if v1_workflow_run is not None:
887
+ _path_params["v1-workflow-run"] = v1_workflow_run
888
+ # process the query parameters
889
+ # process the header parameters
890
+ # process the form parameters
891
+ # process the body parameter
892
+
893
+ # set the HTTP header `Accept`
894
+ if "Accept" not in _header_params:
895
+ _header_params["Accept"] = self.api_client.select_header_accept(
896
+ ["application/json"]
897
+ )
898
+
899
+ # authentication setting
900
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
901
+
902
+ return self.api_client.param_serialize(
903
+ method="GET",
904
+ resource_path="/api/v1/stable/workflow-runs/{v1-workflow-run}",
905
+ path_params=_path_params,
906
+ query_params=_query_params,
907
+ header_params=_header_params,
908
+ body=_body_params,
909
+ post_params=_form_params,
910
+ files=_files,
911
+ auth_settings=_auth_settings,
912
+ collection_formats=_collection_formats,
913
+ _host=_host,
914
+ _request_auth=_request_auth,
915
+ )
916
+
917
+ @validate_call
918
+ async def v1_workflow_run_list(
919
+ self,
920
+ tenant: Annotated[
921
+ str,
922
+ Field(
923
+ min_length=36, strict=True, max_length=36, description="The tenant id"
924
+ ),
925
+ ],
926
+ since: Annotated[datetime, Field(description="The earliest date to filter by")],
927
+ only_tasks: Annotated[
928
+ StrictBool,
929
+ Field(description="Whether to include DAGs or only to include tasks"),
930
+ ],
931
+ offset: Annotated[
932
+ Optional[StrictInt], Field(description="The number to skip")
933
+ ] = None,
934
+ limit: Annotated[
935
+ Optional[StrictInt], Field(description="The number to limit by")
936
+ ] = None,
937
+ statuses: Annotated[
938
+ Optional[List[V1TaskStatus]],
939
+ Field(description="A list of statuses to filter by"),
940
+ ] = None,
941
+ until: Annotated[
942
+ Optional[datetime], Field(description="The latest date to filter by")
943
+ ] = None,
944
+ additional_metadata: Annotated[
945
+ Optional[List[StrictStr]],
946
+ Field(description="Additional metadata k-v pairs to filter by"),
947
+ ] = None,
948
+ workflow_ids: Annotated[
949
+ Optional[
950
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]
951
+ ],
952
+ Field(description="The workflow ids to find runs for"),
953
+ ] = None,
954
+ worker_id: Annotated[
955
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
956
+ Field(description="The worker id to filter by"),
957
+ ] = None,
958
+ parent_task_external_id: Annotated[
959
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
960
+ Field(description="The parent task external id to filter by"),
961
+ ] = None,
962
+ _request_timeout: Union[
963
+ None,
964
+ Annotated[StrictFloat, Field(gt=0)],
965
+ Tuple[
966
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
967
+ ],
968
+ ] = None,
969
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
970
+ _content_type: Optional[StrictStr] = None,
971
+ _headers: Optional[Dict[StrictStr, Any]] = None,
972
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
973
+ ) -> V1TaskSummaryList:
974
+ """List workflow runs
975
+
976
+ Lists workflow runs for a tenant.
977
+
978
+ :param tenant: The tenant id (required)
979
+ :type tenant: str
980
+ :param since: The earliest date to filter by (required)
981
+ :type since: datetime
982
+ :param only_tasks: Whether to include DAGs or only to include tasks (required)
983
+ :type only_tasks: bool
984
+ :param offset: The number to skip
985
+ :type offset: int
986
+ :param limit: The number to limit by
987
+ :type limit: int
988
+ :param statuses: A list of statuses to filter by
989
+ :type statuses: List[V1TaskStatus]
990
+ :param until: The latest date to filter by
991
+ :type until: datetime
992
+ :param additional_metadata: Additional metadata k-v pairs to filter by
993
+ :type additional_metadata: List[str]
994
+ :param workflow_ids: The workflow ids to find runs for
995
+ :type workflow_ids: List[str]
996
+ :param worker_id: The worker id to filter by
997
+ :type worker_id: str
998
+ :param parent_task_external_id: The parent task external id to filter by
999
+ :type parent_task_external_id: str
1000
+ :param _request_timeout: timeout setting for this request. If one
1001
+ number provided, it will be total request
1002
+ timeout. It can also be a pair (tuple) of
1003
+ (connection, read) timeouts.
1004
+ :type _request_timeout: int, tuple(int, int), optional
1005
+ :param _request_auth: set to override the auth_settings for an a single
1006
+ request; this effectively ignores the
1007
+ authentication in the spec for a single request.
1008
+ :type _request_auth: dict, optional
1009
+ :param _content_type: force content-type for the request.
1010
+ :type _content_type: str, Optional
1011
+ :param _headers: set to override the headers for a single
1012
+ request; this effectively ignores the headers
1013
+ in the spec for a single request.
1014
+ :type _headers: dict, optional
1015
+ :param _host_index: set to override the host_index for a single
1016
+ request; this effectively ignores the host_index
1017
+ in the spec for a single request.
1018
+ :type _host_index: int, optional
1019
+ :return: Returns the result object.
1020
+ """ # noqa: E501
1021
+
1022
+ _param = self._v1_workflow_run_list_serialize(
1023
+ tenant=tenant,
1024
+ since=since,
1025
+ only_tasks=only_tasks,
1026
+ offset=offset,
1027
+ limit=limit,
1028
+ statuses=statuses,
1029
+ until=until,
1030
+ additional_metadata=additional_metadata,
1031
+ workflow_ids=workflow_ids,
1032
+ worker_id=worker_id,
1033
+ parent_task_external_id=parent_task_external_id,
1034
+ _request_auth=_request_auth,
1035
+ _content_type=_content_type,
1036
+ _headers=_headers,
1037
+ _host_index=_host_index,
1038
+ )
1039
+
1040
+ _response_types_map: Dict[str, Optional[str]] = {
1041
+ "200": "V1TaskSummaryList",
1042
+ "400": "APIErrors",
1043
+ "403": "APIErrors",
1044
+ "501": "APIErrors",
1045
+ }
1046
+ response_data = await self.api_client.call_api(
1047
+ *_param, _request_timeout=_request_timeout
1048
+ )
1049
+ await response_data.read()
1050
+ return self.api_client.response_deserialize(
1051
+ response_data=response_data,
1052
+ response_types_map=_response_types_map,
1053
+ ).data
1054
+
1055
+ @validate_call
1056
+ async def v1_workflow_run_list_with_http_info(
1057
+ self,
1058
+ tenant: Annotated[
1059
+ str,
1060
+ Field(
1061
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1062
+ ),
1063
+ ],
1064
+ since: Annotated[datetime, Field(description="The earliest date to filter by")],
1065
+ only_tasks: Annotated[
1066
+ StrictBool,
1067
+ Field(description="Whether to include DAGs or only to include tasks"),
1068
+ ],
1069
+ offset: Annotated[
1070
+ Optional[StrictInt], Field(description="The number to skip")
1071
+ ] = None,
1072
+ limit: Annotated[
1073
+ Optional[StrictInt], Field(description="The number to limit by")
1074
+ ] = None,
1075
+ statuses: Annotated[
1076
+ Optional[List[V1TaskStatus]],
1077
+ Field(description="A list of statuses to filter by"),
1078
+ ] = None,
1079
+ until: Annotated[
1080
+ Optional[datetime], Field(description="The latest date to filter by")
1081
+ ] = None,
1082
+ additional_metadata: Annotated[
1083
+ Optional[List[StrictStr]],
1084
+ Field(description="Additional metadata k-v pairs to filter by"),
1085
+ ] = None,
1086
+ workflow_ids: Annotated[
1087
+ Optional[
1088
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]
1089
+ ],
1090
+ Field(description="The workflow ids to find runs for"),
1091
+ ] = None,
1092
+ worker_id: Annotated[
1093
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
1094
+ Field(description="The worker id to filter by"),
1095
+ ] = None,
1096
+ parent_task_external_id: Annotated[
1097
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
1098
+ Field(description="The parent task external id to filter by"),
1099
+ ] = None,
1100
+ _request_timeout: Union[
1101
+ None,
1102
+ Annotated[StrictFloat, Field(gt=0)],
1103
+ Tuple[
1104
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1105
+ ],
1106
+ ] = None,
1107
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1108
+ _content_type: Optional[StrictStr] = None,
1109
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1110
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1111
+ ) -> ApiResponse[V1TaskSummaryList]:
1112
+ """List workflow runs
1113
+
1114
+ Lists workflow runs for a tenant.
1115
+
1116
+ :param tenant: The tenant id (required)
1117
+ :type tenant: str
1118
+ :param since: The earliest date to filter by (required)
1119
+ :type since: datetime
1120
+ :param only_tasks: Whether to include DAGs or only to include tasks (required)
1121
+ :type only_tasks: bool
1122
+ :param offset: The number to skip
1123
+ :type offset: int
1124
+ :param limit: The number to limit by
1125
+ :type limit: int
1126
+ :param statuses: A list of statuses to filter by
1127
+ :type statuses: List[V1TaskStatus]
1128
+ :param until: The latest date to filter by
1129
+ :type until: datetime
1130
+ :param additional_metadata: Additional metadata k-v pairs to filter by
1131
+ :type additional_metadata: List[str]
1132
+ :param workflow_ids: The workflow ids to find runs for
1133
+ :type workflow_ids: List[str]
1134
+ :param worker_id: The worker id to filter by
1135
+ :type worker_id: str
1136
+ :param parent_task_external_id: The parent task external id to filter by
1137
+ :type parent_task_external_id: str
1138
+ :param _request_timeout: timeout setting for this request. If one
1139
+ number provided, it will be total request
1140
+ timeout. It can also be a pair (tuple) of
1141
+ (connection, read) timeouts.
1142
+ :type _request_timeout: int, tuple(int, int), optional
1143
+ :param _request_auth: set to override the auth_settings for an a single
1144
+ request; this effectively ignores the
1145
+ authentication in the spec for a single request.
1146
+ :type _request_auth: dict, optional
1147
+ :param _content_type: force content-type for the request.
1148
+ :type _content_type: str, Optional
1149
+ :param _headers: set to override the headers for a single
1150
+ request; this effectively ignores the headers
1151
+ in the spec for a single request.
1152
+ :type _headers: dict, optional
1153
+ :param _host_index: set to override the host_index for a single
1154
+ request; this effectively ignores the host_index
1155
+ in the spec for a single request.
1156
+ :type _host_index: int, optional
1157
+ :return: Returns the result object.
1158
+ """ # noqa: E501
1159
+
1160
+ _param = self._v1_workflow_run_list_serialize(
1161
+ tenant=tenant,
1162
+ since=since,
1163
+ only_tasks=only_tasks,
1164
+ offset=offset,
1165
+ limit=limit,
1166
+ statuses=statuses,
1167
+ until=until,
1168
+ additional_metadata=additional_metadata,
1169
+ workflow_ids=workflow_ids,
1170
+ worker_id=worker_id,
1171
+ parent_task_external_id=parent_task_external_id,
1172
+ _request_auth=_request_auth,
1173
+ _content_type=_content_type,
1174
+ _headers=_headers,
1175
+ _host_index=_host_index,
1176
+ )
1177
+
1178
+ _response_types_map: Dict[str, Optional[str]] = {
1179
+ "200": "V1TaskSummaryList",
1180
+ "400": "APIErrors",
1181
+ "403": "APIErrors",
1182
+ "501": "APIErrors",
1183
+ }
1184
+ response_data = await self.api_client.call_api(
1185
+ *_param, _request_timeout=_request_timeout
1186
+ )
1187
+ await response_data.read()
1188
+ return self.api_client.response_deserialize(
1189
+ response_data=response_data,
1190
+ response_types_map=_response_types_map,
1191
+ )
1192
+
1193
+ @validate_call
1194
+ async def v1_workflow_run_list_without_preload_content(
1195
+ self,
1196
+ tenant: Annotated[
1197
+ str,
1198
+ Field(
1199
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1200
+ ),
1201
+ ],
1202
+ since: Annotated[datetime, Field(description="The earliest date to filter by")],
1203
+ only_tasks: Annotated[
1204
+ StrictBool,
1205
+ Field(description="Whether to include DAGs or only to include tasks"),
1206
+ ],
1207
+ offset: Annotated[
1208
+ Optional[StrictInt], Field(description="The number to skip")
1209
+ ] = None,
1210
+ limit: Annotated[
1211
+ Optional[StrictInt], Field(description="The number to limit by")
1212
+ ] = None,
1213
+ statuses: Annotated[
1214
+ Optional[List[V1TaskStatus]],
1215
+ Field(description="A list of statuses to filter by"),
1216
+ ] = None,
1217
+ until: Annotated[
1218
+ Optional[datetime], Field(description="The latest date to filter by")
1219
+ ] = None,
1220
+ additional_metadata: Annotated[
1221
+ Optional[List[StrictStr]],
1222
+ Field(description="Additional metadata k-v pairs to filter by"),
1223
+ ] = None,
1224
+ workflow_ids: Annotated[
1225
+ Optional[
1226
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]
1227
+ ],
1228
+ Field(description="The workflow ids to find runs for"),
1229
+ ] = None,
1230
+ worker_id: Annotated[
1231
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
1232
+ Field(description="The worker id to filter by"),
1233
+ ] = None,
1234
+ parent_task_external_id: Annotated[
1235
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
1236
+ Field(description="The parent task external id to filter by"),
1237
+ ] = None,
1238
+ _request_timeout: Union[
1239
+ None,
1240
+ Annotated[StrictFloat, Field(gt=0)],
1241
+ Tuple[
1242
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1243
+ ],
1244
+ ] = None,
1245
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1246
+ _content_type: Optional[StrictStr] = None,
1247
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1248
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1249
+ ) -> RESTResponseType:
1250
+ """List workflow runs
1251
+
1252
+ Lists workflow runs for a tenant.
1253
+
1254
+ :param tenant: The tenant id (required)
1255
+ :type tenant: str
1256
+ :param since: The earliest date to filter by (required)
1257
+ :type since: datetime
1258
+ :param only_tasks: Whether to include DAGs or only to include tasks (required)
1259
+ :type only_tasks: bool
1260
+ :param offset: The number to skip
1261
+ :type offset: int
1262
+ :param limit: The number to limit by
1263
+ :type limit: int
1264
+ :param statuses: A list of statuses to filter by
1265
+ :type statuses: List[V1TaskStatus]
1266
+ :param until: The latest date to filter by
1267
+ :type until: datetime
1268
+ :param additional_metadata: Additional metadata k-v pairs to filter by
1269
+ :type additional_metadata: List[str]
1270
+ :param workflow_ids: The workflow ids to find runs for
1271
+ :type workflow_ids: List[str]
1272
+ :param worker_id: The worker id to filter by
1273
+ :type worker_id: str
1274
+ :param parent_task_external_id: The parent task external id to filter by
1275
+ :type parent_task_external_id: str
1276
+ :param _request_timeout: timeout setting for this request. If one
1277
+ number provided, it will be total request
1278
+ timeout. It can also be a pair (tuple) of
1279
+ (connection, read) timeouts.
1280
+ :type _request_timeout: int, tuple(int, int), optional
1281
+ :param _request_auth: set to override the auth_settings for an a single
1282
+ request; this effectively ignores the
1283
+ authentication in the spec for a single request.
1284
+ :type _request_auth: dict, optional
1285
+ :param _content_type: force content-type for the request.
1286
+ :type _content_type: str, Optional
1287
+ :param _headers: set to override the headers for a single
1288
+ request; this effectively ignores the headers
1289
+ in the spec for a single request.
1290
+ :type _headers: dict, optional
1291
+ :param _host_index: set to override the host_index for a single
1292
+ request; this effectively ignores the host_index
1293
+ in the spec for a single request.
1294
+ :type _host_index: int, optional
1295
+ :return: Returns the result object.
1296
+ """ # noqa: E501
1297
+
1298
+ _param = self._v1_workflow_run_list_serialize(
1299
+ tenant=tenant,
1300
+ since=since,
1301
+ only_tasks=only_tasks,
1302
+ offset=offset,
1303
+ limit=limit,
1304
+ statuses=statuses,
1305
+ until=until,
1306
+ additional_metadata=additional_metadata,
1307
+ workflow_ids=workflow_ids,
1308
+ worker_id=worker_id,
1309
+ parent_task_external_id=parent_task_external_id,
1310
+ _request_auth=_request_auth,
1311
+ _content_type=_content_type,
1312
+ _headers=_headers,
1313
+ _host_index=_host_index,
1314
+ )
1315
+
1316
+ _response_types_map: Dict[str, Optional[str]] = {
1317
+ "200": "V1TaskSummaryList",
1318
+ "400": "APIErrors",
1319
+ "403": "APIErrors",
1320
+ "501": "APIErrors",
1321
+ }
1322
+ response_data = await self.api_client.call_api(
1323
+ *_param, _request_timeout=_request_timeout
1324
+ )
1325
+ return response_data.response
1326
+
1327
+ def _v1_workflow_run_list_serialize(
1328
+ self,
1329
+ tenant,
1330
+ since,
1331
+ only_tasks,
1332
+ offset,
1333
+ limit,
1334
+ statuses,
1335
+ until,
1336
+ additional_metadata,
1337
+ workflow_ids,
1338
+ worker_id,
1339
+ parent_task_external_id,
1340
+ _request_auth,
1341
+ _content_type,
1342
+ _headers,
1343
+ _host_index,
1344
+ ) -> RequestSerialized:
1345
+
1346
+ _host = None
1347
+
1348
+ _collection_formats: Dict[str, str] = {
1349
+ "statuses": "multi",
1350
+ "additional_metadata": "multi",
1351
+ "workflow_ids": "multi",
1352
+ }
1353
+
1354
+ _path_params: Dict[str, str] = {}
1355
+ _query_params: List[Tuple[str, str]] = []
1356
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1357
+ _form_params: List[Tuple[str, str]] = []
1358
+ _files: Dict[
1359
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1360
+ ] = {}
1361
+ _body_params: Optional[bytes] = None
1362
+
1363
+ # process the path parameters
1364
+ if tenant is not None:
1365
+ _path_params["tenant"] = tenant
1366
+ # process the query parameters
1367
+ if offset is not None:
1368
+
1369
+ _query_params.append(("offset", offset))
1370
+
1371
+ if limit is not None:
1372
+
1373
+ _query_params.append(("limit", limit))
1374
+
1375
+ if statuses is not None:
1376
+
1377
+ _query_params.append(("statuses", statuses))
1378
+
1379
+ if since is not None:
1380
+ if isinstance(since, datetime):
1381
+ _query_params.append(
1382
+ (
1383
+ "since",
1384
+ since.strftime(self.api_client.configuration.datetime_format),
1385
+ )
1386
+ )
1387
+ else:
1388
+ _query_params.append(("since", since))
1389
+
1390
+ if until is not None:
1391
+ if isinstance(until, datetime):
1392
+ _query_params.append(
1393
+ (
1394
+ "until",
1395
+ until.strftime(self.api_client.configuration.datetime_format),
1396
+ )
1397
+ )
1398
+ else:
1399
+ _query_params.append(("until", until))
1400
+
1401
+ if additional_metadata is not None:
1402
+
1403
+ _query_params.append(("additional_metadata", additional_metadata))
1404
+
1405
+ if workflow_ids is not None:
1406
+
1407
+ _query_params.append(("workflow_ids", workflow_ids))
1408
+
1409
+ if worker_id is not None:
1410
+
1411
+ _query_params.append(("worker_id", worker_id))
1412
+
1413
+ if only_tasks is not None:
1414
+
1415
+ _query_params.append(("only_tasks", only_tasks))
1416
+
1417
+ if parent_task_external_id is not None:
1418
+
1419
+ _query_params.append(("parent_task_external_id", parent_task_external_id))
1420
+
1421
+ # process the header parameters
1422
+ # process the form parameters
1423
+ # process the body parameter
1424
+
1425
+ # set the HTTP header `Accept`
1426
+ if "Accept" not in _header_params:
1427
+ _header_params["Accept"] = self.api_client.select_header_accept(
1428
+ ["application/json"]
1429
+ )
1430
+
1431
+ # authentication setting
1432
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1433
+
1434
+ return self.api_client.param_serialize(
1435
+ method="GET",
1436
+ resource_path="/api/v1/stable/tenants/{tenant}/workflow-runs",
1437
+ path_params=_path_params,
1438
+ query_params=_query_params,
1439
+ header_params=_header_params,
1440
+ body=_body_params,
1441
+ post_params=_form_params,
1442
+ files=_files,
1443
+ auth_settings=_auth_settings,
1444
+ collection_formats=_collection_formats,
1445
+ _host=_host,
1446
+ _request_auth=_request_auth,
1447
+ )
1448
+
1449
+ @validate_call
1450
+ async def v1_workflow_run_task_events_list(
1451
+ self,
1452
+ v1_workflow_run: Annotated[
1453
+ str,
1454
+ Field(
1455
+ min_length=36,
1456
+ strict=True,
1457
+ max_length=36,
1458
+ description="The workflow run id to find runs for",
1459
+ ),
1460
+ ],
1461
+ offset: Annotated[
1462
+ Optional[StrictInt], Field(description="The number to skip")
1463
+ ] = None,
1464
+ limit: Annotated[
1465
+ Optional[StrictInt], Field(description="The number to limit by")
1466
+ ] = None,
1467
+ _request_timeout: Union[
1468
+ None,
1469
+ Annotated[StrictFloat, Field(gt=0)],
1470
+ Tuple[
1471
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1472
+ ],
1473
+ ] = None,
1474
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1475
+ _content_type: Optional[StrictStr] = None,
1476
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1477
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1478
+ ) -> V1TaskEventList:
1479
+ """List tasks
1480
+
1481
+ List all tasks for a workflow run
1482
+
1483
+ :param v1_workflow_run: The workflow run id to find runs for (required)
1484
+ :type v1_workflow_run: str
1485
+ :param offset: The number to skip
1486
+ :type offset: int
1487
+ :param limit: The number to limit by
1488
+ :type limit: int
1489
+ :param _request_timeout: timeout setting for this request. If one
1490
+ number provided, it will be total request
1491
+ timeout. It can also be a pair (tuple) of
1492
+ (connection, read) timeouts.
1493
+ :type _request_timeout: int, tuple(int, int), optional
1494
+ :param _request_auth: set to override the auth_settings for an a single
1495
+ request; this effectively ignores the
1496
+ authentication in the spec for a single request.
1497
+ :type _request_auth: dict, optional
1498
+ :param _content_type: force content-type for the request.
1499
+ :type _content_type: str, Optional
1500
+ :param _headers: set to override the headers for a single
1501
+ request; this effectively ignores the headers
1502
+ in the spec for a single request.
1503
+ :type _headers: dict, optional
1504
+ :param _host_index: set to override the host_index for a single
1505
+ request; this effectively ignores the host_index
1506
+ in the spec for a single request.
1507
+ :type _host_index: int, optional
1508
+ :return: Returns the result object.
1509
+ """ # noqa: E501
1510
+
1511
+ _param = self._v1_workflow_run_task_events_list_serialize(
1512
+ v1_workflow_run=v1_workflow_run,
1513
+ offset=offset,
1514
+ limit=limit,
1515
+ _request_auth=_request_auth,
1516
+ _content_type=_content_type,
1517
+ _headers=_headers,
1518
+ _host_index=_host_index,
1519
+ )
1520
+
1521
+ _response_types_map: Dict[str, Optional[str]] = {
1522
+ "200": "V1TaskEventList",
1523
+ "400": "APIErrors",
1524
+ "403": "APIErrors",
1525
+ "501": "APIErrors",
1526
+ }
1527
+ response_data = await self.api_client.call_api(
1528
+ *_param, _request_timeout=_request_timeout
1529
+ )
1530
+ await response_data.read()
1531
+ return self.api_client.response_deserialize(
1532
+ response_data=response_data,
1533
+ response_types_map=_response_types_map,
1534
+ ).data
1535
+
1536
+ @validate_call
1537
+ async def v1_workflow_run_task_events_list_with_http_info(
1538
+ self,
1539
+ v1_workflow_run: Annotated[
1540
+ str,
1541
+ Field(
1542
+ min_length=36,
1543
+ strict=True,
1544
+ max_length=36,
1545
+ description="The workflow run id to find runs for",
1546
+ ),
1547
+ ],
1548
+ offset: Annotated[
1549
+ Optional[StrictInt], Field(description="The number to skip")
1550
+ ] = None,
1551
+ limit: Annotated[
1552
+ Optional[StrictInt], Field(description="The number to limit by")
1553
+ ] = None,
1554
+ _request_timeout: Union[
1555
+ None,
1556
+ Annotated[StrictFloat, Field(gt=0)],
1557
+ Tuple[
1558
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1559
+ ],
1560
+ ] = None,
1561
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1562
+ _content_type: Optional[StrictStr] = None,
1563
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1564
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1565
+ ) -> ApiResponse[V1TaskEventList]:
1566
+ """List tasks
1567
+
1568
+ List all tasks for a workflow run
1569
+
1570
+ :param v1_workflow_run: The workflow run id to find runs for (required)
1571
+ :type v1_workflow_run: str
1572
+ :param offset: The number to skip
1573
+ :type offset: int
1574
+ :param limit: The number to limit by
1575
+ :type limit: int
1576
+ :param _request_timeout: timeout setting for this request. If one
1577
+ number provided, it will be total request
1578
+ timeout. It can also be a pair (tuple) of
1579
+ (connection, read) timeouts.
1580
+ :type _request_timeout: int, tuple(int, int), optional
1581
+ :param _request_auth: set to override the auth_settings for an a single
1582
+ request; this effectively ignores the
1583
+ authentication in the spec for a single request.
1584
+ :type _request_auth: dict, optional
1585
+ :param _content_type: force content-type for the request.
1586
+ :type _content_type: str, Optional
1587
+ :param _headers: set to override the headers for a single
1588
+ request; this effectively ignores the headers
1589
+ in the spec for a single request.
1590
+ :type _headers: dict, optional
1591
+ :param _host_index: set to override the host_index for a single
1592
+ request; this effectively ignores the host_index
1593
+ in the spec for a single request.
1594
+ :type _host_index: int, optional
1595
+ :return: Returns the result object.
1596
+ """ # noqa: E501
1597
+
1598
+ _param = self._v1_workflow_run_task_events_list_serialize(
1599
+ v1_workflow_run=v1_workflow_run,
1600
+ offset=offset,
1601
+ limit=limit,
1602
+ _request_auth=_request_auth,
1603
+ _content_type=_content_type,
1604
+ _headers=_headers,
1605
+ _host_index=_host_index,
1606
+ )
1607
+
1608
+ _response_types_map: Dict[str, Optional[str]] = {
1609
+ "200": "V1TaskEventList",
1610
+ "400": "APIErrors",
1611
+ "403": "APIErrors",
1612
+ "501": "APIErrors",
1613
+ }
1614
+ response_data = await self.api_client.call_api(
1615
+ *_param, _request_timeout=_request_timeout
1616
+ )
1617
+ await response_data.read()
1618
+ return self.api_client.response_deserialize(
1619
+ response_data=response_data,
1620
+ response_types_map=_response_types_map,
1621
+ )
1622
+
1623
+ @validate_call
1624
+ async def v1_workflow_run_task_events_list_without_preload_content(
1625
+ self,
1626
+ v1_workflow_run: Annotated[
1627
+ str,
1628
+ Field(
1629
+ min_length=36,
1630
+ strict=True,
1631
+ max_length=36,
1632
+ description="The workflow run id to find runs for",
1633
+ ),
1634
+ ],
1635
+ offset: Annotated[
1636
+ Optional[StrictInt], Field(description="The number to skip")
1637
+ ] = None,
1638
+ limit: Annotated[
1639
+ Optional[StrictInt], Field(description="The number to limit by")
1640
+ ] = None,
1641
+ _request_timeout: Union[
1642
+ None,
1643
+ Annotated[StrictFloat, Field(gt=0)],
1644
+ Tuple[
1645
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1646
+ ],
1647
+ ] = None,
1648
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1649
+ _content_type: Optional[StrictStr] = None,
1650
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1651
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1652
+ ) -> RESTResponseType:
1653
+ """List tasks
1654
+
1655
+ List all tasks for a workflow run
1656
+
1657
+ :param v1_workflow_run: The workflow run id to find runs for (required)
1658
+ :type v1_workflow_run: str
1659
+ :param offset: The number to skip
1660
+ :type offset: int
1661
+ :param limit: The number to limit by
1662
+ :type limit: int
1663
+ :param _request_timeout: timeout setting for this request. If one
1664
+ number provided, it will be total request
1665
+ timeout. It can also be a pair (tuple) of
1666
+ (connection, read) timeouts.
1667
+ :type _request_timeout: int, tuple(int, int), optional
1668
+ :param _request_auth: set to override the auth_settings for an a single
1669
+ request; this effectively ignores the
1670
+ authentication in the spec for a single request.
1671
+ :type _request_auth: dict, optional
1672
+ :param _content_type: force content-type for the request.
1673
+ :type _content_type: str, Optional
1674
+ :param _headers: set to override the headers for a single
1675
+ request; this effectively ignores the headers
1676
+ in the spec for a single request.
1677
+ :type _headers: dict, optional
1678
+ :param _host_index: set to override the host_index for a single
1679
+ request; this effectively ignores the host_index
1680
+ in the spec for a single request.
1681
+ :type _host_index: int, optional
1682
+ :return: Returns the result object.
1683
+ """ # noqa: E501
1684
+
1685
+ _param = self._v1_workflow_run_task_events_list_serialize(
1686
+ v1_workflow_run=v1_workflow_run,
1687
+ offset=offset,
1688
+ limit=limit,
1689
+ _request_auth=_request_auth,
1690
+ _content_type=_content_type,
1691
+ _headers=_headers,
1692
+ _host_index=_host_index,
1693
+ )
1694
+
1695
+ _response_types_map: Dict[str, Optional[str]] = {
1696
+ "200": "V1TaskEventList",
1697
+ "400": "APIErrors",
1698
+ "403": "APIErrors",
1699
+ "501": "APIErrors",
1700
+ }
1701
+ response_data = await self.api_client.call_api(
1702
+ *_param, _request_timeout=_request_timeout
1703
+ )
1704
+ return response_data.response
1705
+
1706
+ def _v1_workflow_run_task_events_list_serialize(
1707
+ self,
1708
+ v1_workflow_run,
1709
+ offset,
1710
+ limit,
1711
+ _request_auth,
1712
+ _content_type,
1713
+ _headers,
1714
+ _host_index,
1715
+ ) -> RequestSerialized:
1716
+
1717
+ _host = None
1718
+
1719
+ _collection_formats: Dict[str, str] = {}
1720
+
1721
+ _path_params: Dict[str, str] = {}
1722
+ _query_params: List[Tuple[str, str]] = []
1723
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1724
+ _form_params: List[Tuple[str, str]] = []
1725
+ _files: Dict[
1726
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1727
+ ] = {}
1728
+ _body_params: Optional[bytes] = None
1729
+
1730
+ # process the path parameters
1731
+ if v1_workflow_run is not None:
1732
+ _path_params["v1-workflow-run"] = v1_workflow_run
1733
+ # process the query parameters
1734
+ if offset is not None:
1735
+
1736
+ _query_params.append(("offset", offset))
1737
+
1738
+ if limit is not None:
1739
+
1740
+ _query_params.append(("limit", limit))
1741
+
1742
+ # process the header parameters
1743
+ # process the form parameters
1744
+ # process the body parameter
1745
+
1746
+ # set the HTTP header `Accept`
1747
+ if "Accept" not in _header_params:
1748
+ _header_params["Accept"] = self.api_client.select_header_accept(
1749
+ ["application/json"]
1750
+ )
1751
+
1752
+ # authentication setting
1753
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1754
+
1755
+ return self.api_client.param_serialize(
1756
+ method="GET",
1757
+ resource_path="/api/v1/stable/workflow-runs/{v1-workflow-run}/task-events",
600
1758
  path_params=_path_params,
601
1759
  query_params=_query_params,
602
1760
  header_params=_header_params,