hatchet-sdk 1.0.0__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 (65) hide show
  1. hatchet_sdk/__init__.py +27 -16
  2. hatchet_sdk/client.py +13 -63
  3. hatchet_sdk/clients/admin.py +203 -124
  4. hatchet_sdk/clients/dispatcher/action_listener.py +42 -42
  5. hatchet_sdk/clients/dispatcher/dispatcher.py +18 -16
  6. hatchet_sdk/clients/durable_event_listener.py +327 -0
  7. hatchet_sdk/clients/rest/__init__.py +12 -1
  8. hatchet_sdk/clients/rest/api/log_api.py +258 -0
  9. hatchet_sdk/clients/rest/api/task_api.py +32 -6
  10. hatchet_sdk/clients/rest/api/workflow_runs_api.py +626 -0
  11. hatchet_sdk/clients/rest/models/__init__.py +12 -1
  12. hatchet_sdk/clients/rest/models/v1_log_line.py +94 -0
  13. hatchet_sdk/clients/rest/models/v1_log_line_level.py +39 -0
  14. hatchet_sdk/clients/rest/models/v1_log_line_list.py +110 -0
  15. hatchet_sdk/clients/rest/models/v1_task_summary.py +80 -64
  16. hatchet_sdk/clients/rest/models/v1_trigger_workflow_run_request.py +95 -0
  17. hatchet_sdk/clients/rest/models/v1_workflow_run_display_name.py +98 -0
  18. hatchet_sdk/clients/rest/models/v1_workflow_run_display_name_list.py +114 -0
  19. hatchet_sdk/clients/rest/models/workflow_run_shape_item_for_workflow_run_details.py +9 -4
  20. hatchet_sdk/clients/rest_client.py +21 -0
  21. hatchet_sdk/clients/run_event_listener.py +0 -1
  22. hatchet_sdk/context/context.py +85 -147
  23. hatchet_sdk/contracts/dispatcher_pb2_grpc.py +1 -1
  24. hatchet_sdk/contracts/events_pb2.py +2 -2
  25. hatchet_sdk/contracts/events_pb2_grpc.py +1 -1
  26. hatchet_sdk/contracts/v1/dispatcher_pb2.py +36 -0
  27. hatchet_sdk/contracts/v1/dispatcher_pb2.pyi +38 -0
  28. hatchet_sdk/contracts/v1/dispatcher_pb2_grpc.py +145 -0
  29. hatchet_sdk/contracts/v1/shared/condition_pb2.py +39 -0
  30. hatchet_sdk/contracts/v1/shared/condition_pb2.pyi +72 -0
  31. hatchet_sdk/contracts/v1/shared/condition_pb2_grpc.py +29 -0
  32. hatchet_sdk/contracts/v1/workflows_pb2.py +67 -0
  33. hatchet_sdk/contracts/v1/workflows_pb2.pyi +228 -0
  34. hatchet_sdk/contracts/v1/workflows_pb2_grpc.py +234 -0
  35. hatchet_sdk/contracts/workflows_pb2_grpc.py +1 -1
  36. hatchet_sdk/features/cron.py +3 -3
  37. hatchet_sdk/features/scheduled.py +2 -2
  38. hatchet_sdk/hatchet.py +427 -151
  39. hatchet_sdk/opentelemetry/instrumentor.py +8 -13
  40. hatchet_sdk/rate_limit.py +33 -39
  41. hatchet_sdk/runnables/contextvars.py +12 -0
  42. hatchet_sdk/runnables/standalone.py +194 -0
  43. hatchet_sdk/runnables/task.py +144 -0
  44. hatchet_sdk/runnables/types.py +138 -0
  45. hatchet_sdk/runnables/workflow.py +764 -0
  46. hatchet_sdk/utils/aio_utils.py +0 -79
  47. hatchet_sdk/utils/proto_enums.py +0 -7
  48. hatchet_sdk/utils/timedelta_to_expression.py +23 -0
  49. hatchet_sdk/utils/typing.py +2 -2
  50. hatchet_sdk/v0/clients/rest_client.py +9 -0
  51. hatchet_sdk/v0/worker/action_listener_process.py +18 -2
  52. hatchet_sdk/waits.py +120 -0
  53. hatchet_sdk/worker/action_listener_process.py +64 -30
  54. hatchet_sdk/worker/runner/run_loop_manager.py +35 -25
  55. hatchet_sdk/worker/runner/runner.py +72 -49
  56. hatchet_sdk/worker/runner/utils/capture_logs.py +3 -11
  57. hatchet_sdk/worker/worker.py +155 -118
  58. hatchet_sdk/workflow_run.py +4 -5
  59. {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.0a1.dist-info}/METADATA +1 -2
  60. {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.0a1.dist-info}/RECORD +62 -42
  61. {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.0a1.dist-info}/entry_points.txt +2 -0
  62. hatchet_sdk/semver.py +0 -30
  63. hatchet_sdk/worker/runner/utils/error_with_traceback.py +0 -6
  64. hatchet_sdk/workflow.py +0 -527
  65. {hatchet_sdk-1.0.0.dist-info → hatchet_sdk-1.0.0a1.dist-info}/WHEEL +0 -0
@@ -23,7 +23,13 @@ from hatchet_sdk.clients.rest.api_response import ApiResponse
23
23
  from hatchet_sdk.clients.rest.models.v1_task_event_list import V1TaskEventList
24
24
  from hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus
25
25
  from hatchet_sdk.clients.rest.models.v1_task_summary_list import V1TaskSummaryList
26
+ from hatchet_sdk.clients.rest.models.v1_trigger_workflow_run_request import (
27
+ V1TriggerWorkflowRunRequest,
28
+ )
26
29
  from hatchet_sdk.clients.rest.models.v1_workflow_run_details import V1WorkflowRunDetails
30
+ from hatchet_sdk.clients.rest.models.v1_workflow_run_display_name_list import (
31
+ V1WorkflowRunDisplayNameList,
32
+ )
27
33
  from hatchet_sdk.clients.rest.rest import RESTResponseType
28
34
 
29
35
 
@@ -39,6 +45,600 @@ class WorkflowRunsApi:
39
45
  api_client = ApiClient.get_default()
40
46
  self.api_client = api_client
41
47
 
48
+ @validate_call
49
+ async def v1_workflow_run_create(
50
+ self,
51
+ tenant: Annotated[
52
+ str,
53
+ Field(
54
+ min_length=36, strict=True, max_length=36, description="The tenant id"
55
+ ),
56
+ ],
57
+ v1_trigger_workflow_run_request: Annotated[
58
+ V1TriggerWorkflowRunRequest, Field(description="The workflow run to create")
59
+ ],
60
+ _request_timeout: Union[
61
+ None,
62
+ Annotated[StrictFloat, Field(gt=0)],
63
+ Tuple[
64
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
65
+ ],
66
+ ] = None,
67
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
68
+ _content_type: Optional[StrictStr] = None,
69
+ _headers: Optional[Dict[StrictStr, Any]] = None,
70
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
71
+ ) -> V1WorkflowRunDetails:
72
+ """Create workflow run
73
+
74
+ Trigger a new workflow run
75
+
76
+ :param tenant: The tenant id (required)
77
+ :type tenant: str
78
+ :param v1_trigger_workflow_run_request: The workflow run to create (required)
79
+ :type v1_trigger_workflow_run_request: V1TriggerWorkflowRunRequest
80
+ :param _request_timeout: timeout setting for this request. If one
81
+ number provided, it will be total request
82
+ timeout. It can also be a pair (tuple) of
83
+ (connection, read) timeouts.
84
+ :type _request_timeout: int, tuple(int, int), optional
85
+ :param _request_auth: set to override the auth_settings for an a single
86
+ request; this effectively ignores the
87
+ authentication in the spec for a single request.
88
+ :type _request_auth: dict, optional
89
+ :param _content_type: force content-type for the request.
90
+ :type _content_type: str, Optional
91
+ :param _headers: set to override the headers for a single
92
+ request; this effectively ignores the headers
93
+ in the spec for a single request.
94
+ :type _headers: dict, optional
95
+ :param _host_index: set to override the host_index for a single
96
+ request; this effectively ignores the host_index
97
+ in the spec for a single request.
98
+ :type _host_index: int, optional
99
+ :return: Returns the result object.
100
+ """ # noqa: E501
101
+
102
+ _param = self._v1_workflow_run_create_serialize(
103
+ tenant=tenant,
104
+ v1_trigger_workflow_run_request=v1_trigger_workflow_run_request,
105
+ _request_auth=_request_auth,
106
+ _content_type=_content_type,
107
+ _headers=_headers,
108
+ _host_index=_host_index,
109
+ )
110
+
111
+ _response_types_map: Dict[str, Optional[str]] = {
112
+ "200": "V1WorkflowRunDetails",
113
+ "400": "APIErrors",
114
+ "403": "APIErrors",
115
+ }
116
+ response_data = await self.api_client.call_api(
117
+ *_param, _request_timeout=_request_timeout
118
+ )
119
+ await response_data.read()
120
+ return self.api_client.response_deserialize(
121
+ response_data=response_data,
122
+ response_types_map=_response_types_map,
123
+ ).data
124
+
125
+ @validate_call
126
+ async def v1_workflow_run_create_with_http_info(
127
+ self,
128
+ tenant: Annotated[
129
+ str,
130
+ Field(
131
+ min_length=36, strict=True, max_length=36, description="The tenant id"
132
+ ),
133
+ ],
134
+ v1_trigger_workflow_run_request: Annotated[
135
+ V1TriggerWorkflowRunRequest, Field(description="The workflow run to create")
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[V1WorkflowRunDetails]:
149
+ """Create workflow run
150
+
151
+ Trigger a new workflow run
152
+
153
+ :param tenant: The tenant id (required)
154
+ :type tenant: str
155
+ :param v1_trigger_workflow_run_request: The workflow run to create (required)
156
+ :type v1_trigger_workflow_run_request: V1TriggerWorkflowRunRequest
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_workflow_run_create_serialize(
180
+ tenant=tenant,
181
+ v1_trigger_workflow_run_request=v1_trigger_workflow_run_request,
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": "V1WorkflowRunDetails",
190
+ "400": "APIErrors",
191
+ "403": "APIErrors",
192
+ }
193
+ response_data = await self.api_client.call_api(
194
+ *_param, _request_timeout=_request_timeout
195
+ )
196
+ await response_data.read()
197
+ return self.api_client.response_deserialize(
198
+ response_data=response_data,
199
+ response_types_map=_response_types_map,
200
+ )
201
+
202
+ @validate_call
203
+ async def v1_workflow_run_create_without_preload_content(
204
+ self,
205
+ tenant: Annotated[
206
+ str,
207
+ Field(
208
+ min_length=36, strict=True, max_length=36, description="The tenant id"
209
+ ),
210
+ ],
211
+ v1_trigger_workflow_run_request: Annotated[
212
+ V1TriggerWorkflowRunRequest, Field(description="The workflow run to create")
213
+ ],
214
+ _request_timeout: Union[
215
+ None,
216
+ Annotated[StrictFloat, Field(gt=0)],
217
+ Tuple[
218
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
219
+ ],
220
+ ] = None,
221
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
222
+ _content_type: Optional[StrictStr] = None,
223
+ _headers: Optional[Dict[StrictStr, Any]] = None,
224
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
225
+ ) -> RESTResponseType:
226
+ """Create workflow run
227
+
228
+ Trigger a new workflow run
229
+
230
+ :param tenant: The tenant id (required)
231
+ :type tenant: str
232
+ :param v1_trigger_workflow_run_request: The workflow run to create (required)
233
+ :type v1_trigger_workflow_run_request: V1TriggerWorkflowRunRequest
234
+ :param _request_timeout: timeout setting for this request. If one
235
+ number provided, it will be total request
236
+ timeout. It can also be a pair (tuple) of
237
+ (connection, read) timeouts.
238
+ :type _request_timeout: int, tuple(int, int), optional
239
+ :param _request_auth: set to override the auth_settings for an a single
240
+ request; this effectively ignores the
241
+ authentication in the spec for a single request.
242
+ :type _request_auth: dict, optional
243
+ :param _content_type: force content-type for the request.
244
+ :type _content_type: str, Optional
245
+ :param _headers: set to override the headers for a single
246
+ request; this effectively ignores the headers
247
+ in the spec for a single request.
248
+ :type _headers: dict, optional
249
+ :param _host_index: set to override the host_index for a single
250
+ request; this effectively ignores the host_index
251
+ in the spec for a single request.
252
+ :type _host_index: int, optional
253
+ :return: Returns the result object.
254
+ """ # noqa: E501
255
+
256
+ _param = self._v1_workflow_run_create_serialize(
257
+ tenant=tenant,
258
+ v1_trigger_workflow_run_request=v1_trigger_workflow_run_request,
259
+ _request_auth=_request_auth,
260
+ _content_type=_content_type,
261
+ _headers=_headers,
262
+ _host_index=_host_index,
263
+ )
264
+
265
+ _response_types_map: Dict[str, Optional[str]] = {
266
+ "200": "V1WorkflowRunDetails",
267
+ "400": "APIErrors",
268
+ "403": "APIErrors",
269
+ }
270
+ response_data = await self.api_client.call_api(
271
+ *_param, _request_timeout=_request_timeout
272
+ )
273
+ return response_data.response
274
+
275
+ def _v1_workflow_run_create_serialize(
276
+ self,
277
+ tenant,
278
+ v1_trigger_workflow_run_request,
279
+ _request_auth,
280
+ _content_type,
281
+ _headers,
282
+ _host_index,
283
+ ) -> RequestSerialized:
284
+
285
+ _host = None
286
+
287
+ _collection_formats: Dict[str, str] = {}
288
+
289
+ _path_params: Dict[str, str] = {}
290
+ _query_params: List[Tuple[str, str]] = []
291
+ _header_params: Dict[str, Optional[str]] = _headers or {}
292
+ _form_params: List[Tuple[str, str]] = []
293
+ _files: Dict[
294
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
295
+ ] = {}
296
+ _body_params: Optional[bytes] = None
297
+
298
+ # process the path parameters
299
+ if tenant is not None:
300
+ _path_params["tenant"] = tenant
301
+ # process the query parameters
302
+ # process the header parameters
303
+ # process the form parameters
304
+ # process the body parameter
305
+ if v1_trigger_workflow_run_request is not None:
306
+ _body_params = v1_trigger_workflow_run_request
307
+
308
+ # set the HTTP header `Accept`
309
+ if "Accept" not in _header_params:
310
+ _header_params["Accept"] = self.api_client.select_header_accept(
311
+ ["application/json"]
312
+ )
313
+
314
+ # set the HTTP header `Content-Type`
315
+ if _content_type:
316
+ _header_params["Content-Type"] = _content_type
317
+ else:
318
+ _default_content_type = self.api_client.select_header_content_type(
319
+ ["application/json"]
320
+ )
321
+ if _default_content_type is not None:
322
+ _header_params["Content-Type"] = _default_content_type
323
+
324
+ # authentication setting
325
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
326
+
327
+ return self.api_client.param_serialize(
328
+ method="POST",
329
+ resource_path="/api/v1/stable/tenants/{tenant}/workflow-runs/trigger",
330
+ path_params=_path_params,
331
+ query_params=_query_params,
332
+ header_params=_header_params,
333
+ body=_body_params,
334
+ post_params=_form_params,
335
+ files=_files,
336
+ auth_settings=_auth_settings,
337
+ collection_formats=_collection_formats,
338
+ _host=_host,
339
+ _request_auth=_request_auth,
340
+ )
341
+
342
+ @validate_call
343
+ async def v1_workflow_run_display_names_list(
344
+ self,
345
+ tenant: Annotated[
346
+ str,
347
+ Field(
348
+ min_length=36, strict=True, max_length=36, description="The tenant id"
349
+ ),
350
+ ],
351
+ external_ids: Annotated[
352
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
353
+ Field(
354
+ description="The external ids of the workflow runs to get display names for"
355
+ ),
356
+ ],
357
+ _request_timeout: Union[
358
+ None,
359
+ Annotated[StrictFloat, Field(gt=0)],
360
+ Tuple[
361
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
362
+ ],
363
+ ] = None,
364
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
365
+ _content_type: Optional[StrictStr] = None,
366
+ _headers: Optional[Dict[StrictStr, Any]] = None,
367
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
368
+ ) -> V1WorkflowRunDisplayNameList:
369
+ """List workflow runs
370
+
371
+ Lists displayable names of workflow runs for a tenant
372
+
373
+ :param tenant: The tenant id (required)
374
+ :type tenant: str
375
+ :param external_ids: The external ids of the workflow runs to get display names for (required)
376
+ :type external_ids: List[str]
377
+ :param _request_timeout: timeout setting for this request. If one
378
+ number provided, it will be total request
379
+ timeout. It can also be a pair (tuple) of
380
+ (connection, read) timeouts.
381
+ :type _request_timeout: int, tuple(int, int), optional
382
+ :param _request_auth: set to override the auth_settings for an a single
383
+ request; this effectively ignores the
384
+ authentication in the spec for a single request.
385
+ :type _request_auth: dict, optional
386
+ :param _content_type: force content-type for the request.
387
+ :type _content_type: str, Optional
388
+ :param _headers: set to override the headers for a single
389
+ request; this effectively ignores the headers
390
+ in the spec for a single request.
391
+ :type _headers: dict, optional
392
+ :param _host_index: set to override the host_index for a single
393
+ request; this effectively ignores the host_index
394
+ in the spec for a single request.
395
+ :type _host_index: int, optional
396
+ :return: Returns the result object.
397
+ """ # noqa: E501
398
+
399
+ _param = self._v1_workflow_run_display_names_list_serialize(
400
+ tenant=tenant,
401
+ external_ids=external_ids,
402
+ _request_auth=_request_auth,
403
+ _content_type=_content_type,
404
+ _headers=_headers,
405
+ _host_index=_host_index,
406
+ )
407
+
408
+ _response_types_map: Dict[str, Optional[str]] = {
409
+ "200": "V1WorkflowRunDisplayNameList",
410
+ "400": "APIErrors",
411
+ "403": "APIErrors",
412
+ "501": "APIErrors",
413
+ }
414
+ response_data = await self.api_client.call_api(
415
+ *_param, _request_timeout=_request_timeout
416
+ )
417
+ await response_data.read()
418
+ return self.api_client.response_deserialize(
419
+ response_data=response_data,
420
+ response_types_map=_response_types_map,
421
+ ).data
422
+
423
+ @validate_call
424
+ async def v1_workflow_run_display_names_list_with_http_info(
425
+ self,
426
+ tenant: Annotated[
427
+ str,
428
+ Field(
429
+ min_length=36, strict=True, max_length=36, description="The tenant id"
430
+ ),
431
+ ],
432
+ external_ids: Annotated[
433
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
434
+ Field(
435
+ description="The external ids of the workflow runs to get display names for"
436
+ ),
437
+ ],
438
+ _request_timeout: Union[
439
+ None,
440
+ Annotated[StrictFloat, Field(gt=0)],
441
+ Tuple[
442
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
443
+ ],
444
+ ] = None,
445
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
446
+ _content_type: Optional[StrictStr] = None,
447
+ _headers: Optional[Dict[StrictStr, Any]] = None,
448
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
449
+ ) -> ApiResponse[V1WorkflowRunDisplayNameList]:
450
+ """List workflow runs
451
+
452
+ Lists displayable names of workflow runs for a tenant
453
+
454
+ :param tenant: The tenant id (required)
455
+ :type tenant: str
456
+ :param external_ids: The external ids of the workflow runs to get display names for (required)
457
+ :type external_ids: List[str]
458
+ :param _request_timeout: timeout setting for this request. If one
459
+ number provided, it will be total request
460
+ timeout. It can also be a pair (tuple) of
461
+ (connection, read) timeouts.
462
+ :type _request_timeout: int, tuple(int, int), optional
463
+ :param _request_auth: set to override the auth_settings for an a single
464
+ request; this effectively ignores the
465
+ authentication in the spec for a single request.
466
+ :type _request_auth: dict, optional
467
+ :param _content_type: force content-type for the request.
468
+ :type _content_type: str, Optional
469
+ :param _headers: set to override the headers for a single
470
+ request; this effectively ignores the headers
471
+ in the spec for a single request.
472
+ :type _headers: dict, optional
473
+ :param _host_index: set to override the host_index for a single
474
+ request; this effectively ignores the host_index
475
+ in the spec for a single request.
476
+ :type _host_index: int, optional
477
+ :return: Returns the result object.
478
+ """ # noqa: E501
479
+
480
+ _param = self._v1_workflow_run_display_names_list_serialize(
481
+ tenant=tenant,
482
+ external_ids=external_ids,
483
+ _request_auth=_request_auth,
484
+ _content_type=_content_type,
485
+ _headers=_headers,
486
+ _host_index=_host_index,
487
+ )
488
+
489
+ _response_types_map: Dict[str, Optional[str]] = {
490
+ "200": "V1WorkflowRunDisplayNameList",
491
+ "400": "APIErrors",
492
+ "403": "APIErrors",
493
+ "501": "APIErrors",
494
+ }
495
+ response_data = await self.api_client.call_api(
496
+ *_param, _request_timeout=_request_timeout
497
+ )
498
+ await response_data.read()
499
+ return self.api_client.response_deserialize(
500
+ response_data=response_data,
501
+ response_types_map=_response_types_map,
502
+ )
503
+
504
+ @validate_call
505
+ async def v1_workflow_run_display_names_list_without_preload_content(
506
+ self,
507
+ tenant: Annotated[
508
+ str,
509
+ Field(
510
+ min_length=36, strict=True, max_length=36, description="The tenant id"
511
+ ),
512
+ ],
513
+ external_ids: Annotated[
514
+ List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
515
+ Field(
516
+ description="The external ids of the workflow runs to get display names for"
517
+ ),
518
+ ],
519
+ _request_timeout: Union[
520
+ None,
521
+ Annotated[StrictFloat, Field(gt=0)],
522
+ Tuple[
523
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
524
+ ],
525
+ ] = None,
526
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
527
+ _content_type: Optional[StrictStr] = None,
528
+ _headers: Optional[Dict[StrictStr, Any]] = None,
529
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
530
+ ) -> RESTResponseType:
531
+ """List workflow runs
532
+
533
+ Lists displayable names of workflow runs for a tenant
534
+
535
+ :param tenant: The tenant id (required)
536
+ :type tenant: str
537
+ :param external_ids: The external ids of the workflow runs to get display names for (required)
538
+ :type external_ids: List[str]
539
+ :param _request_timeout: timeout setting for this request. If one
540
+ number provided, it will be total request
541
+ timeout. It can also be a pair (tuple) of
542
+ (connection, read) timeouts.
543
+ :type _request_timeout: int, tuple(int, int), optional
544
+ :param _request_auth: set to override the auth_settings for an a single
545
+ request; this effectively ignores the
546
+ authentication in the spec for a single request.
547
+ :type _request_auth: dict, optional
548
+ :param _content_type: force content-type for the request.
549
+ :type _content_type: str, Optional
550
+ :param _headers: set to override the headers for a single
551
+ request; this effectively ignores the headers
552
+ in the spec for a single request.
553
+ :type _headers: dict, optional
554
+ :param _host_index: set to override the host_index for a single
555
+ request; this effectively ignores the host_index
556
+ in the spec for a single request.
557
+ :type _host_index: int, optional
558
+ :return: Returns the result object.
559
+ """ # noqa: E501
560
+
561
+ _param = self._v1_workflow_run_display_names_list_serialize(
562
+ tenant=tenant,
563
+ external_ids=external_ids,
564
+ _request_auth=_request_auth,
565
+ _content_type=_content_type,
566
+ _headers=_headers,
567
+ _host_index=_host_index,
568
+ )
569
+
570
+ _response_types_map: Dict[str, Optional[str]] = {
571
+ "200": "V1WorkflowRunDisplayNameList",
572
+ "400": "APIErrors",
573
+ "403": "APIErrors",
574
+ "501": "APIErrors",
575
+ }
576
+ response_data = await self.api_client.call_api(
577
+ *_param, _request_timeout=_request_timeout
578
+ )
579
+ return response_data.response
580
+
581
+ def _v1_workflow_run_display_names_list_serialize(
582
+ self,
583
+ tenant,
584
+ external_ids,
585
+ _request_auth,
586
+ _content_type,
587
+ _headers,
588
+ _host_index,
589
+ ) -> RequestSerialized:
590
+
591
+ _host = None
592
+
593
+ _collection_formats: Dict[str, str] = {
594
+ "external_ids": "multi",
595
+ }
596
+
597
+ _path_params: Dict[str, str] = {}
598
+ _query_params: List[Tuple[str, str]] = []
599
+ _header_params: Dict[str, Optional[str]] = _headers or {}
600
+ _form_params: List[Tuple[str, str]] = []
601
+ _files: Dict[
602
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
603
+ ] = {}
604
+ _body_params: Optional[bytes] = None
605
+
606
+ # process the path parameters
607
+ if tenant is not None:
608
+ _path_params["tenant"] = tenant
609
+ # process the query parameters
610
+ if external_ids is not None:
611
+
612
+ _query_params.append(("external_ids", external_ids))
613
+
614
+ # process the header parameters
615
+ # process the form parameters
616
+ # process the body parameter
617
+
618
+ # set the HTTP header `Accept`
619
+ if "Accept" not in _header_params:
620
+ _header_params["Accept"] = self.api_client.select_header_accept(
621
+ ["application/json"]
622
+ )
623
+
624
+ # authentication setting
625
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
626
+
627
+ return self.api_client.param_serialize(
628
+ method="GET",
629
+ resource_path="/api/v1/stable/tenants/{tenant}/workflow-runs/display-names",
630
+ path_params=_path_params,
631
+ query_params=_query_params,
632
+ header_params=_header_params,
633
+ body=_body_params,
634
+ post_params=_form_params,
635
+ files=_files,
636
+ auth_settings=_auth_settings,
637
+ collection_formats=_collection_formats,
638
+ _host=_host,
639
+ _request_auth=_request_auth,
640
+ )
641
+
42
642
  @validate_call
43
643
  async def v1_workflow_run_get(
44
644
  self,
@@ -355,6 +955,10 @@ class WorkflowRunsApi:
355
955
  Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
356
956
  Field(description="The worker id to filter by"),
357
957
  ] = None,
958
+ parent_task_external_id: Annotated[
959
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
960
+ Field(description="The parent task external id to filter by"),
961
+ ] = None,
358
962
  _request_timeout: Union[
359
963
  None,
360
964
  Annotated[StrictFloat, Field(gt=0)],
@@ -391,6 +995,8 @@ class WorkflowRunsApi:
391
995
  :type workflow_ids: List[str]
392
996
  :param worker_id: The worker id to filter by
393
997
  :type worker_id: str
998
+ :param parent_task_external_id: The parent task external id to filter by
999
+ :type parent_task_external_id: str
394
1000
  :param _request_timeout: timeout setting for this request. If one
395
1001
  number provided, it will be total request
396
1002
  timeout. It can also be a pair (tuple) of
@@ -424,6 +1030,7 @@ class WorkflowRunsApi:
424
1030
  additional_metadata=additional_metadata,
425
1031
  workflow_ids=workflow_ids,
426
1032
  worker_id=worker_id,
1033
+ parent_task_external_id=parent_task_external_id,
427
1034
  _request_auth=_request_auth,
428
1035
  _content_type=_content_type,
429
1036
  _headers=_headers,
@@ -486,6 +1093,10 @@ class WorkflowRunsApi:
486
1093
  Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
487
1094
  Field(description="The worker id to filter by"),
488
1095
  ] = None,
1096
+ parent_task_external_id: Annotated[
1097
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
1098
+ Field(description="The parent task external id to filter by"),
1099
+ ] = None,
489
1100
  _request_timeout: Union[
490
1101
  None,
491
1102
  Annotated[StrictFloat, Field(gt=0)],
@@ -522,6 +1133,8 @@ class WorkflowRunsApi:
522
1133
  :type workflow_ids: List[str]
523
1134
  :param worker_id: The worker id to filter by
524
1135
  :type worker_id: str
1136
+ :param parent_task_external_id: The parent task external id to filter by
1137
+ :type parent_task_external_id: str
525
1138
  :param _request_timeout: timeout setting for this request. If one
526
1139
  number provided, it will be total request
527
1140
  timeout. It can also be a pair (tuple) of
@@ -555,6 +1168,7 @@ class WorkflowRunsApi:
555
1168
  additional_metadata=additional_metadata,
556
1169
  workflow_ids=workflow_ids,
557
1170
  worker_id=worker_id,
1171
+ parent_task_external_id=parent_task_external_id,
558
1172
  _request_auth=_request_auth,
559
1173
  _content_type=_content_type,
560
1174
  _headers=_headers,
@@ -617,6 +1231,10 @@ class WorkflowRunsApi:
617
1231
  Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
618
1232
  Field(description="The worker id to filter by"),
619
1233
  ] = None,
1234
+ parent_task_external_id: Annotated[
1235
+ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]],
1236
+ Field(description="The parent task external id to filter by"),
1237
+ ] = None,
620
1238
  _request_timeout: Union[
621
1239
  None,
622
1240
  Annotated[StrictFloat, Field(gt=0)],
@@ -653,6 +1271,8 @@ class WorkflowRunsApi:
653
1271
  :type workflow_ids: List[str]
654
1272
  :param worker_id: The worker id to filter by
655
1273
  :type worker_id: str
1274
+ :param parent_task_external_id: The parent task external id to filter by
1275
+ :type parent_task_external_id: str
656
1276
  :param _request_timeout: timeout setting for this request. If one
657
1277
  number provided, it will be total request
658
1278
  timeout. It can also be a pair (tuple) of
@@ -686,6 +1306,7 @@ class WorkflowRunsApi:
686
1306
  additional_metadata=additional_metadata,
687
1307
  workflow_ids=workflow_ids,
688
1308
  worker_id=worker_id,
1309
+ parent_task_external_id=parent_task_external_id,
689
1310
  _request_auth=_request_auth,
690
1311
  _content_type=_content_type,
691
1312
  _headers=_headers,
@@ -715,6 +1336,7 @@ class WorkflowRunsApi:
715
1336
  additional_metadata,
716
1337
  workflow_ids,
717
1338
  worker_id,
1339
+ parent_task_external_id,
718
1340
  _request_auth,
719
1341
  _content_type,
720
1342
  _headers,
@@ -792,6 +1414,10 @@ class WorkflowRunsApi:
792
1414
 
793
1415
  _query_params.append(("only_tasks", only_tasks))
794
1416
 
1417
+ if parent_task_external_id is not None:
1418
+
1419
+ _query_params.append(("parent_task_external_id", parent_task_external_id))
1420
+
795
1421
  # process the header parameters
796
1422
  # process the form parameters
797
1423
  # process the body parameter