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
@@ -0,0 +1,2200 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hatchet API
5
+
6
+ The Hatchet API
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from datetime import datetime
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+
18
+ from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
19
+ from typing_extensions import Annotated
20
+
21
+ from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
22
+ from hatchet_sdk.clients.rest.api_response import ApiResponse
23
+ from hatchet_sdk.clients.rest.models.v1_cancel_task_request import V1CancelTaskRequest
24
+ from hatchet_sdk.clients.rest.models.v1_dag_children import V1DagChildren
25
+ from hatchet_sdk.clients.rest.models.v1_replay_task_request import V1ReplayTaskRequest
26
+ from hatchet_sdk.clients.rest.models.v1_task_event_list import V1TaskEventList
27
+ from hatchet_sdk.clients.rest.models.v1_task_point_metrics import V1TaskPointMetrics
28
+ from hatchet_sdk.clients.rest.models.v1_task_run_metric import V1TaskRunMetric
29
+ from hatchet_sdk.clients.rest.models.v1_task_summary import V1TaskSummary
30
+ from hatchet_sdk.clients.rest.rest import RESTResponseType
31
+
32
+
33
+ class TaskApi:
34
+ """NOTE: This class is auto generated by OpenAPI Generator
35
+ Ref: https://openapi-generator.tech
36
+
37
+ Do not edit the class manually.
38
+ """
39
+
40
+ def __init__(self, api_client=None) -> None:
41
+ if api_client is None:
42
+ api_client = ApiClient.get_default()
43
+ self.api_client = api_client
44
+
45
+ @validate_call
46
+ async def v1_dag_list_tasks(
47
+ self,
48
+ dag_ids: Annotated[
49
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
50
+ Field(description="The external id of the DAG"),
51
+ ],
52
+ tenant: Annotated[
53
+ str,
54
+ Field(
55
+ min_length=36, strict=True, max_length=36, description="The tenant id"
56
+ ),
57
+ ],
58
+ _request_timeout: Union[
59
+ None,
60
+ Annotated[StrictFloat, Field(gt=0)],
61
+ Tuple[
62
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
63
+ ],
64
+ ] = None,
65
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
66
+ _content_type: Optional[StrictStr] = None,
67
+ _headers: Optional[Dict[StrictStr, Any]] = None,
68
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
69
+ ) -> List[V1DagChildren]:
70
+ """List tasks
71
+
72
+ Lists all tasks that belong a specific list of dags
73
+
74
+ :param dag_ids: The external id of the DAG (required)
75
+ :type dag_ids: List[str]
76
+ :param tenant: The tenant id (required)
77
+ :type tenant: str
78
+ :param _request_timeout: timeout setting for this request. If one
79
+ number provided, it will be total request
80
+ timeout. It can also be a pair (tuple) of
81
+ (connection, read) timeouts.
82
+ :type _request_timeout: int, tuple(int, int), optional
83
+ :param _request_auth: set to override the auth_settings for an a single
84
+ request; this effectively ignores the
85
+ authentication in the spec for a single request.
86
+ :type _request_auth: dict, optional
87
+ :param _content_type: force content-type for the request.
88
+ :type _content_type: str, Optional
89
+ :param _headers: set to override the headers for a single
90
+ request; this effectively ignores the headers
91
+ in the spec for a single request.
92
+ :type _headers: dict, optional
93
+ :param _host_index: set to override the host_index for a single
94
+ request; this effectively ignores the host_index
95
+ in the spec for a single request.
96
+ :type _host_index: int, optional
97
+ :return: Returns the result object.
98
+ """ # noqa: E501
99
+
100
+ _param = self._v1_dag_list_tasks_serialize(
101
+ dag_ids=dag_ids,
102
+ tenant=tenant,
103
+ _request_auth=_request_auth,
104
+ _content_type=_content_type,
105
+ _headers=_headers,
106
+ _host_index=_host_index,
107
+ )
108
+
109
+ _response_types_map: Dict[str, Optional[str]] = {
110
+ "200": "List[V1DagChildren]",
111
+ "400": "APIErrors",
112
+ "403": "APIErrors",
113
+ "501": "APIErrors",
114
+ }
115
+ response_data = await self.api_client.call_api(
116
+ *_param, _request_timeout=_request_timeout
117
+ )
118
+ await response_data.read()
119
+ return self.api_client.response_deserialize(
120
+ response_data=response_data,
121
+ response_types_map=_response_types_map,
122
+ ).data
123
+
124
+ @validate_call
125
+ async def v1_dag_list_tasks_with_http_info(
126
+ self,
127
+ dag_ids: Annotated[
128
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
129
+ Field(description="The external id of the DAG"),
130
+ ],
131
+ tenant: Annotated[
132
+ str,
133
+ Field(
134
+ min_length=36, strict=True, max_length=36, description="The tenant id"
135
+ ),
136
+ ],
137
+ _request_timeout: Union[
138
+ None,
139
+ Annotated[StrictFloat, Field(gt=0)],
140
+ Tuple[
141
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
142
+ ],
143
+ ] = None,
144
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
145
+ _content_type: Optional[StrictStr] = None,
146
+ _headers: Optional[Dict[StrictStr, Any]] = None,
147
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
148
+ ) -> ApiResponse[List[V1DagChildren]]:
149
+ """List tasks
150
+
151
+ Lists all tasks that belong a specific list of dags
152
+
153
+ :param dag_ids: The external id of the DAG (required)
154
+ :type dag_ids: List[str]
155
+ :param tenant: The tenant id (required)
156
+ :type tenant: str
157
+ :param _request_timeout: timeout setting for this request. If one
158
+ number provided, it will be total request
159
+ timeout. It can also be a pair (tuple) of
160
+ (connection, read) timeouts.
161
+ :type _request_timeout: int, tuple(int, int), optional
162
+ :param _request_auth: set to override the auth_settings for an a single
163
+ request; this effectively ignores the
164
+ authentication in the spec for a single request.
165
+ :type _request_auth: dict, optional
166
+ :param _content_type: force content-type for the request.
167
+ :type _content_type: str, Optional
168
+ :param _headers: set to override the headers for a single
169
+ request; this effectively ignores the headers
170
+ in the spec for a single request.
171
+ :type _headers: dict, optional
172
+ :param _host_index: set to override the host_index for a single
173
+ request; this effectively ignores the host_index
174
+ in the spec for a single request.
175
+ :type _host_index: int, optional
176
+ :return: Returns the result object.
177
+ """ # noqa: E501
178
+
179
+ _param = self._v1_dag_list_tasks_serialize(
180
+ dag_ids=dag_ids,
181
+ tenant=tenant,
182
+ _request_auth=_request_auth,
183
+ _content_type=_content_type,
184
+ _headers=_headers,
185
+ _host_index=_host_index,
186
+ )
187
+
188
+ _response_types_map: Dict[str, Optional[str]] = {
189
+ "200": "List[V1DagChildren]",
190
+ "400": "APIErrors",
191
+ "403": "APIErrors",
192
+ "501": "APIErrors",
193
+ }
194
+ response_data = await self.api_client.call_api(
195
+ *_param, _request_timeout=_request_timeout
196
+ )
197
+ await response_data.read()
198
+ return self.api_client.response_deserialize(
199
+ response_data=response_data,
200
+ response_types_map=_response_types_map,
201
+ )
202
+
203
+ @validate_call
204
+ async def v1_dag_list_tasks_without_preload_content(
205
+ self,
206
+ dag_ids: Annotated[
207
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
208
+ Field(description="The external id of the DAG"),
209
+ ],
210
+ tenant: Annotated[
211
+ str,
212
+ Field(
213
+ min_length=36, strict=True, max_length=36, description="The tenant id"
214
+ ),
215
+ ],
216
+ _request_timeout: Union[
217
+ None,
218
+ Annotated[StrictFloat, Field(gt=0)],
219
+ Tuple[
220
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
221
+ ],
222
+ ] = None,
223
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
224
+ _content_type: Optional[StrictStr] = None,
225
+ _headers: Optional[Dict[StrictStr, Any]] = None,
226
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
227
+ ) -> RESTResponseType:
228
+ """List tasks
229
+
230
+ Lists all tasks that belong a specific list of dags
231
+
232
+ :param dag_ids: The external id of the DAG (required)
233
+ :type dag_ids: List[str]
234
+ :param tenant: The tenant id (required)
235
+ :type tenant: str
236
+ :param _request_timeout: timeout setting for this request. If one
237
+ number provided, it will be total request
238
+ timeout. It can also be a pair (tuple) of
239
+ (connection, read) timeouts.
240
+ :type _request_timeout: int, tuple(int, int), optional
241
+ :param _request_auth: set to override the auth_settings for an a single
242
+ request; this effectively ignores the
243
+ authentication in the spec for a single request.
244
+ :type _request_auth: dict, optional
245
+ :param _content_type: force content-type for the request.
246
+ :type _content_type: str, Optional
247
+ :param _headers: set to override the headers for a single
248
+ request; this effectively ignores the headers
249
+ in the spec for a single request.
250
+ :type _headers: dict, optional
251
+ :param _host_index: set to override the host_index for a single
252
+ request; this effectively ignores the host_index
253
+ in the spec for a single request.
254
+ :type _host_index: int, optional
255
+ :return: Returns the result object.
256
+ """ # noqa: E501
257
+
258
+ _param = self._v1_dag_list_tasks_serialize(
259
+ dag_ids=dag_ids,
260
+ tenant=tenant,
261
+ _request_auth=_request_auth,
262
+ _content_type=_content_type,
263
+ _headers=_headers,
264
+ _host_index=_host_index,
265
+ )
266
+
267
+ _response_types_map: Dict[str, Optional[str]] = {
268
+ "200": "List[V1DagChildren]",
269
+ "400": "APIErrors",
270
+ "403": "APIErrors",
271
+ "501": "APIErrors",
272
+ }
273
+ response_data = await self.api_client.call_api(
274
+ *_param, _request_timeout=_request_timeout
275
+ )
276
+ return response_data.response
277
+
278
+ def _v1_dag_list_tasks_serialize(
279
+ self,
280
+ dag_ids,
281
+ tenant,
282
+ _request_auth,
283
+ _content_type,
284
+ _headers,
285
+ _host_index,
286
+ ) -> RequestSerialized:
287
+
288
+ _host = None
289
+
290
+ _collection_formats: Dict[str, str] = {
291
+ "dag_ids": "multi",
292
+ }
293
+
294
+ _path_params: Dict[str, str] = {}
295
+ _query_params: List[Tuple[str, str]] = []
296
+ _header_params: Dict[str, Optional[str]] = _headers or {}
297
+ _form_params: List[Tuple[str, str]] = []
298
+ _files: Dict[
299
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
300
+ ] = {}
301
+ _body_params: Optional[bytes] = None
302
+
303
+ # process the path parameters
304
+ # process the query parameters
305
+ if dag_ids is not None:
306
+
307
+ _query_params.append(("dag_ids", dag_ids))
308
+
309
+ if tenant is not None:
310
+
311
+ _query_params.append(("tenant", tenant))
312
+
313
+ # process the header parameters
314
+ # process the form parameters
315
+ # process the body parameter
316
+
317
+ # set the HTTP header `Accept`
318
+ if "Accept" not in _header_params:
319
+ _header_params["Accept"] = self.api_client.select_header_accept(
320
+ ["application/json"]
321
+ )
322
+
323
+ # authentication setting
324
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
325
+
326
+ return self.api_client.param_serialize(
327
+ method="GET",
328
+ resource_path="/api/v1/stable/dags/tasks",
329
+ path_params=_path_params,
330
+ query_params=_query_params,
331
+ header_params=_header_params,
332
+ body=_body_params,
333
+ post_params=_form_params,
334
+ files=_files,
335
+ auth_settings=_auth_settings,
336
+ collection_formats=_collection_formats,
337
+ _host=_host,
338
+ _request_auth=_request_auth,
339
+ )
340
+
341
+ @validate_call
342
+ async def v1_task_cancel(
343
+ self,
344
+ tenant: Annotated[
345
+ str,
346
+ Field(
347
+ min_length=36, strict=True, max_length=36, description="The tenant id"
348
+ ),
349
+ ],
350
+ v1_cancel_task_request: Annotated[
351
+ V1CancelTaskRequest, Field(description="The tasks to cancel")
352
+ ],
353
+ _request_timeout: Union[
354
+ None,
355
+ Annotated[StrictFloat, Field(gt=0)],
356
+ Tuple[
357
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
358
+ ],
359
+ ] = None,
360
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
361
+ _content_type: Optional[StrictStr] = None,
362
+ _headers: Optional[Dict[StrictStr, Any]] = None,
363
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
364
+ ) -> None:
365
+ """Cancel tasks
366
+
367
+ Cancel tasks
368
+
369
+ :param tenant: The tenant id (required)
370
+ :type tenant: str
371
+ :param v1_cancel_task_request: The tasks to cancel (required)
372
+ :type v1_cancel_task_request: V1CancelTaskRequest
373
+ :param _request_timeout: timeout setting for this request. If one
374
+ number provided, it will be total request
375
+ timeout. It can also be a pair (tuple) of
376
+ (connection, read) timeouts.
377
+ :type _request_timeout: int, tuple(int, int), optional
378
+ :param _request_auth: set to override the auth_settings for an a single
379
+ request; this effectively ignores the
380
+ authentication in the spec for a single request.
381
+ :type _request_auth: dict, optional
382
+ :param _content_type: force content-type for the request.
383
+ :type _content_type: str, Optional
384
+ :param _headers: set to override the headers for a single
385
+ request; this effectively ignores the headers
386
+ in the spec for a single request.
387
+ :type _headers: dict, optional
388
+ :param _host_index: set to override the host_index for a single
389
+ request; this effectively ignores the host_index
390
+ in the spec for a single request.
391
+ :type _host_index: int, optional
392
+ :return: Returns the result object.
393
+ """ # noqa: E501
394
+
395
+ _param = self._v1_task_cancel_serialize(
396
+ tenant=tenant,
397
+ v1_cancel_task_request=v1_cancel_task_request,
398
+ _request_auth=_request_auth,
399
+ _content_type=_content_type,
400
+ _headers=_headers,
401
+ _host_index=_host_index,
402
+ )
403
+
404
+ _response_types_map: Dict[str, Optional[str]] = {
405
+ "200": None,
406
+ "400": "APIErrors",
407
+ "403": "APIErrors",
408
+ "404": "APIErrors",
409
+ "501": "APIErrors",
410
+ }
411
+ response_data = await self.api_client.call_api(
412
+ *_param, _request_timeout=_request_timeout
413
+ )
414
+ await response_data.read()
415
+ return self.api_client.response_deserialize(
416
+ response_data=response_data,
417
+ response_types_map=_response_types_map,
418
+ ).data
419
+
420
+ @validate_call
421
+ async def v1_task_cancel_with_http_info(
422
+ self,
423
+ tenant: Annotated[
424
+ str,
425
+ Field(
426
+ min_length=36, strict=True, max_length=36, description="The tenant id"
427
+ ),
428
+ ],
429
+ v1_cancel_task_request: Annotated[
430
+ V1CancelTaskRequest, Field(description="The tasks to cancel")
431
+ ],
432
+ _request_timeout: Union[
433
+ None,
434
+ Annotated[StrictFloat, Field(gt=0)],
435
+ Tuple[
436
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
437
+ ],
438
+ ] = None,
439
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
440
+ _content_type: Optional[StrictStr] = None,
441
+ _headers: Optional[Dict[StrictStr, Any]] = None,
442
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
443
+ ) -> ApiResponse[None]:
444
+ """Cancel tasks
445
+
446
+ Cancel tasks
447
+
448
+ :param tenant: The tenant id (required)
449
+ :type tenant: str
450
+ :param v1_cancel_task_request: The tasks to cancel (required)
451
+ :type v1_cancel_task_request: V1CancelTaskRequest
452
+ :param _request_timeout: timeout setting for this request. If one
453
+ number provided, it will be total request
454
+ timeout. It can also be a pair (tuple) of
455
+ (connection, read) timeouts.
456
+ :type _request_timeout: int, tuple(int, int), optional
457
+ :param _request_auth: set to override the auth_settings for an a single
458
+ request; this effectively ignores the
459
+ authentication in the spec for a single request.
460
+ :type _request_auth: dict, optional
461
+ :param _content_type: force content-type for the request.
462
+ :type _content_type: str, Optional
463
+ :param _headers: set to override the headers for a single
464
+ request; this effectively ignores the headers
465
+ in the spec for a single request.
466
+ :type _headers: dict, optional
467
+ :param _host_index: set to override the host_index for a single
468
+ request; this effectively ignores the host_index
469
+ in the spec for a single request.
470
+ :type _host_index: int, optional
471
+ :return: Returns the result object.
472
+ """ # noqa: E501
473
+
474
+ _param = self._v1_task_cancel_serialize(
475
+ tenant=tenant,
476
+ v1_cancel_task_request=v1_cancel_task_request,
477
+ _request_auth=_request_auth,
478
+ _content_type=_content_type,
479
+ _headers=_headers,
480
+ _host_index=_host_index,
481
+ )
482
+
483
+ _response_types_map: Dict[str, Optional[str]] = {
484
+ "200": None,
485
+ "400": "APIErrors",
486
+ "403": "APIErrors",
487
+ "404": "APIErrors",
488
+ "501": "APIErrors",
489
+ }
490
+ response_data = await self.api_client.call_api(
491
+ *_param, _request_timeout=_request_timeout
492
+ )
493
+ await response_data.read()
494
+ return self.api_client.response_deserialize(
495
+ response_data=response_data,
496
+ response_types_map=_response_types_map,
497
+ )
498
+
499
+ @validate_call
500
+ async def v1_task_cancel_without_preload_content(
501
+ self,
502
+ tenant: Annotated[
503
+ str,
504
+ Field(
505
+ min_length=36, strict=True, max_length=36, description="The tenant id"
506
+ ),
507
+ ],
508
+ v1_cancel_task_request: Annotated[
509
+ V1CancelTaskRequest, Field(description="The tasks to cancel")
510
+ ],
511
+ _request_timeout: Union[
512
+ None,
513
+ Annotated[StrictFloat, Field(gt=0)],
514
+ Tuple[
515
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
516
+ ],
517
+ ] = None,
518
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
519
+ _content_type: Optional[StrictStr] = None,
520
+ _headers: Optional[Dict[StrictStr, Any]] = None,
521
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
522
+ ) -> RESTResponseType:
523
+ """Cancel tasks
524
+
525
+ Cancel tasks
526
+
527
+ :param tenant: The tenant id (required)
528
+ :type tenant: str
529
+ :param v1_cancel_task_request: The tasks to cancel (required)
530
+ :type v1_cancel_task_request: V1CancelTaskRequest
531
+ :param _request_timeout: timeout setting for this request. If one
532
+ number provided, it will be total request
533
+ timeout. It can also be a pair (tuple) of
534
+ (connection, read) timeouts.
535
+ :type _request_timeout: int, tuple(int, int), optional
536
+ :param _request_auth: set to override the auth_settings for an a single
537
+ request; this effectively ignores the
538
+ authentication in the spec for a single request.
539
+ :type _request_auth: dict, optional
540
+ :param _content_type: force content-type for the request.
541
+ :type _content_type: str, Optional
542
+ :param _headers: set to override the headers for a single
543
+ request; this effectively ignores the headers
544
+ in the spec for a single request.
545
+ :type _headers: dict, optional
546
+ :param _host_index: set to override the host_index for a single
547
+ request; this effectively ignores the host_index
548
+ in the spec for a single request.
549
+ :type _host_index: int, optional
550
+ :return: Returns the result object.
551
+ """ # noqa: E501
552
+
553
+ _param = self._v1_task_cancel_serialize(
554
+ tenant=tenant,
555
+ v1_cancel_task_request=v1_cancel_task_request,
556
+ _request_auth=_request_auth,
557
+ _content_type=_content_type,
558
+ _headers=_headers,
559
+ _host_index=_host_index,
560
+ )
561
+
562
+ _response_types_map: Dict[str, Optional[str]] = {
563
+ "200": None,
564
+ "400": "APIErrors",
565
+ "403": "APIErrors",
566
+ "404": "APIErrors",
567
+ "501": "APIErrors",
568
+ }
569
+ response_data = await self.api_client.call_api(
570
+ *_param, _request_timeout=_request_timeout
571
+ )
572
+ return response_data.response
573
+
574
+ def _v1_task_cancel_serialize(
575
+ self,
576
+ tenant,
577
+ v1_cancel_task_request,
578
+ _request_auth,
579
+ _content_type,
580
+ _headers,
581
+ _host_index,
582
+ ) -> RequestSerialized:
583
+
584
+ _host = None
585
+
586
+ _collection_formats: Dict[str, str] = {}
587
+
588
+ _path_params: Dict[str, str] = {}
589
+ _query_params: List[Tuple[str, str]] = []
590
+ _header_params: Dict[str, Optional[str]] = _headers or {}
591
+ _form_params: List[Tuple[str, str]] = []
592
+ _files: Dict[
593
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
594
+ ] = {}
595
+ _body_params: Optional[bytes] = None
596
+
597
+ # process the path parameters
598
+ if tenant is not None:
599
+ _path_params["tenant"] = tenant
600
+ # process the query parameters
601
+ # process the header parameters
602
+ # process the form parameters
603
+ # process the body parameter
604
+ if v1_cancel_task_request is not None:
605
+ _body_params = v1_cancel_task_request
606
+
607
+ # set the HTTP header `Accept`
608
+ if "Accept" not in _header_params:
609
+ _header_params["Accept"] = self.api_client.select_header_accept(
610
+ ["application/json"]
611
+ )
612
+
613
+ # set the HTTP header `Content-Type`
614
+ if _content_type:
615
+ _header_params["Content-Type"] = _content_type
616
+ else:
617
+ _default_content_type = self.api_client.select_header_content_type(
618
+ ["application/json"]
619
+ )
620
+ if _default_content_type is not None:
621
+ _header_params["Content-Type"] = _default_content_type
622
+
623
+ # authentication setting
624
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
625
+
626
+ return self.api_client.param_serialize(
627
+ method="POST",
628
+ resource_path="/api/v1/stable/tenants/{tenant}/tasks/cancel",
629
+ path_params=_path_params,
630
+ query_params=_query_params,
631
+ header_params=_header_params,
632
+ body=_body_params,
633
+ post_params=_form_params,
634
+ files=_files,
635
+ auth_settings=_auth_settings,
636
+ collection_formats=_collection_formats,
637
+ _host=_host,
638
+ _request_auth=_request_auth,
639
+ )
640
+
641
+ @validate_call
642
+ async def v1_task_event_list(
643
+ self,
644
+ task: Annotated[
645
+ str,
646
+ Field(min_length=36, strict=True, max_length=36, description="The task id"),
647
+ ],
648
+ offset: Annotated[
649
+ Optional[StrictInt], Field(description="The number to skip")
650
+ ] = None,
651
+ limit: Annotated[
652
+ Optional[StrictInt], Field(description="The number to limit by")
653
+ ] = None,
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
+ ) -> V1TaskEventList:
666
+ """List events for a task
667
+
668
+ List events for a task
669
+
670
+ :param task: The task id (required)
671
+ :type task: str
672
+ :param offset: The number to skip
673
+ :type offset: int
674
+ :param limit: The number to limit by
675
+ :type limit: int
676
+ :param _request_timeout: timeout setting for this request. If one
677
+ number provided, it will be total request
678
+ timeout. It can also be a pair (tuple) of
679
+ (connection, read) timeouts.
680
+ :type _request_timeout: int, tuple(int, int), optional
681
+ :param _request_auth: set to override the auth_settings for an a single
682
+ request; this effectively ignores the
683
+ authentication in the spec for a single request.
684
+ :type _request_auth: dict, optional
685
+ :param _content_type: force content-type for the request.
686
+ :type _content_type: str, Optional
687
+ :param _headers: set to override the headers for a single
688
+ request; this effectively ignores the headers
689
+ in the spec for a single request.
690
+ :type _headers: dict, optional
691
+ :param _host_index: set to override the host_index for a single
692
+ request; this effectively ignores the host_index
693
+ in the spec for a single request.
694
+ :type _host_index: int, optional
695
+ :return: Returns the result object.
696
+ """ # noqa: E501
697
+
698
+ _param = self._v1_task_event_list_serialize(
699
+ task=task,
700
+ offset=offset,
701
+ limit=limit,
702
+ _request_auth=_request_auth,
703
+ _content_type=_content_type,
704
+ _headers=_headers,
705
+ _host_index=_host_index,
706
+ )
707
+
708
+ _response_types_map: Dict[str, Optional[str]] = {
709
+ "200": "V1TaskEventList",
710
+ "400": "APIErrors",
711
+ "403": "APIErrors",
712
+ "404": "APIErrors",
713
+ "501": "APIErrors",
714
+ }
715
+ response_data = await self.api_client.call_api(
716
+ *_param, _request_timeout=_request_timeout
717
+ )
718
+ await response_data.read()
719
+ return self.api_client.response_deserialize(
720
+ response_data=response_data,
721
+ response_types_map=_response_types_map,
722
+ ).data
723
+
724
+ @validate_call
725
+ async def v1_task_event_list_with_http_info(
726
+ self,
727
+ task: Annotated[
728
+ str,
729
+ Field(min_length=36, strict=True, max_length=36, description="The task id"),
730
+ ],
731
+ offset: Annotated[
732
+ Optional[StrictInt], Field(description="The number to skip")
733
+ ] = None,
734
+ limit: Annotated[
735
+ Optional[StrictInt], Field(description="The number to limit by")
736
+ ] = None,
737
+ _request_timeout: Union[
738
+ None,
739
+ Annotated[StrictFloat, Field(gt=0)],
740
+ Tuple[
741
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
742
+ ],
743
+ ] = None,
744
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
745
+ _content_type: Optional[StrictStr] = None,
746
+ _headers: Optional[Dict[StrictStr, Any]] = None,
747
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
748
+ ) -> ApiResponse[V1TaskEventList]:
749
+ """List events for a task
750
+
751
+ List events for a task
752
+
753
+ :param task: The task id (required)
754
+ :type task: str
755
+ :param offset: The number to skip
756
+ :type offset: int
757
+ :param limit: The number to limit by
758
+ :type limit: int
759
+ :param _request_timeout: timeout setting for this request. If one
760
+ number provided, it will be total request
761
+ timeout. It can also be a pair (tuple) of
762
+ (connection, read) timeouts.
763
+ :type _request_timeout: int, tuple(int, int), optional
764
+ :param _request_auth: set to override the auth_settings for an a single
765
+ request; this effectively ignores the
766
+ authentication in the spec for a single request.
767
+ :type _request_auth: dict, optional
768
+ :param _content_type: force content-type for the request.
769
+ :type _content_type: str, Optional
770
+ :param _headers: set to override the headers for a single
771
+ request; this effectively ignores the headers
772
+ in the spec for a single request.
773
+ :type _headers: dict, optional
774
+ :param _host_index: set to override the host_index for a single
775
+ request; this effectively ignores the host_index
776
+ in the spec for a single request.
777
+ :type _host_index: int, optional
778
+ :return: Returns the result object.
779
+ """ # noqa: E501
780
+
781
+ _param = self._v1_task_event_list_serialize(
782
+ task=task,
783
+ offset=offset,
784
+ limit=limit,
785
+ _request_auth=_request_auth,
786
+ _content_type=_content_type,
787
+ _headers=_headers,
788
+ _host_index=_host_index,
789
+ )
790
+
791
+ _response_types_map: Dict[str, Optional[str]] = {
792
+ "200": "V1TaskEventList",
793
+ "400": "APIErrors",
794
+ "403": "APIErrors",
795
+ "404": "APIErrors",
796
+ "501": "APIErrors",
797
+ }
798
+ response_data = await self.api_client.call_api(
799
+ *_param, _request_timeout=_request_timeout
800
+ )
801
+ await response_data.read()
802
+ return self.api_client.response_deserialize(
803
+ response_data=response_data,
804
+ response_types_map=_response_types_map,
805
+ )
806
+
807
+ @validate_call
808
+ async def v1_task_event_list_without_preload_content(
809
+ self,
810
+ task: Annotated[
811
+ str,
812
+ Field(min_length=36, strict=True, max_length=36, description="The task id"),
813
+ ],
814
+ offset: Annotated[
815
+ Optional[StrictInt], Field(description="The number to skip")
816
+ ] = None,
817
+ limit: Annotated[
818
+ Optional[StrictInt], Field(description="The number to limit by")
819
+ ] = None,
820
+ _request_timeout: Union[
821
+ None,
822
+ Annotated[StrictFloat, Field(gt=0)],
823
+ Tuple[
824
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
825
+ ],
826
+ ] = None,
827
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
828
+ _content_type: Optional[StrictStr] = None,
829
+ _headers: Optional[Dict[StrictStr, Any]] = None,
830
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
831
+ ) -> RESTResponseType:
832
+ """List events for a task
833
+
834
+ List events for a task
835
+
836
+ :param task: The task id (required)
837
+ :type task: str
838
+ :param offset: The number to skip
839
+ :type offset: int
840
+ :param limit: The number to limit by
841
+ :type limit: int
842
+ :param _request_timeout: timeout setting for this request. If one
843
+ number provided, it will be total request
844
+ timeout. It can also be a pair (tuple) of
845
+ (connection, read) timeouts.
846
+ :type _request_timeout: int, tuple(int, int), optional
847
+ :param _request_auth: set to override the auth_settings for an a single
848
+ request; this effectively ignores the
849
+ authentication in the spec for a single request.
850
+ :type _request_auth: dict, optional
851
+ :param _content_type: force content-type for the request.
852
+ :type _content_type: str, Optional
853
+ :param _headers: set to override the headers for a single
854
+ request; this effectively ignores the headers
855
+ in the spec for a single request.
856
+ :type _headers: dict, optional
857
+ :param _host_index: set to override the host_index for a single
858
+ request; this effectively ignores the host_index
859
+ in the spec for a single request.
860
+ :type _host_index: int, optional
861
+ :return: Returns the result object.
862
+ """ # noqa: E501
863
+
864
+ _param = self._v1_task_event_list_serialize(
865
+ task=task,
866
+ offset=offset,
867
+ limit=limit,
868
+ _request_auth=_request_auth,
869
+ _content_type=_content_type,
870
+ _headers=_headers,
871
+ _host_index=_host_index,
872
+ )
873
+
874
+ _response_types_map: Dict[str, Optional[str]] = {
875
+ "200": "V1TaskEventList",
876
+ "400": "APIErrors",
877
+ "403": "APIErrors",
878
+ "404": "APIErrors",
879
+ "501": "APIErrors",
880
+ }
881
+ response_data = await self.api_client.call_api(
882
+ *_param, _request_timeout=_request_timeout
883
+ )
884
+ return response_data.response
885
+
886
+ def _v1_task_event_list_serialize(
887
+ self,
888
+ task,
889
+ offset,
890
+ limit,
891
+ _request_auth,
892
+ _content_type,
893
+ _headers,
894
+ _host_index,
895
+ ) -> RequestSerialized:
896
+
897
+ _host = None
898
+
899
+ _collection_formats: Dict[str, str] = {}
900
+
901
+ _path_params: Dict[str, str] = {}
902
+ _query_params: List[Tuple[str, str]] = []
903
+ _header_params: Dict[str, Optional[str]] = _headers or {}
904
+ _form_params: List[Tuple[str, str]] = []
905
+ _files: Dict[
906
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
907
+ ] = {}
908
+ _body_params: Optional[bytes] = None
909
+
910
+ # process the path parameters
911
+ if task is not None:
912
+ _path_params["task"] = task
913
+ # process the query parameters
914
+ if offset is not None:
915
+
916
+ _query_params.append(("offset", offset))
917
+
918
+ if limit is not None:
919
+
920
+ _query_params.append(("limit", limit))
921
+
922
+ # process the header parameters
923
+ # process the form parameters
924
+ # process the body parameter
925
+
926
+ # set the HTTP header `Accept`
927
+ if "Accept" not in _header_params:
928
+ _header_params["Accept"] = self.api_client.select_header_accept(
929
+ ["application/json"]
930
+ )
931
+
932
+ # authentication setting
933
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
934
+
935
+ return self.api_client.param_serialize(
936
+ method="GET",
937
+ resource_path="/api/v1/stable/tasks/{task}/task-events",
938
+ path_params=_path_params,
939
+ query_params=_query_params,
940
+ header_params=_header_params,
941
+ body=_body_params,
942
+ post_params=_form_params,
943
+ files=_files,
944
+ auth_settings=_auth_settings,
945
+ collection_formats=_collection_formats,
946
+ _host=_host,
947
+ _request_auth=_request_auth,
948
+ )
949
+
950
+ @validate_call
951
+ async def v1_task_get(
952
+ self,
953
+ task: Annotated[
954
+ str,
955
+ Field(min_length=36, strict=True, max_length=36, description="The task id"),
956
+ ],
957
+ _request_timeout: Union[
958
+ None,
959
+ Annotated[StrictFloat, Field(gt=0)],
960
+ Tuple[
961
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
962
+ ],
963
+ ] = None,
964
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
965
+ _content_type: Optional[StrictStr] = None,
966
+ _headers: Optional[Dict[StrictStr, Any]] = None,
967
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
968
+ ) -> V1TaskSummary:
969
+ """Get a task
970
+
971
+ Get a task by id
972
+
973
+ :param task: The task id (required)
974
+ :type task: str
975
+ :param _request_timeout: timeout setting for this request. If one
976
+ number provided, it will be total request
977
+ timeout. It can also be a pair (tuple) of
978
+ (connection, read) timeouts.
979
+ :type _request_timeout: int, tuple(int, int), optional
980
+ :param _request_auth: set to override the auth_settings for an a single
981
+ request; this effectively ignores the
982
+ authentication in the spec for a single request.
983
+ :type _request_auth: dict, optional
984
+ :param _content_type: force content-type for the request.
985
+ :type _content_type: str, Optional
986
+ :param _headers: set to override the headers for a single
987
+ request; this effectively ignores the headers
988
+ in the spec for a single request.
989
+ :type _headers: dict, optional
990
+ :param _host_index: set to override the host_index for a single
991
+ request; this effectively ignores the host_index
992
+ in the spec for a single request.
993
+ :type _host_index: int, optional
994
+ :return: Returns the result object.
995
+ """ # noqa: E501
996
+
997
+ _param = self._v1_task_get_serialize(
998
+ task=task,
999
+ _request_auth=_request_auth,
1000
+ _content_type=_content_type,
1001
+ _headers=_headers,
1002
+ _host_index=_host_index,
1003
+ )
1004
+
1005
+ _response_types_map: Dict[str, Optional[str]] = {
1006
+ "200": "V1TaskSummary",
1007
+ "400": "APIErrors",
1008
+ "403": "APIErrors",
1009
+ "404": "APIErrors",
1010
+ "501": "APIErrors",
1011
+ }
1012
+ response_data = await self.api_client.call_api(
1013
+ *_param, _request_timeout=_request_timeout
1014
+ )
1015
+ await response_data.read()
1016
+ return self.api_client.response_deserialize(
1017
+ response_data=response_data,
1018
+ response_types_map=_response_types_map,
1019
+ ).data
1020
+
1021
+ @validate_call
1022
+ async def v1_task_get_with_http_info(
1023
+ self,
1024
+ task: Annotated[
1025
+ str,
1026
+ Field(min_length=36, strict=True, max_length=36, description="The task id"),
1027
+ ],
1028
+ _request_timeout: Union[
1029
+ None,
1030
+ Annotated[StrictFloat, Field(gt=0)],
1031
+ Tuple[
1032
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1033
+ ],
1034
+ ] = None,
1035
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1036
+ _content_type: Optional[StrictStr] = None,
1037
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1038
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1039
+ ) -> ApiResponse[V1TaskSummary]:
1040
+ """Get a task
1041
+
1042
+ Get a task by id
1043
+
1044
+ :param task: The task id (required)
1045
+ :type task: str
1046
+ :param _request_timeout: timeout setting for this request. If one
1047
+ number provided, it will be total request
1048
+ timeout. It can also be a pair (tuple) of
1049
+ (connection, read) timeouts.
1050
+ :type _request_timeout: int, tuple(int, int), optional
1051
+ :param _request_auth: set to override the auth_settings for an a single
1052
+ request; this effectively ignores the
1053
+ authentication in the spec for a single request.
1054
+ :type _request_auth: dict, optional
1055
+ :param _content_type: force content-type for the request.
1056
+ :type _content_type: str, Optional
1057
+ :param _headers: set to override the headers for a single
1058
+ request; this effectively ignores the headers
1059
+ in the spec for a single request.
1060
+ :type _headers: dict, optional
1061
+ :param _host_index: set to override the host_index for a single
1062
+ request; this effectively ignores the host_index
1063
+ in the spec for a single request.
1064
+ :type _host_index: int, optional
1065
+ :return: Returns the result object.
1066
+ """ # noqa: E501
1067
+
1068
+ _param = self._v1_task_get_serialize(
1069
+ task=task,
1070
+ _request_auth=_request_auth,
1071
+ _content_type=_content_type,
1072
+ _headers=_headers,
1073
+ _host_index=_host_index,
1074
+ )
1075
+
1076
+ _response_types_map: Dict[str, Optional[str]] = {
1077
+ "200": "V1TaskSummary",
1078
+ "400": "APIErrors",
1079
+ "403": "APIErrors",
1080
+ "404": "APIErrors",
1081
+ "501": "APIErrors",
1082
+ }
1083
+ response_data = await self.api_client.call_api(
1084
+ *_param, _request_timeout=_request_timeout
1085
+ )
1086
+ await response_data.read()
1087
+ return self.api_client.response_deserialize(
1088
+ response_data=response_data,
1089
+ response_types_map=_response_types_map,
1090
+ )
1091
+
1092
+ @validate_call
1093
+ async def v1_task_get_without_preload_content(
1094
+ self,
1095
+ task: Annotated[
1096
+ str,
1097
+ Field(min_length=36, strict=True, max_length=36, description="The task id"),
1098
+ ],
1099
+ _request_timeout: Union[
1100
+ None,
1101
+ Annotated[StrictFloat, Field(gt=0)],
1102
+ Tuple[
1103
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1104
+ ],
1105
+ ] = None,
1106
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1107
+ _content_type: Optional[StrictStr] = None,
1108
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1109
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1110
+ ) -> RESTResponseType:
1111
+ """Get a task
1112
+
1113
+ Get a task by id
1114
+
1115
+ :param task: The task id (required)
1116
+ :type task: str
1117
+ :param _request_timeout: timeout setting for this request. If one
1118
+ number provided, it will be total request
1119
+ timeout. It can also be a pair (tuple) of
1120
+ (connection, read) timeouts.
1121
+ :type _request_timeout: int, tuple(int, int), optional
1122
+ :param _request_auth: set to override the auth_settings for an a single
1123
+ request; this effectively ignores the
1124
+ authentication in the spec for a single request.
1125
+ :type _request_auth: dict, optional
1126
+ :param _content_type: force content-type for the request.
1127
+ :type _content_type: str, Optional
1128
+ :param _headers: set to override the headers for a single
1129
+ request; this effectively ignores the headers
1130
+ in the spec for a single request.
1131
+ :type _headers: dict, optional
1132
+ :param _host_index: set to override the host_index for a single
1133
+ request; this effectively ignores the host_index
1134
+ in the spec for a single request.
1135
+ :type _host_index: int, optional
1136
+ :return: Returns the result object.
1137
+ """ # noqa: E501
1138
+
1139
+ _param = self._v1_task_get_serialize(
1140
+ task=task,
1141
+ _request_auth=_request_auth,
1142
+ _content_type=_content_type,
1143
+ _headers=_headers,
1144
+ _host_index=_host_index,
1145
+ )
1146
+
1147
+ _response_types_map: Dict[str, Optional[str]] = {
1148
+ "200": "V1TaskSummary",
1149
+ "400": "APIErrors",
1150
+ "403": "APIErrors",
1151
+ "404": "APIErrors",
1152
+ "501": "APIErrors",
1153
+ }
1154
+ response_data = await self.api_client.call_api(
1155
+ *_param, _request_timeout=_request_timeout
1156
+ )
1157
+ return response_data.response
1158
+
1159
+ def _v1_task_get_serialize(
1160
+ self,
1161
+ task,
1162
+ _request_auth,
1163
+ _content_type,
1164
+ _headers,
1165
+ _host_index,
1166
+ ) -> RequestSerialized:
1167
+
1168
+ _host = None
1169
+
1170
+ _collection_formats: Dict[str, str] = {}
1171
+
1172
+ _path_params: Dict[str, str] = {}
1173
+ _query_params: List[Tuple[str, str]] = []
1174
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1175
+ _form_params: List[Tuple[str, str]] = []
1176
+ _files: Dict[
1177
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1178
+ ] = {}
1179
+ _body_params: Optional[bytes] = None
1180
+
1181
+ # process the path parameters
1182
+ if task is not None:
1183
+ _path_params["task"] = task
1184
+ # process the query parameters
1185
+ # process the header parameters
1186
+ # process the form parameters
1187
+ # process the body parameter
1188
+
1189
+ # set the HTTP header `Accept`
1190
+ if "Accept" not in _header_params:
1191
+ _header_params["Accept"] = self.api_client.select_header_accept(
1192
+ ["application/json"]
1193
+ )
1194
+
1195
+ # authentication setting
1196
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1197
+
1198
+ return self.api_client.param_serialize(
1199
+ method="GET",
1200
+ resource_path="/api/v1/stable/tasks/{task}",
1201
+ path_params=_path_params,
1202
+ query_params=_query_params,
1203
+ header_params=_header_params,
1204
+ body=_body_params,
1205
+ post_params=_form_params,
1206
+ files=_files,
1207
+ auth_settings=_auth_settings,
1208
+ collection_formats=_collection_formats,
1209
+ _host=_host,
1210
+ _request_auth=_request_auth,
1211
+ )
1212
+
1213
+ @validate_call
1214
+ async def v1_task_get_point_metrics(
1215
+ self,
1216
+ tenant: Annotated[
1217
+ str,
1218
+ Field(
1219
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1220
+ ),
1221
+ ],
1222
+ created_after: Annotated[
1223
+ Optional[datetime], Field(description="The time after the task was created")
1224
+ ] = None,
1225
+ finished_before: Annotated[
1226
+ Optional[datetime],
1227
+ Field(description="The time before the task was completed"),
1228
+ ] = None,
1229
+ _request_timeout: Union[
1230
+ None,
1231
+ Annotated[StrictFloat, Field(gt=0)],
1232
+ Tuple[
1233
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1234
+ ],
1235
+ ] = None,
1236
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1237
+ _content_type: Optional[StrictStr] = None,
1238
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1239
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1240
+ ) -> V1TaskPointMetrics:
1241
+ """Get task point metrics
1242
+
1243
+ Get a minute by minute breakdown of task metrics for a tenant
1244
+
1245
+ :param tenant: The tenant id (required)
1246
+ :type tenant: str
1247
+ :param created_after: The time after the task was created
1248
+ :type created_after: datetime
1249
+ :param finished_before: The time before the task was completed
1250
+ :type finished_before: datetime
1251
+ :param _request_timeout: timeout setting for this request. If one
1252
+ number provided, it will be total request
1253
+ timeout. It can also be a pair (tuple) of
1254
+ (connection, read) timeouts.
1255
+ :type _request_timeout: int, tuple(int, int), optional
1256
+ :param _request_auth: set to override the auth_settings for an a single
1257
+ request; this effectively ignores the
1258
+ authentication in the spec for a single request.
1259
+ :type _request_auth: dict, optional
1260
+ :param _content_type: force content-type for the request.
1261
+ :type _content_type: str, Optional
1262
+ :param _headers: set to override the headers for a single
1263
+ request; this effectively ignores the headers
1264
+ in the spec for a single request.
1265
+ :type _headers: dict, optional
1266
+ :param _host_index: set to override the host_index for a single
1267
+ request; this effectively ignores the host_index
1268
+ in the spec for a single request.
1269
+ :type _host_index: int, optional
1270
+ :return: Returns the result object.
1271
+ """ # noqa: E501
1272
+
1273
+ _param = self._v1_task_get_point_metrics_serialize(
1274
+ tenant=tenant,
1275
+ created_after=created_after,
1276
+ finished_before=finished_before,
1277
+ _request_auth=_request_auth,
1278
+ _content_type=_content_type,
1279
+ _headers=_headers,
1280
+ _host_index=_host_index,
1281
+ )
1282
+
1283
+ _response_types_map: Dict[str, Optional[str]] = {
1284
+ "200": "V1TaskPointMetrics",
1285
+ "400": "APIErrors",
1286
+ "403": "APIErrors",
1287
+ "501": "APIErrors",
1288
+ }
1289
+ response_data = await self.api_client.call_api(
1290
+ *_param, _request_timeout=_request_timeout
1291
+ )
1292
+ await response_data.read()
1293
+ return self.api_client.response_deserialize(
1294
+ response_data=response_data,
1295
+ response_types_map=_response_types_map,
1296
+ ).data
1297
+
1298
+ @validate_call
1299
+ async def v1_task_get_point_metrics_with_http_info(
1300
+ self,
1301
+ tenant: Annotated[
1302
+ str,
1303
+ Field(
1304
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1305
+ ),
1306
+ ],
1307
+ created_after: Annotated[
1308
+ Optional[datetime], Field(description="The time after the task was created")
1309
+ ] = None,
1310
+ finished_before: Annotated[
1311
+ Optional[datetime],
1312
+ Field(description="The time before the task was completed"),
1313
+ ] = None,
1314
+ _request_timeout: Union[
1315
+ None,
1316
+ Annotated[StrictFloat, Field(gt=0)],
1317
+ Tuple[
1318
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1319
+ ],
1320
+ ] = None,
1321
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1322
+ _content_type: Optional[StrictStr] = None,
1323
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1324
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1325
+ ) -> ApiResponse[V1TaskPointMetrics]:
1326
+ """Get task point metrics
1327
+
1328
+ Get a minute by minute breakdown of task metrics for a tenant
1329
+
1330
+ :param tenant: The tenant id (required)
1331
+ :type tenant: str
1332
+ :param created_after: The time after the task was created
1333
+ :type created_after: datetime
1334
+ :param finished_before: The time before the task was completed
1335
+ :type finished_before: datetime
1336
+ :param _request_timeout: timeout setting for this request. If one
1337
+ number provided, it will be total request
1338
+ timeout. It can also be a pair (tuple) of
1339
+ (connection, read) timeouts.
1340
+ :type _request_timeout: int, tuple(int, int), optional
1341
+ :param _request_auth: set to override the auth_settings for an a single
1342
+ request; this effectively ignores the
1343
+ authentication in the spec for a single request.
1344
+ :type _request_auth: dict, optional
1345
+ :param _content_type: force content-type for the request.
1346
+ :type _content_type: str, Optional
1347
+ :param _headers: set to override the headers for a single
1348
+ request; this effectively ignores the headers
1349
+ in the spec for a single request.
1350
+ :type _headers: dict, optional
1351
+ :param _host_index: set to override the host_index for a single
1352
+ request; this effectively ignores the host_index
1353
+ in the spec for a single request.
1354
+ :type _host_index: int, optional
1355
+ :return: Returns the result object.
1356
+ """ # noqa: E501
1357
+
1358
+ _param = self._v1_task_get_point_metrics_serialize(
1359
+ tenant=tenant,
1360
+ created_after=created_after,
1361
+ finished_before=finished_before,
1362
+ _request_auth=_request_auth,
1363
+ _content_type=_content_type,
1364
+ _headers=_headers,
1365
+ _host_index=_host_index,
1366
+ )
1367
+
1368
+ _response_types_map: Dict[str, Optional[str]] = {
1369
+ "200": "V1TaskPointMetrics",
1370
+ "400": "APIErrors",
1371
+ "403": "APIErrors",
1372
+ "501": "APIErrors",
1373
+ }
1374
+ response_data = await self.api_client.call_api(
1375
+ *_param, _request_timeout=_request_timeout
1376
+ )
1377
+ await response_data.read()
1378
+ return self.api_client.response_deserialize(
1379
+ response_data=response_data,
1380
+ response_types_map=_response_types_map,
1381
+ )
1382
+
1383
+ @validate_call
1384
+ async def v1_task_get_point_metrics_without_preload_content(
1385
+ self,
1386
+ tenant: Annotated[
1387
+ str,
1388
+ Field(
1389
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1390
+ ),
1391
+ ],
1392
+ created_after: Annotated[
1393
+ Optional[datetime], Field(description="The time after the task was created")
1394
+ ] = None,
1395
+ finished_before: Annotated[
1396
+ Optional[datetime],
1397
+ Field(description="The time before the task was completed"),
1398
+ ] = None,
1399
+ _request_timeout: Union[
1400
+ None,
1401
+ Annotated[StrictFloat, Field(gt=0)],
1402
+ Tuple[
1403
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1404
+ ],
1405
+ ] = None,
1406
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1407
+ _content_type: Optional[StrictStr] = None,
1408
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1409
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1410
+ ) -> RESTResponseType:
1411
+ """Get task point metrics
1412
+
1413
+ Get a minute by minute breakdown of task metrics for a tenant
1414
+
1415
+ :param tenant: The tenant id (required)
1416
+ :type tenant: str
1417
+ :param created_after: The time after the task was created
1418
+ :type created_after: datetime
1419
+ :param finished_before: The time before the task was completed
1420
+ :type finished_before: datetime
1421
+ :param _request_timeout: timeout setting for this request. If one
1422
+ number provided, it will be total request
1423
+ timeout. It can also be a pair (tuple) of
1424
+ (connection, read) timeouts.
1425
+ :type _request_timeout: int, tuple(int, int), optional
1426
+ :param _request_auth: set to override the auth_settings for an a single
1427
+ request; this effectively ignores the
1428
+ authentication in the spec for a single request.
1429
+ :type _request_auth: dict, optional
1430
+ :param _content_type: force content-type for the request.
1431
+ :type _content_type: str, Optional
1432
+ :param _headers: set to override the headers for a single
1433
+ request; this effectively ignores the headers
1434
+ in the spec for a single request.
1435
+ :type _headers: dict, optional
1436
+ :param _host_index: set to override the host_index for a single
1437
+ request; this effectively ignores the host_index
1438
+ in the spec for a single request.
1439
+ :type _host_index: int, optional
1440
+ :return: Returns the result object.
1441
+ """ # noqa: E501
1442
+
1443
+ _param = self._v1_task_get_point_metrics_serialize(
1444
+ tenant=tenant,
1445
+ created_after=created_after,
1446
+ finished_before=finished_before,
1447
+ _request_auth=_request_auth,
1448
+ _content_type=_content_type,
1449
+ _headers=_headers,
1450
+ _host_index=_host_index,
1451
+ )
1452
+
1453
+ _response_types_map: Dict[str, Optional[str]] = {
1454
+ "200": "V1TaskPointMetrics",
1455
+ "400": "APIErrors",
1456
+ "403": "APIErrors",
1457
+ "501": "APIErrors",
1458
+ }
1459
+ response_data = await self.api_client.call_api(
1460
+ *_param, _request_timeout=_request_timeout
1461
+ )
1462
+ return response_data.response
1463
+
1464
+ def _v1_task_get_point_metrics_serialize(
1465
+ self,
1466
+ tenant,
1467
+ created_after,
1468
+ finished_before,
1469
+ _request_auth,
1470
+ _content_type,
1471
+ _headers,
1472
+ _host_index,
1473
+ ) -> RequestSerialized:
1474
+
1475
+ _host = None
1476
+
1477
+ _collection_formats: Dict[str, str] = {}
1478
+
1479
+ _path_params: Dict[str, str] = {}
1480
+ _query_params: List[Tuple[str, str]] = []
1481
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1482
+ _form_params: List[Tuple[str, str]] = []
1483
+ _files: Dict[
1484
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1485
+ ] = {}
1486
+ _body_params: Optional[bytes] = None
1487
+
1488
+ # process the path parameters
1489
+ if tenant is not None:
1490
+ _path_params["tenant"] = tenant
1491
+ # process the query parameters
1492
+ if created_after is not None:
1493
+ if isinstance(created_after, datetime):
1494
+ _query_params.append(
1495
+ (
1496
+ "createdAfter",
1497
+ created_after.strftime(
1498
+ self.api_client.configuration.datetime_format
1499
+ ),
1500
+ )
1501
+ )
1502
+ else:
1503
+ _query_params.append(("createdAfter", created_after))
1504
+
1505
+ if finished_before is not None:
1506
+ if isinstance(finished_before, datetime):
1507
+ _query_params.append(
1508
+ (
1509
+ "finishedBefore",
1510
+ finished_before.strftime(
1511
+ self.api_client.configuration.datetime_format
1512
+ ),
1513
+ )
1514
+ )
1515
+ else:
1516
+ _query_params.append(("finishedBefore", finished_before))
1517
+
1518
+ # process the header parameters
1519
+ # process the form parameters
1520
+ # process the body parameter
1521
+
1522
+ # set the HTTP header `Accept`
1523
+ if "Accept" not in _header_params:
1524
+ _header_params["Accept"] = self.api_client.select_header_accept(
1525
+ ["application/json"]
1526
+ )
1527
+
1528
+ # authentication setting
1529
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1530
+
1531
+ return self.api_client.param_serialize(
1532
+ method="GET",
1533
+ resource_path="/api/v1/stable/tenants/{tenant}/task-point-metrics",
1534
+ path_params=_path_params,
1535
+ query_params=_query_params,
1536
+ header_params=_header_params,
1537
+ body=_body_params,
1538
+ post_params=_form_params,
1539
+ files=_files,
1540
+ auth_settings=_auth_settings,
1541
+ collection_formats=_collection_formats,
1542
+ _host=_host,
1543
+ _request_auth=_request_auth,
1544
+ )
1545
+
1546
+ @validate_call
1547
+ async def v1_task_list_status_metrics(
1548
+ self,
1549
+ tenant: Annotated[
1550
+ str,
1551
+ Field(
1552
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1553
+ ),
1554
+ ],
1555
+ since: Annotated[
1556
+ datetime, Field(description="The start time to get metrics for")
1557
+ ],
1558
+ workflow_ids: Annotated[
1559
+ Optional[
1560
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]
1561
+ ],
1562
+ Field(description="The workflow id to find runs for"),
1563
+ ] = None,
1564
+ parent_task_external_id: Annotated[
1565
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
1566
+ Field(description="The parent task's external id"),
1567
+ ] = None,
1568
+ _request_timeout: Union[
1569
+ None,
1570
+ Annotated[StrictFloat, Field(gt=0)],
1571
+ Tuple[
1572
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1573
+ ],
1574
+ ] = None,
1575
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1576
+ _content_type: Optional[StrictStr] = None,
1577
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1578
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1579
+ ) -> List[V1TaskRunMetric]:
1580
+ """Get task metrics
1581
+
1582
+ Get a summary of task run metrics for a tenant
1583
+
1584
+ :param tenant: The tenant id (required)
1585
+ :type tenant: str
1586
+ :param since: The start time to get metrics for (required)
1587
+ :type since: datetime
1588
+ :param workflow_ids: The workflow id to find runs for
1589
+ :type workflow_ids: List[str]
1590
+ :param parent_task_external_id: The parent task's external id
1591
+ :type parent_task_external_id: str
1592
+ :param _request_timeout: timeout setting for this request. If one
1593
+ number provided, it will be total request
1594
+ timeout. It can also be a pair (tuple) of
1595
+ (connection, read) timeouts.
1596
+ :type _request_timeout: int, tuple(int, int), optional
1597
+ :param _request_auth: set to override the auth_settings for an a single
1598
+ request; this effectively ignores the
1599
+ authentication in the spec for a single request.
1600
+ :type _request_auth: dict, optional
1601
+ :param _content_type: force content-type for the request.
1602
+ :type _content_type: str, Optional
1603
+ :param _headers: set to override the headers for a single
1604
+ request; this effectively ignores the headers
1605
+ in the spec for a single request.
1606
+ :type _headers: dict, optional
1607
+ :param _host_index: set to override the host_index for a single
1608
+ request; this effectively ignores the host_index
1609
+ in the spec for a single request.
1610
+ :type _host_index: int, optional
1611
+ :return: Returns the result object.
1612
+ """ # noqa: E501
1613
+
1614
+ _param = self._v1_task_list_status_metrics_serialize(
1615
+ tenant=tenant,
1616
+ since=since,
1617
+ workflow_ids=workflow_ids,
1618
+ parent_task_external_id=parent_task_external_id,
1619
+ _request_auth=_request_auth,
1620
+ _content_type=_content_type,
1621
+ _headers=_headers,
1622
+ _host_index=_host_index,
1623
+ )
1624
+
1625
+ _response_types_map: Dict[str, Optional[str]] = {
1626
+ "200": "List[V1TaskRunMetric]",
1627
+ "400": "APIErrors",
1628
+ "403": "APIErrors",
1629
+ "501": "APIErrors",
1630
+ }
1631
+ response_data = await self.api_client.call_api(
1632
+ *_param, _request_timeout=_request_timeout
1633
+ )
1634
+ await response_data.read()
1635
+ return self.api_client.response_deserialize(
1636
+ response_data=response_data,
1637
+ response_types_map=_response_types_map,
1638
+ ).data
1639
+
1640
+ @validate_call
1641
+ async def v1_task_list_status_metrics_with_http_info(
1642
+ self,
1643
+ tenant: Annotated[
1644
+ str,
1645
+ Field(
1646
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1647
+ ),
1648
+ ],
1649
+ since: Annotated[
1650
+ datetime, Field(description="The start time to get metrics for")
1651
+ ],
1652
+ workflow_ids: Annotated[
1653
+ Optional[
1654
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]
1655
+ ],
1656
+ Field(description="The workflow id to find runs for"),
1657
+ ] = None,
1658
+ parent_task_external_id: Annotated[
1659
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
1660
+ Field(description="The parent task's external id"),
1661
+ ] = None,
1662
+ _request_timeout: Union[
1663
+ None,
1664
+ Annotated[StrictFloat, Field(gt=0)],
1665
+ Tuple[
1666
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1667
+ ],
1668
+ ] = None,
1669
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1670
+ _content_type: Optional[StrictStr] = None,
1671
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1672
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1673
+ ) -> ApiResponse[List[V1TaskRunMetric]]:
1674
+ """Get task metrics
1675
+
1676
+ Get a summary of task run metrics for a tenant
1677
+
1678
+ :param tenant: The tenant id (required)
1679
+ :type tenant: str
1680
+ :param since: The start time to get metrics for (required)
1681
+ :type since: datetime
1682
+ :param workflow_ids: The workflow id to find runs for
1683
+ :type workflow_ids: List[str]
1684
+ :param parent_task_external_id: The parent task's external id
1685
+ :type parent_task_external_id: str
1686
+ :param _request_timeout: timeout setting for this request. If one
1687
+ number provided, it will be total request
1688
+ timeout. It can also be a pair (tuple) of
1689
+ (connection, read) timeouts.
1690
+ :type _request_timeout: int, tuple(int, int), optional
1691
+ :param _request_auth: set to override the auth_settings for an a single
1692
+ request; this effectively ignores the
1693
+ authentication in the spec for a single request.
1694
+ :type _request_auth: dict, optional
1695
+ :param _content_type: force content-type for the request.
1696
+ :type _content_type: str, Optional
1697
+ :param _headers: set to override the headers for a single
1698
+ request; this effectively ignores the headers
1699
+ in the spec for a single request.
1700
+ :type _headers: dict, optional
1701
+ :param _host_index: set to override the host_index for a single
1702
+ request; this effectively ignores the host_index
1703
+ in the spec for a single request.
1704
+ :type _host_index: int, optional
1705
+ :return: Returns the result object.
1706
+ """ # noqa: E501
1707
+
1708
+ _param = self._v1_task_list_status_metrics_serialize(
1709
+ tenant=tenant,
1710
+ since=since,
1711
+ workflow_ids=workflow_ids,
1712
+ parent_task_external_id=parent_task_external_id,
1713
+ _request_auth=_request_auth,
1714
+ _content_type=_content_type,
1715
+ _headers=_headers,
1716
+ _host_index=_host_index,
1717
+ )
1718
+
1719
+ _response_types_map: Dict[str, Optional[str]] = {
1720
+ "200": "List[V1TaskRunMetric]",
1721
+ "400": "APIErrors",
1722
+ "403": "APIErrors",
1723
+ "501": "APIErrors",
1724
+ }
1725
+ response_data = await self.api_client.call_api(
1726
+ *_param, _request_timeout=_request_timeout
1727
+ )
1728
+ await response_data.read()
1729
+ return self.api_client.response_deserialize(
1730
+ response_data=response_data,
1731
+ response_types_map=_response_types_map,
1732
+ )
1733
+
1734
+ @validate_call
1735
+ async def v1_task_list_status_metrics_without_preload_content(
1736
+ self,
1737
+ tenant: Annotated[
1738
+ str,
1739
+ Field(
1740
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1741
+ ),
1742
+ ],
1743
+ since: Annotated[
1744
+ datetime, Field(description="The start time to get metrics for")
1745
+ ],
1746
+ workflow_ids: Annotated[
1747
+ Optional[
1748
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]
1749
+ ],
1750
+ Field(description="The workflow id to find runs for"),
1751
+ ] = None,
1752
+ parent_task_external_id: Annotated[
1753
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
1754
+ Field(description="The parent task's external id"),
1755
+ ] = None,
1756
+ _request_timeout: Union[
1757
+ None,
1758
+ Annotated[StrictFloat, Field(gt=0)],
1759
+ Tuple[
1760
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1761
+ ],
1762
+ ] = None,
1763
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1764
+ _content_type: Optional[StrictStr] = None,
1765
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1766
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1767
+ ) -> RESTResponseType:
1768
+ """Get task metrics
1769
+
1770
+ Get a summary of task run metrics for a tenant
1771
+
1772
+ :param tenant: The tenant id (required)
1773
+ :type tenant: str
1774
+ :param since: The start time to get metrics for (required)
1775
+ :type since: datetime
1776
+ :param workflow_ids: The workflow id to find runs for
1777
+ :type workflow_ids: List[str]
1778
+ :param parent_task_external_id: The parent task's external id
1779
+ :type parent_task_external_id: str
1780
+ :param _request_timeout: timeout setting for this request. If one
1781
+ number provided, it will be total request
1782
+ timeout. It can also be a pair (tuple) of
1783
+ (connection, read) timeouts.
1784
+ :type _request_timeout: int, tuple(int, int), optional
1785
+ :param _request_auth: set to override the auth_settings for an a single
1786
+ request; this effectively ignores the
1787
+ authentication in the spec for a single request.
1788
+ :type _request_auth: dict, optional
1789
+ :param _content_type: force content-type for the request.
1790
+ :type _content_type: str, Optional
1791
+ :param _headers: set to override the headers for a single
1792
+ request; this effectively ignores the headers
1793
+ in the spec for a single request.
1794
+ :type _headers: dict, optional
1795
+ :param _host_index: set to override the host_index for a single
1796
+ request; this effectively ignores the host_index
1797
+ in the spec for a single request.
1798
+ :type _host_index: int, optional
1799
+ :return: Returns the result object.
1800
+ """ # noqa: E501
1801
+
1802
+ _param = self._v1_task_list_status_metrics_serialize(
1803
+ tenant=tenant,
1804
+ since=since,
1805
+ workflow_ids=workflow_ids,
1806
+ parent_task_external_id=parent_task_external_id,
1807
+ _request_auth=_request_auth,
1808
+ _content_type=_content_type,
1809
+ _headers=_headers,
1810
+ _host_index=_host_index,
1811
+ )
1812
+
1813
+ _response_types_map: Dict[str, Optional[str]] = {
1814
+ "200": "List[V1TaskRunMetric]",
1815
+ "400": "APIErrors",
1816
+ "403": "APIErrors",
1817
+ "501": "APIErrors",
1818
+ }
1819
+ response_data = await self.api_client.call_api(
1820
+ *_param, _request_timeout=_request_timeout
1821
+ )
1822
+ return response_data.response
1823
+
1824
+ def _v1_task_list_status_metrics_serialize(
1825
+ self,
1826
+ tenant,
1827
+ since,
1828
+ workflow_ids,
1829
+ parent_task_external_id,
1830
+ _request_auth,
1831
+ _content_type,
1832
+ _headers,
1833
+ _host_index,
1834
+ ) -> RequestSerialized:
1835
+
1836
+ _host = None
1837
+
1838
+ _collection_formats: Dict[str, str] = {
1839
+ "workflow_ids": "multi",
1840
+ }
1841
+
1842
+ _path_params: Dict[str, str] = {}
1843
+ _query_params: List[Tuple[str, str]] = []
1844
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1845
+ _form_params: List[Tuple[str, str]] = []
1846
+ _files: Dict[
1847
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1848
+ ] = {}
1849
+ _body_params: Optional[bytes] = None
1850
+
1851
+ # process the path parameters
1852
+ if tenant is not None:
1853
+ _path_params["tenant"] = tenant
1854
+ # process the query parameters
1855
+ if since is not None:
1856
+ if isinstance(since, datetime):
1857
+ _query_params.append(
1858
+ (
1859
+ "since",
1860
+ since.strftime(self.api_client.configuration.datetime_format),
1861
+ )
1862
+ )
1863
+ else:
1864
+ _query_params.append(("since", since))
1865
+
1866
+ if workflow_ids is not None:
1867
+
1868
+ _query_params.append(("workflow_ids", workflow_ids))
1869
+
1870
+ if parent_task_external_id is not None:
1871
+
1872
+ _query_params.append(("parent_task_external_id", parent_task_external_id))
1873
+
1874
+ # process the header parameters
1875
+ # process the form parameters
1876
+ # process the body parameter
1877
+
1878
+ # set the HTTP header `Accept`
1879
+ if "Accept" not in _header_params:
1880
+ _header_params["Accept"] = self.api_client.select_header_accept(
1881
+ ["application/json"]
1882
+ )
1883
+
1884
+ # authentication setting
1885
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1886
+
1887
+ return self.api_client.param_serialize(
1888
+ method="GET",
1889
+ resource_path="/api/v1/stable/tenants/{tenant}/task-metrics",
1890
+ path_params=_path_params,
1891
+ query_params=_query_params,
1892
+ header_params=_header_params,
1893
+ body=_body_params,
1894
+ post_params=_form_params,
1895
+ files=_files,
1896
+ auth_settings=_auth_settings,
1897
+ collection_formats=_collection_formats,
1898
+ _host=_host,
1899
+ _request_auth=_request_auth,
1900
+ )
1901
+
1902
+ @validate_call
1903
+ async def v1_task_replay(
1904
+ self,
1905
+ tenant: Annotated[
1906
+ str,
1907
+ Field(
1908
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1909
+ ),
1910
+ ],
1911
+ v1_replay_task_request: Annotated[
1912
+ V1ReplayTaskRequest, Field(description="The tasks to replay")
1913
+ ],
1914
+ _request_timeout: Union[
1915
+ None,
1916
+ Annotated[StrictFloat, Field(gt=0)],
1917
+ Tuple[
1918
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1919
+ ],
1920
+ ] = None,
1921
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1922
+ _content_type: Optional[StrictStr] = None,
1923
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1924
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1925
+ ) -> None:
1926
+ """Replay tasks
1927
+
1928
+ Replay tasks
1929
+
1930
+ :param tenant: The tenant id (required)
1931
+ :type tenant: str
1932
+ :param v1_replay_task_request: The tasks to replay (required)
1933
+ :type v1_replay_task_request: V1ReplayTaskRequest
1934
+ :param _request_timeout: timeout setting for this request. If one
1935
+ number provided, it will be total request
1936
+ timeout. It can also be a pair (tuple) of
1937
+ (connection, read) timeouts.
1938
+ :type _request_timeout: int, tuple(int, int), optional
1939
+ :param _request_auth: set to override the auth_settings for an a single
1940
+ request; this effectively ignores the
1941
+ authentication in the spec for a single request.
1942
+ :type _request_auth: dict, optional
1943
+ :param _content_type: force content-type for the request.
1944
+ :type _content_type: str, Optional
1945
+ :param _headers: set to override the headers for a single
1946
+ request; this effectively ignores the headers
1947
+ in the spec for a single request.
1948
+ :type _headers: dict, optional
1949
+ :param _host_index: set to override the host_index for a single
1950
+ request; this effectively ignores the host_index
1951
+ in the spec for a single request.
1952
+ :type _host_index: int, optional
1953
+ :return: Returns the result object.
1954
+ """ # noqa: E501
1955
+
1956
+ _param = self._v1_task_replay_serialize(
1957
+ tenant=tenant,
1958
+ v1_replay_task_request=v1_replay_task_request,
1959
+ _request_auth=_request_auth,
1960
+ _content_type=_content_type,
1961
+ _headers=_headers,
1962
+ _host_index=_host_index,
1963
+ )
1964
+
1965
+ _response_types_map: Dict[str, Optional[str]] = {
1966
+ "200": None,
1967
+ "400": "APIErrors",
1968
+ "403": "APIErrors",
1969
+ "404": "APIErrors",
1970
+ "501": "APIErrors",
1971
+ }
1972
+ response_data = await self.api_client.call_api(
1973
+ *_param, _request_timeout=_request_timeout
1974
+ )
1975
+ await response_data.read()
1976
+ return self.api_client.response_deserialize(
1977
+ response_data=response_data,
1978
+ response_types_map=_response_types_map,
1979
+ ).data
1980
+
1981
+ @validate_call
1982
+ async def v1_task_replay_with_http_info(
1983
+ self,
1984
+ tenant: Annotated[
1985
+ str,
1986
+ Field(
1987
+ min_length=36, strict=True, max_length=36, description="The tenant id"
1988
+ ),
1989
+ ],
1990
+ v1_replay_task_request: Annotated[
1991
+ V1ReplayTaskRequest, Field(description="The tasks to replay")
1992
+ ],
1993
+ _request_timeout: Union[
1994
+ None,
1995
+ Annotated[StrictFloat, Field(gt=0)],
1996
+ Tuple[
1997
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1998
+ ],
1999
+ ] = None,
2000
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2001
+ _content_type: Optional[StrictStr] = None,
2002
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2003
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2004
+ ) -> ApiResponse[None]:
2005
+ """Replay tasks
2006
+
2007
+ Replay tasks
2008
+
2009
+ :param tenant: The tenant id (required)
2010
+ :type tenant: str
2011
+ :param v1_replay_task_request: The tasks to replay (required)
2012
+ :type v1_replay_task_request: V1ReplayTaskRequest
2013
+ :param _request_timeout: timeout setting for this request. If one
2014
+ number provided, it will be total request
2015
+ timeout. It can also be a pair (tuple) of
2016
+ (connection, read) timeouts.
2017
+ :type _request_timeout: int, tuple(int, int), optional
2018
+ :param _request_auth: set to override the auth_settings for an a single
2019
+ request; this effectively ignores the
2020
+ authentication in the spec for a single request.
2021
+ :type _request_auth: dict, optional
2022
+ :param _content_type: force content-type for the request.
2023
+ :type _content_type: str, Optional
2024
+ :param _headers: set to override the headers for a single
2025
+ request; this effectively ignores the headers
2026
+ in the spec for a single request.
2027
+ :type _headers: dict, optional
2028
+ :param _host_index: set to override the host_index for a single
2029
+ request; this effectively ignores the host_index
2030
+ in the spec for a single request.
2031
+ :type _host_index: int, optional
2032
+ :return: Returns the result object.
2033
+ """ # noqa: E501
2034
+
2035
+ _param = self._v1_task_replay_serialize(
2036
+ tenant=tenant,
2037
+ v1_replay_task_request=v1_replay_task_request,
2038
+ _request_auth=_request_auth,
2039
+ _content_type=_content_type,
2040
+ _headers=_headers,
2041
+ _host_index=_host_index,
2042
+ )
2043
+
2044
+ _response_types_map: Dict[str, Optional[str]] = {
2045
+ "200": None,
2046
+ "400": "APIErrors",
2047
+ "403": "APIErrors",
2048
+ "404": "APIErrors",
2049
+ "501": "APIErrors",
2050
+ }
2051
+ response_data = await self.api_client.call_api(
2052
+ *_param, _request_timeout=_request_timeout
2053
+ )
2054
+ await response_data.read()
2055
+ return self.api_client.response_deserialize(
2056
+ response_data=response_data,
2057
+ response_types_map=_response_types_map,
2058
+ )
2059
+
2060
+ @validate_call
2061
+ async def v1_task_replay_without_preload_content(
2062
+ self,
2063
+ tenant: Annotated[
2064
+ str,
2065
+ Field(
2066
+ min_length=36, strict=True, max_length=36, description="The tenant id"
2067
+ ),
2068
+ ],
2069
+ v1_replay_task_request: Annotated[
2070
+ V1ReplayTaskRequest, Field(description="The tasks to replay")
2071
+ ],
2072
+ _request_timeout: Union[
2073
+ None,
2074
+ Annotated[StrictFloat, Field(gt=0)],
2075
+ Tuple[
2076
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2077
+ ],
2078
+ ] = None,
2079
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2080
+ _content_type: Optional[StrictStr] = None,
2081
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2082
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2083
+ ) -> RESTResponseType:
2084
+ """Replay tasks
2085
+
2086
+ Replay tasks
2087
+
2088
+ :param tenant: The tenant id (required)
2089
+ :type tenant: str
2090
+ :param v1_replay_task_request: The tasks to replay (required)
2091
+ :type v1_replay_task_request: V1ReplayTaskRequest
2092
+ :param _request_timeout: timeout setting for this request. If one
2093
+ number provided, it will be total request
2094
+ timeout. It can also be a pair (tuple) of
2095
+ (connection, read) timeouts.
2096
+ :type _request_timeout: int, tuple(int, int), optional
2097
+ :param _request_auth: set to override the auth_settings for an a single
2098
+ request; this effectively ignores the
2099
+ authentication in the spec for a single request.
2100
+ :type _request_auth: dict, optional
2101
+ :param _content_type: force content-type for the request.
2102
+ :type _content_type: str, Optional
2103
+ :param _headers: set to override the headers for a single
2104
+ request; this effectively ignores the headers
2105
+ in the spec for a single request.
2106
+ :type _headers: dict, optional
2107
+ :param _host_index: set to override the host_index for a single
2108
+ request; this effectively ignores the host_index
2109
+ in the spec for a single request.
2110
+ :type _host_index: int, optional
2111
+ :return: Returns the result object.
2112
+ """ # noqa: E501
2113
+
2114
+ _param = self._v1_task_replay_serialize(
2115
+ tenant=tenant,
2116
+ v1_replay_task_request=v1_replay_task_request,
2117
+ _request_auth=_request_auth,
2118
+ _content_type=_content_type,
2119
+ _headers=_headers,
2120
+ _host_index=_host_index,
2121
+ )
2122
+
2123
+ _response_types_map: Dict[str, Optional[str]] = {
2124
+ "200": None,
2125
+ "400": "APIErrors",
2126
+ "403": "APIErrors",
2127
+ "404": "APIErrors",
2128
+ "501": "APIErrors",
2129
+ }
2130
+ response_data = await self.api_client.call_api(
2131
+ *_param, _request_timeout=_request_timeout
2132
+ )
2133
+ return response_data.response
2134
+
2135
+ def _v1_task_replay_serialize(
2136
+ self,
2137
+ tenant,
2138
+ v1_replay_task_request,
2139
+ _request_auth,
2140
+ _content_type,
2141
+ _headers,
2142
+ _host_index,
2143
+ ) -> RequestSerialized:
2144
+
2145
+ _host = None
2146
+
2147
+ _collection_formats: Dict[str, str] = {}
2148
+
2149
+ _path_params: Dict[str, str] = {}
2150
+ _query_params: List[Tuple[str, str]] = []
2151
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2152
+ _form_params: List[Tuple[str, str]] = []
2153
+ _files: Dict[
2154
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2155
+ ] = {}
2156
+ _body_params: Optional[bytes] = None
2157
+
2158
+ # process the path parameters
2159
+ if tenant is not None:
2160
+ _path_params["tenant"] = tenant
2161
+ # process the query parameters
2162
+ # process the header parameters
2163
+ # process the form parameters
2164
+ # process the body parameter
2165
+ if v1_replay_task_request is not None:
2166
+ _body_params = v1_replay_task_request
2167
+
2168
+ # set the HTTP header `Accept`
2169
+ if "Accept" not in _header_params:
2170
+ _header_params["Accept"] = self.api_client.select_header_accept(
2171
+ ["application/json"]
2172
+ )
2173
+
2174
+ # set the HTTP header `Content-Type`
2175
+ if _content_type:
2176
+ _header_params["Content-Type"] = _content_type
2177
+ else:
2178
+ _default_content_type = self.api_client.select_header_content_type(
2179
+ ["application/json"]
2180
+ )
2181
+ if _default_content_type is not None:
2182
+ _header_params["Content-Type"] = _default_content_type
2183
+
2184
+ # authentication setting
2185
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
2186
+
2187
+ return self.api_client.param_serialize(
2188
+ method="POST",
2189
+ resource_path="/api/v1/stable/tenants/{tenant}/tasks/replay",
2190
+ path_params=_path_params,
2191
+ query_params=_query_params,
2192
+ header_params=_header_params,
2193
+ body=_body_params,
2194
+ post_params=_form_params,
2195
+ files=_files,
2196
+ auth_settings=_auth_settings,
2197
+ collection_formats=_collection_formats,
2198
+ _host=_host,
2199
+ _request_auth=_request_auth,
2200
+ )