hatchet-sdk 0.40.0a8__py3-none-any.whl → 0.41.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (149) hide show
  1. hatchet_sdk/clients/admin.py +129 -59
  2. hatchet_sdk/clients/dispatcher/action_listener.py +25 -2
  3. hatchet_sdk/clients/events.py +91 -52
  4. hatchet_sdk/clients/rest/__init__.py +21 -0
  5. hatchet_sdk/clients/rest/api/api_token_api.py +12 -9
  6. hatchet_sdk/clients/rest/api/default_api.py +24 -18
  7. hatchet_sdk/clients/rest/api/event_api.py +32 -24
  8. hatchet_sdk/clients/rest/api/github_api.py +4 -3
  9. hatchet_sdk/clients/rest/api/log_api.py +4 -3
  10. hatchet_sdk/clients/rest/api/metadata_api.py +12 -9
  11. hatchet_sdk/clients/rest/api/rate_limits_api.py +7 -4
  12. hatchet_sdk/clients/rest/api/slack_api.py +8 -6
  13. hatchet_sdk/clients/rest/api/sns_api.py +12 -9
  14. hatchet_sdk/clients/rest/api/step_run_api.py +28 -21
  15. hatchet_sdk/clients/rest/api/tenant_api.py +67 -49
  16. hatchet_sdk/clients/rest/api/user_api.py +24 -18
  17. hatchet_sdk/clients/rest/api/worker_api.py +12 -9
  18. hatchet_sdk/clients/rest/api/workflow_api.py +3073 -936
  19. hatchet_sdk/clients/rest/api/workflow_run_api.py +669 -21
  20. hatchet_sdk/clients/rest/api_client.py +34 -11
  21. hatchet_sdk/clients/rest/configuration.py +161 -36
  22. hatchet_sdk/clients/rest/models/__init__.py +21 -0
  23. hatchet_sdk/clients/rest/models/api_errors.py +3 -3
  24. hatchet_sdk/clients/rest/models/bulk_create_event_request.py +3 -3
  25. hatchet_sdk/clients/rest/models/bulk_create_event_response.py +3 -3
  26. hatchet_sdk/clients/{cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py → rest/models/create_cron_workflow_trigger_request.py} +18 -14
  27. hatchet_sdk/clients/{cloud_rest/models/github_app_list_installations200_response_rows_inner.py → rest/models/cron_workflows.py} +54 -21
  28. hatchet_sdk/clients/{cloud_rest/models/log_list200_response.py → rest/models/cron_workflows_list.py} +13 -22
  29. hatchet_sdk/clients/rest/models/cron_workflows_order_by_field.py +37 -0
  30. hatchet_sdk/clients/rest/models/event_list.py +3 -3
  31. hatchet_sdk/clients/rest/models/get_step_run_diff_response.py +3 -3
  32. hatchet_sdk/clients/rest/models/job.py +3 -3
  33. hatchet_sdk/clients/rest/models/job_run.py +3 -3
  34. hatchet_sdk/clients/rest/models/list_api_tokens_response.py +3 -3
  35. hatchet_sdk/clients/rest/models/list_pull_requests_response.py +3 -3
  36. hatchet_sdk/clients/rest/models/list_slack_webhooks.py +3 -3
  37. hatchet_sdk/clients/rest/models/list_sns_integrations.py +3 -3
  38. hatchet_sdk/clients/rest/models/log_line_list.py +3 -3
  39. hatchet_sdk/clients/rest/models/rate_limit_list.py +3 -3
  40. hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py +3 -3
  41. hatchet_sdk/clients/{cloud_rest/models/log_list200_response_rows_inner.py → rest/models/schedule_workflow_run_request.py} +12 -12
  42. hatchet_sdk/clients/rest/models/scheduled_run_status.py +42 -0
  43. hatchet_sdk/clients/rest/models/scheduled_workflows.py +153 -0
  44. hatchet_sdk/clients/{cloud_rest/models/managed_worker_list200_response.py → rest/models/scheduled_workflows_list.py} +13 -22
  45. hatchet_sdk/clients/rest/models/scheduled_workflows_order_by_field.py +37 -0
  46. hatchet_sdk/clients/rest/models/step_run_archive_list.py +3 -3
  47. hatchet_sdk/clients/rest/models/step_run_event_list.py +3 -3
  48. hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py +3 -3
  49. hatchet_sdk/clients/rest/models/tenant_invite_list.py +3 -3
  50. hatchet_sdk/clients/rest/models/tenant_list.py +3 -3
  51. hatchet_sdk/clients/rest/models/tenant_member_list.py +3 -3
  52. hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +16 -0
  53. hatchet_sdk/clients/rest/models/tenant_resource_policy.py +3 -3
  54. hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py +1 -1
  55. hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py +3 -3
  56. hatchet_sdk/clients/rest/models/webhook_worker_list_response.py +3 -3
  57. hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py +3 -3
  58. hatchet_sdk/clients/rest/models/worker.py +20 -9
  59. hatchet_sdk/clients/rest/models/worker_list.py +3 -3
  60. hatchet_sdk/clients/{cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py → rest/models/worker_runtime_info.py} +23 -19
  61. hatchet_sdk/clients/rest/models/worker_runtime_sdks.py +38 -0
  62. hatchet_sdk/clients/rest/models/workflow.py +9 -9
  63. hatchet_sdk/clients/rest/models/workflow_list.py +3 -3
  64. hatchet_sdk/clients/rest/models/workflow_run.py +3 -3
  65. hatchet_sdk/clients/rest/models/workflow_run_list.py +3 -3
  66. hatchet_sdk/clients/rest/models/workflow_run_shape.py +3 -3
  67. hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +1 -5
  68. hatchet_sdk/clients/rest/models/workflow_triggers.py +6 -6
  69. hatchet_sdk/clients/rest/models/workflow_version.py +3 -3
  70. hatchet_sdk/clients/rest/rest.py +3 -3
  71. hatchet_sdk/clients/rest_client.py +200 -21
  72. hatchet_sdk/contracts/dispatcher_pb2.pyi +2 -0
  73. hatchet_sdk/contracts/events_pb2.pyi +2 -0
  74. hatchet_sdk/contracts/workflows_pb2.pyi +2 -0
  75. hatchet_sdk/features/cron.py +286 -0
  76. hatchet_sdk/features/scheduled.py +248 -0
  77. hatchet_sdk/hatchet.py +71 -79
  78. hatchet_sdk/loader.py +37 -14
  79. hatchet_sdk/utils/serialization.py +15 -0
  80. hatchet_sdk/utils/tracing.py +67 -0
  81. hatchet_sdk/worker/runner/runner.py +158 -112
  82. hatchet_sdk/worker/worker.py +1 -17
  83. {hatchet_sdk-0.40.0a8.dist-info → hatchet_sdk-0.41.0.dist-info}/METADATA +8 -2
  84. {hatchet_sdk-0.40.0a8.dist-info → hatchet_sdk-0.41.0.dist-info}/RECORD +86 -140
  85. {hatchet_sdk-0.40.0a8.dist-info → hatchet_sdk-0.41.0.dist-info}/entry_points.txt +0 -1
  86. hatchet_sdk/clients/cloud_rest/__init__.py +0 -186
  87. hatchet_sdk/clients/cloud_rest/api/__init__.py +0 -14
  88. hatchet_sdk/clients/cloud_rest/api/billing_api.py +0 -819
  89. hatchet_sdk/clients/cloud_rest/api/build_api.py +0 -298
  90. hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py +0 -295
  91. hatchet_sdk/clients/cloud_rest/api/github_api.py +0 -1347
  92. hatchet_sdk/clients/cloud_rest/api/log_api.py +0 -971
  93. hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py +0 -2546
  94. hatchet_sdk/clients/cloud_rest/api/metadata_api.py +0 -265
  95. hatchet_sdk/clients/cloud_rest/api/metrics_api.py +0 -1026
  96. hatchet_sdk/clients/cloud_rest/api/tenant_api.py +0 -301
  97. hatchet_sdk/clients/cloud_rest/api/user_api.py +0 -473
  98. hatchet_sdk/clients/cloud_rest/api/workflow_api.py +0 -369
  99. hatchet_sdk/clients/cloud_rest/api_client.py +0 -727
  100. hatchet_sdk/clients/cloud_rest/api_response.py +0 -22
  101. hatchet_sdk/clients/cloud_rest/configuration.py +0 -488
  102. hatchet_sdk/clients/cloud_rest/exceptions.py +0 -200
  103. hatchet_sdk/clients/cloud_rest/models/__init__.py +0 -157
  104. hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py +0 -85
  105. hatchet_sdk/clients/cloud_rest/models/build_get200_response.py +0 -121
  106. hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py +0 -86
  107. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py +0 -119
  108. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py +0 -95
  109. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py +0 -98
  110. hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py +0 -86
  111. hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py +0 -107
  112. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py +0 -136
  113. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py +0 -83
  114. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py +0 -100
  115. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py +0 -86
  116. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py +0 -83
  117. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py +0 -128
  118. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py +0 -121
  119. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py +0 -166
  120. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py +0 -119
  121. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py +0 -117
  122. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py +0 -119
  123. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py +0 -113
  124. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py +0 -154
  125. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py +0 -151
  126. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py +0 -109
  127. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py +0 -171
  128. hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py +0 -131
  129. hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py +0 -101
  130. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py +0 -105
  131. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py +0 -102
  132. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py +0 -108
  133. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py +0 -102
  134. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py +0 -113
  135. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py +0 -93
  136. hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py +0 -83
  137. hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py +0 -114
  138. hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py +0 -88
  139. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py +0 -170
  140. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py +0 -137
  141. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py +0 -103
  142. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py +0 -114
  143. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py +0 -107
  144. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py +0 -105
  145. hatchet_sdk/clients/cloud_rest/rest.py +0 -182
  146. hatchet_sdk/compute/__init__.py +0 -0
  147. hatchet_sdk/compute/configs.py +0 -34
  148. hatchet_sdk/compute/managed_compute.py +0 -111
  149. {hatchet_sdk-0.40.0a8.dist-info → hatchet_sdk-0.41.0.dist-info}/WHEEL +0 -0
@@ -19,6 +19,10 @@ from typing_extensions import Annotated
19
19
 
20
20
  from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized
21
21
  from hatchet_sdk.clients.rest.api_response import ApiResponse
22
+ from hatchet_sdk.clients.rest.models.create_cron_workflow_trigger_request import (
23
+ CreateCronWorkflowTriggerRequest,
24
+ )
25
+ from hatchet_sdk.clients.rest.models.cron_workflows import CronWorkflows
22
26
  from hatchet_sdk.clients.rest.models.event_update_cancel200_response import (
23
27
  EventUpdateCancel200Response,
24
28
  )
@@ -28,6 +32,10 @@ from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import (
28
32
  from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import (
29
33
  ReplayWorkflowRunsResponse,
30
34
  )
35
+ from hatchet_sdk.clients.rest.models.schedule_workflow_run_request import (
36
+ ScheduleWorkflowRunRequest,
37
+ )
38
+ from hatchet_sdk.clients.rest.models.scheduled_workflows import ScheduledWorkflows
31
39
  from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import (
32
40
  TriggerWorkflowRunRequest,
33
41
  )
@@ -38,17 +46,653 @@ from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import (
38
46
  from hatchet_sdk.clients.rest.rest import RESTResponseType
39
47
 
40
48
 
41
- class WorkflowRunApi:
42
- """NOTE: This class is auto generated by OpenAPI Generator
43
- Ref: https://openapi-generator.tech
49
+ class WorkflowRunApi:
50
+ """NOTE: This class is auto generated by OpenAPI Generator
51
+ Ref: https://openapi-generator.tech
52
+
53
+ Do not edit the class manually.
54
+ """
55
+
56
+ def __init__(self, api_client=None) -> None:
57
+ if api_client is None:
58
+ api_client = ApiClient.get_default()
59
+ self.api_client = api_client
60
+
61
+ @validate_call
62
+ async def cron_workflow_trigger_create(
63
+ self,
64
+ tenant: Annotated[
65
+ str,
66
+ Field(
67
+ min_length=36, strict=True, max_length=36, description="The tenant id"
68
+ ),
69
+ ],
70
+ workflow: Annotated[StrictStr, Field(description="The workflow name")],
71
+ create_cron_workflow_trigger_request: Annotated[
72
+ CreateCronWorkflowTriggerRequest,
73
+ Field(description="The input to the cron job workflow trigger"),
74
+ ],
75
+ _request_timeout: Union[
76
+ None,
77
+ Annotated[StrictFloat, Field(gt=0)],
78
+ Tuple[
79
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
80
+ ],
81
+ ] = None,
82
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
83
+ _content_type: Optional[StrictStr] = None,
84
+ _headers: Optional[Dict[StrictStr, Any]] = None,
85
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
86
+ ) -> CronWorkflows:
87
+ """Create cron job workflow trigger
88
+
89
+ Create a new cron job workflow trigger for a tenant
90
+
91
+ :param tenant: The tenant id (required)
92
+ :type tenant: str
93
+ :param workflow: The workflow name (required)
94
+ :type workflow: str
95
+ :param create_cron_workflow_trigger_request: The input to the cron job workflow trigger (required)
96
+ :type create_cron_workflow_trigger_request: CreateCronWorkflowTriggerRequest
97
+ :param _request_timeout: timeout setting for this request. If one
98
+ number provided, it will be total request
99
+ timeout. It can also be a pair (tuple) of
100
+ (connection, read) timeouts.
101
+ :type _request_timeout: int, tuple(int, int), optional
102
+ :param _request_auth: set to override the auth_settings for an a single
103
+ request; this effectively ignores the
104
+ authentication in the spec for a single request.
105
+ :type _request_auth: dict, optional
106
+ :param _content_type: force content-type for the request.
107
+ :type _content_type: str, Optional
108
+ :param _headers: set to override the headers for a single
109
+ request; this effectively ignores the headers
110
+ in the spec for a single request.
111
+ :type _headers: dict, optional
112
+ :param _host_index: set to override the host_index for a single
113
+ request; this effectively ignores the host_index
114
+ in the spec for a single request.
115
+ :type _host_index: int, optional
116
+ :return: Returns the result object.
117
+ """ # noqa: E501
118
+
119
+ _param = self._cron_workflow_trigger_create_serialize(
120
+ tenant=tenant,
121
+ workflow=workflow,
122
+ create_cron_workflow_trigger_request=create_cron_workflow_trigger_request,
123
+ _request_auth=_request_auth,
124
+ _content_type=_content_type,
125
+ _headers=_headers,
126
+ _host_index=_host_index,
127
+ )
128
+
129
+ _response_types_map: Dict[str, Optional[str]] = {
130
+ "200": "CronWorkflows",
131
+ "400": "APIErrors",
132
+ "403": "APIErrors",
133
+ "404": "APIErrors",
134
+ "429": "APIErrors",
135
+ }
136
+ response_data = await self.api_client.call_api(
137
+ *_param, _request_timeout=_request_timeout
138
+ )
139
+ await response_data.read()
140
+ return self.api_client.response_deserialize(
141
+ response_data=response_data,
142
+ response_types_map=_response_types_map,
143
+ ).data
144
+
145
+ @validate_call
146
+ async def cron_workflow_trigger_create_with_http_info(
147
+ self,
148
+ tenant: Annotated[
149
+ str,
150
+ Field(
151
+ min_length=36, strict=True, max_length=36, description="The tenant id"
152
+ ),
153
+ ],
154
+ workflow: Annotated[StrictStr, Field(description="The workflow name")],
155
+ create_cron_workflow_trigger_request: Annotated[
156
+ CreateCronWorkflowTriggerRequest,
157
+ Field(description="The input to the cron job workflow trigger"),
158
+ ],
159
+ _request_timeout: Union[
160
+ None,
161
+ Annotated[StrictFloat, Field(gt=0)],
162
+ Tuple[
163
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
164
+ ],
165
+ ] = None,
166
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
167
+ _content_type: Optional[StrictStr] = None,
168
+ _headers: Optional[Dict[StrictStr, Any]] = None,
169
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
170
+ ) -> ApiResponse[CronWorkflows]:
171
+ """Create cron job workflow trigger
172
+
173
+ Create a new cron job workflow trigger for a tenant
174
+
175
+ :param tenant: The tenant id (required)
176
+ :type tenant: str
177
+ :param workflow: The workflow name (required)
178
+ :type workflow: str
179
+ :param create_cron_workflow_trigger_request: The input to the cron job workflow trigger (required)
180
+ :type create_cron_workflow_trigger_request: CreateCronWorkflowTriggerRequest
181
+ :param _request_timeout: timeout setting for this request. If one
182
+ number provided, it will be total request
183
+ timeout. It can also be a pair (tuple) of
184
+ (connection, read) timeouts.
185
+ :type _request_timeout: int, tuple(int, int), optional
186
+ :param _request_auth: set to override the auth_settings for an a single
187
+ request; this effectively ignores the
188
+ authentication in the spec for a single request.
189
+ :type _request_auth: dict, optional
190
+ :param _content_type: force content-type for the request.
191
+ :type _content_type: str, Optional
192
+ :param _headers: set to override the headers for a single
193
+ request; this effectively ignores the headers
194
+ in the spec for a single request.
195
+ :type _headers: dict, optional
196
+ :param _host_index: set to override the host_index for a single
197
+ request; this effectively ignores the host_index
198
+ in the spec for a single request.
199
+ :type _host_index: int, optional
200
+ :return: Returns the result object.
201
+ """ # noqa: E501
202
+
203
+ _param = self._cron_workflow_trigger_create_serialize(
204
+ tenant=tenant,
205
+ workflow=workflow,
206
+ create_cron_workflow_trigger_request=create_cron_workflow_trigger_request,
207
+ _request_auth=_request_auth,
208
+ _content_type=_content_type,
209
+ _headers=_headers,
210
+ _host_index=_host_index,
211
+ )
212
+
213
+ _response_types_map: Dict[str, Optional[str]] = {
214
+ "200": "CronWorkflows",
215
+ "400": "APIErrors",
216
+ "403": "APIErrors",
217
+ "404": "APIErrors",
218
+ "429": "APIErrors",
219
+ }
220
+ response_data = await self.api_client.call_api(
221
+ *_param, _request_timeout=_request_timeout
222
+ )
223
+ await response_data.read()
224
+ return self.api_client.response_deserialize(
225
+ response_data=response_data,
226
+ response_types_map=_response_types_map,
227
+ )
228
+
229
+ @validate_call
230
+ async def cron_workflow_trigger_create_without_preload_content(
231
+ self,
232
+ tenant: Annotated[
233
+ str,
234
+ Field(
235
+ min_length=36, strict=True, max_length=36, description="The tenant id"
236
+ ),
237
+ ],
238
+ workflow: Annotated[StrictStr, Field(description="The workflow name")],
239
+ create_cron_workflow_trigger_request: Annotated[
240
+ CreateCronWorkflowTriggerRequest,
241
+ Field(description="The input to the cron job workflow trigger"),
242
+ ],
243
+ _request_timeout: Union[
244
+ None,
245
+ Annotated[StrictFloat, Field(gt=0)],
246
+ Tuple[
247
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
248
+ ],
249
+ ] = None,
250
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
251
+ _content_type: Optional[StrictStr] = None,
252
+ _headers: Optional[Dict[StrictStr, Any]] = None,
253
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
254
+ ) -> RESTResponseType:
255
+ """Create cron job workflow trigger
256
+
257
+ Create a new cron job workflow trigger for a tenant
258
+
259
+ :param tenant: The tenant id (required)
260
+ :type tenant: str
261
+ :param workflow: The workflow name (required)
262
+ :type workflow: str
263
+ :param create_cron_workflow_trigger_request: The input to the cron job workflow trigger (required)
264
+ :type create_cron_workflow_trigger_request: CreateCronWorkflowTriggerRequest
265
+ :param _request_timeout: timeout setting for this request. If one
266
+ number provided, it will be total request
267
+ timeout. It can also be a pair (tuple) of
268
+ (connection, read) timeouts.
269
+ :type _request_timeout: int, tuple(int, int), optional
270
+ :param _request_auth: set to override the auth_settings for an a single
271
+ request; this effectively ignores the
272
+ authentication in the spec for a single request.
273
+ :type _request_auth: dict, optional
274
+ :param _content_type: force content-type for the request.
275
+ :type _content_type: str, Optional
276
+ :param _headers: set to override the headers for a single
277
+ request; this effectively ignores the headers
278
+ in the spec for a single request.
279
+ :type _headers: dict, optional
280
+ :param _host_index: set to override the host_index for a single
281
+ request; this effectively ignores the host_index
282
+ in the spec for a single request.
283
+ :type _host_index: int, optional
284
+ :return: Returns the result object.
285
+ """ # noqa: E501
286
+
287
+ _param = self._cron_workflow_trigger_create_serialize(
288
+ tenant=tenant,
289
+ workflow=workflow,
290
+ create_cron_workflow_trigger_request=create_cron_workflow_trigger_request,
291
+ _request_auth=_request_auth,
292
+ _content_type=_content_type,
293
+ _headers=_headers,
294
+ _host_index=_host_index,
295
+ )
296
+
297
+ _response_types_map: Dict[str, Optional[str]] = {
298
+ "200": "CronWorkflows",
299
+ "400": "APIErrors",
300
+ "403": "APIErrors",
301
+ "404": "APIErrors",
302
+ "429": "APIErrors",
303
+ }
304
+ response_data = await self.api_client.call_api(
305
+ *_param, _request_timeout=_request_timeout
306
+ )
307
+ return response_data.response
308
+
309
+ def _cron_workflow_trigger_create_serialize(
310
+ self,
311
+ tenant,
312
+ workflow,
313
+ create_cron_workflow_trigger_request,
314
+ _request_auth,
315
+ _content_type,
316
+ _headers,
317
+ _host_index,
318
+ ) -> RequestSerialized:
319
+
320
+ _host = None
321
+
322
+ _collection_formats: Dict[str, str] = {}
323
+
324
+ _path_params: Dict[str, str] = {}
325
+ _query_params: List[Tuple[str, str]] = []
326
+ _header_params: Dict[str, Optional[str]] = _headers or {}
327
+ _form_params: List[Tuple[str, str]] = []
328
+ _files: Dict[
329
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
330
+ ] = {}
331
+ _body_params: Optional[bytes] = None
332
+
333
+ # process the path parameters
334
+ if tenant is not None:
335
+ _path_params["tenant"] = tenant
336
+ if workflow is not None:
337
+ _path_params["workflow"] = workflow
338
+ # process the query parameters
339
+ # process the header parameters
340
+ # process the form parameters
341
+ # process the body parameter
342
+ if create_cron_workflow_trigger_request is not None:
343
+ _body_params = create_cron_workflow_trigger_request
344
+
345
+ # set the HTTP header `Accept`
346
+ if "Accept" not in _header_params:
347
+ _header_params["Accept"] = self.api_client.select_header_accept(
348
+ ["application/json"]
349
+ )
350
+
351
+ # set the HTTP header `Content-Type`
352
+ if _content_type:
353
+ _header_params["Content-Type"] = _content_type
354
+ else:
355
+ _default_content_type = self.api_client.select_header_content_type(
356
+ ["application/json"]
357
+ )
358
+ if _default_content_type is not None:
359
+ _header_params["Content-Type"] = _default_content_type
360
+
361
+ # authentication setting
362
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
363
+
364
+ return self.api_client.param_serialize(
365
+ method="POST",
366
+ resource_path="/api/v1/tenants/{tenant}/workflows/{workflow}/crons",
367
+ path_params=_path_params,
368
+ query_params=_query_params,
369
+ header_params=_header_params,
370
+ body=_body_params,
371
+ post_params=_form_params,
372
+ files=_files,
373
+ auth_settings=_auth_settings,
374
+ collection_formats=_collection_formats,
375
+ _host=_host,
376
+ _request_auth=_request_auth,
377
+ )
378
+
379
+ @validate_call
380
+ async def scheduled_workflow_run_create(
381
+ self,
382
+ tenant: Annotated[
383
+ str,
384
+ Field(
385
+ min_length=36, strict=True, max_length=36, description="The tenant id"
386
+ ),
387
+ ],
388
+ workflow: Annotated[StrictStr, Field(description="The workflow name")],
389
+ schedule_workflow_run_request: Annotated[
390
+ ScheduleWorkflowRunRequest,
391
+ Field(description="The input to the scheduled workflow run"),
392
+ ],
393
+ _request_timeout: Union[
394
+ None,
395
+ Annotated[StrictFloat, Field(gt=0)],
396
+ Tuple[
397
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
398
+ ],
399
+ ] = None,
400
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
401
+ _content_type: Optional[StrictStr] = None,
402
+ _headers: Optional[Dict[StrictStr, Any]] = None,
403
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
404
+ ) -> ScheduledWorkflows:
405
+ """Trigger workflow run
406
+
407
+ Schedule a new workflow run for a tenant
408
+
409
+ :param tenant: The tenant id (required)
410
+ :type tenant: str
411
+ :param workflow: The workflow name (required)
412
+ :type workflow: str
413
+ :param schedule_workflow_run_request: The input to the scheduled workflow run (required)
414
+ :type schedule_workflow_run_request: ScheduleWorkflowRunRequest
415
+ :param _request_timeout: timeout setting for this request. If one
416
+ number provided, it will be total request
417
+ timeout. It can also be a pair (tuple) of
418
+ (connection, read) timeouts.
419
+ :type _request_timeout: int, tuple(int, int), optional
420
+ :param _request_auth: set to override the auth_settings for an a single
421
+ request; this effectively ignores the
422
+ authentication in the spec for a single request.
423
+ :type _request_auth: dict, optional
424
+ :param _content_type: force content-type for the request.
425
+ :type _content_type: str, Optional
426
+ :param _headers: set to override the headers for a single
427
+ request; this effectively ignores the headers
428
+ in the spec for a single request.
429
+ :type _headers: dict, optional
430
+ :param _host_index: set to override the host_index for a single
431
+ request; this effectively ignores the host_index
432
+ in the spec for a single request.
433
+ :type _host_index: int, optional
434
+ :return: Returns the result object.
435
+ """ # noqa: E501
436
+
437
+ _param = self._scheduled_workflow_run_create_serialize(
438
+ tenant=tenant,
439
+ workflow=workflow,
440
+ schedule_workflow_run_request=schedule_workflow_run_request,
441
+ _request_auth=_request_auth,
442
+ _content_type=_content_type,
443
+ _headers=_headers,
444
+ _host_index=_host_index,
445
+ )
446
+
447
+ _response_types_map: Dict[str, Optional[str]] = {
448
+ "200": "ScheduledWorkflows",
449
+ "400": "APIErrors",
450
+ "403": "APIErrors",
451
+ "404": "APIErrors",
452
+ "429": "APIErrors",
453
+ }
454
+ response_data = await self.api_client.call_api(
455
+ *_param, _request_timeout=_request_timeout
456
+ )
457
+ await response_data.read()
458
+ return self.api_client.response_deserialize(
459
+ response_data=response_data,
460
+ response_types_map=_response_types_map,
461
+ ).data
44
462
 
45
- Do not edit the class manually.
46
- """
463
+ @validate_call
464
+ async def scheduled_workflow_run_create_with_http_info(
465
+ self,
466
+ tenant: Annotated[
467
+ str,
468
+ Field(
469
+ min_length=36, strict=True, max_length=36, description="The tenant id"
470
+ ),
471
+ ],
472
+ workflow: Annotated[StrictStr, Field(description="The workflow name")],
473
+ schedule_workflow_run_request: Annotated[
474
+ ScheduleWorkflowRunRequest,
475
+ Field(description="The input to the scheduled workflow run"),
476
+ ],
477
+ _request_timeout: Union[
478
+ None,
479
+ Annotated[StrictFloat, Field(gt=0)],
480
+ Tuple[
481
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
482
+ ],
483
+ ] = None,
484
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
485
+ _content_type: Optional[StrictStr] = None,
486
+ _headers: Optional[Dict[StrictStr, Any]] = None,
487
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
488
+ ) -> ApiResponse[ScheduledWorkflows]:
489
+ """Trigger workflow run
47
490
 
48
- def __init__(self, api_client=None) -> None:
49
- if api_client is None:
50
- api_client = ApiClient.get_default()
51
- self.api_client = api_client
491
+ Schedule a new workflow run for a tenant
492
+
493
+ :param tenant: The tenant id (required)
494
+ :type tenant: str
495
+ :param workflow: The workflow name (required)
496
+ :type workflow: str
497
+ :param schedule_workflow_run_request: The input to the scheduled workflow run (required)
498
+ :type schedule_workflow_run_request: ScheduleWorkflowRunRequest
499
+ :param _request_timeout: timeout setting for this request. If one
500
+ number provided, it will be total request
501
+ timeout. It can also be a pair (tuple) of
502
+ (connection, read) timeouts.
503
+ :type _request_timeout: int, tuple(int, int), optional
504
+ :param _request_auth: set to override the auth_settings for an a single
505
+ request; this effectively ignores the
506
+ authentication in the spec for a single request.
507
+ :type _request_auth: dict, optional
508
+ :param _content_type: force content-type for the request.
509
+ :type _content_type: str, Optional
510
+ :param _headers: set to override the headers for a single
511
+ request; this effectively ignores the headers
512
+ in the spec for a single request.
513
+ :type _headers: dict, optional
514
+ :param _host_index: set to override the host_index for a single
515
+ request; this effectively ignores the host_index
516
+ in the spec for a single request.
517
+ :type _host_index: int, optional
518
+ :return: Returns the result object.
519
+ """ # noqa: E501
520
+
521
+ _param = self._scheduled_workflow_run_create_serialize(
522
+ tenant=tenant,
523
+ workflow=workflow,
524
+ schedule_workflow_run_request=schedule_workflow_run_request,
525
+ _request_auth=_request_auth,
526
+ _content_type=_content_type,
527
+ _headers=_headers,
528
+ _host_index=_host_index,
529
+ )
530
+
531
+ _response_types_map: Dict[str, Optional[str]] = {
532
+ "200": "ScheduledWorkflows",
533
+ "400": "APIErrors",
534
+ "403": "APIErrors",
535
+ "404": "APIErrors",
536
+ "429": "APIErrors",
537
+ }
538
+ response_data = await self.api_client.call_api(
539
+ *_param, _request_timeout=_request_timeout
540
+ )
541
+ await response_data.read()
542
+ return self.api_client.response_deserialize(
543
+ response_data=response_data,
544
+ response_types_map=_response_types_map,
545
+ )
546
+
547
+ @validate_call
548
+ async def scheduled_workflow_run_create_without_preload_content(
549
+ self,
550
+ tenant: Annotated[
551
+ str,
552
+ Field(
553
+ min_length=36, strict=True, max_length=36, description="The tenant id"
554
+ ),
555
+ ],
556
+ workflow: Annotated[StrictStr, Field(description="The workflow name")],
557
+ schedule_workflow_run_request: Annotated[
558
+ ScheduleWorkflowRunRequest,
559
+ Field(description="The input to the scheduled workflow run"),
560
+ ],
561
+ _request_timeout: Union[
562
+ None,
563
+ Annotated[StrictFloat, Field(gt=0)],
564
+ Tuple[
565
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
566
+ ],
567
+ ] = None,
568
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
569
+ _content_type: Optional[StrictStr] = None,
570
+ _headers: Optional[Dict[StrictStr, Any]] = None,
571
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
572
+ ) -> RESTResponseType:
573
+ """Trigger workflow run
574
+
575
+ Schedule a new workflow run for a tenant
576
+
577
+ :param tenant: The tenant id (required)
578
+ :type tenant: str
579
+ :param workflow: The workflow name (required)
580
+ :type workflow: str
581
+ :param schedule_workflow_run_request: The input to the scheduled workflow run (required)
582
+ :type schedule_workflow_run_request: ScheduleWorkflowRunRequest
583
+ :param _request_timeout: timeout setting for this request. If one
584
+ number provided, it will be total request
585
+ timeout. It can also be a pair (tuple) of
586
+ (connection, read) timeouts.
587
+ :type _request_timeout: int, tuple(int, int), optional
588
+ :param _request_auth: set to override the auth_settings for an a single
589
+ request; this effectively ignores the
590
+ authentication in the spec for a single request.
591
+ :type _request_auth: dict, optional
592
+ :param _content_type: force content-type for the request.
593
+ :type _content_type: str, Optional
594
+ :param _headers: set to override the headers for a single
595
+ request; this effectively ignores the headers
596
+ in the spec for a single request.
597
+ :type _headers: dict, optional
598
+ :param _host_index: set to override the host_index for a single
599
+ request; this effectively ignores the host_index
600
+ in the spec for a single request.
601
+ :type _host_index: int, optional
602
+ :return: Returns the result object.
603
+ """ # noqa: E501
604
+
605
+ _param = self._scheduled_workflow_run_create_serialize(
606
+ tenant=tenant,
607
+ workflow=workflow,
608
+ schedule_workflow_run_request=schedule_workflow_run_request,
609
+ _request_auth=_request_auth,
610
+ _content_type=_content_type,
611
+ _headers=_headers,
612
+ _host_index=_host_index,
613
+ )
614
+
615
+ _response_types_map: Dict[str, Optional[str]] = {
616
+ "200": "ScheduledWorkflows",
617
+ "400": "APIErrors",
618
+ "403": "APIErrors",
619
+ "404": "APIErrors",
620
+ "429": "APIErrors",
621
+ }
622
+ response_data = await self.api_client.call_api(
623
+ *_param, _request_timeout=_request_timeout
624
+ )
625
+ return response_data.response
626
+
627
+ def _scheduled_workflow_run_create_serialize(
628
+ self,
629
+ tenant,
630
+ workflow,
631
+ schedule_workflow_run_request,
632
+ _request_auth,
633
+ _content_type,
634
+ _headers,
635
+ _host_index,
636
+ ) -> RequestSerialized:
637
+
638
+ _host = None
639
+
640
+ _collection_formats: Dict[str, str] = {}
641
+
642
+ _path_params: Dict[str, str] = {}
643
+ _query_params: List[Tuple[str, str]] = []
644
+ _header_params: Dict[str, Optional[str]] = _headers or {}
645
+ _form_params: List[Tuple[str, str]] = []
646
+ _files: Dict[
647
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
648
+ ] = {}
649
+ _body_params: Optional[bytes] = None
650
+
651
+ # process the path parameters
652
+ if tenant is not None:
653
+ _path_params["tenant"] = tenant
654
+ if workflow is not None:
655
+ _path_params["workflow"] = workflow
656
+ # process the query parameters
657
+ # process the header parameters
658
+ # process the form parameters
659
+ # process the body parameter
660
+ if schedule_workflow_run_request is not None:
661
+ _body_params = schedule_workflow_run_request
662
+
663
+ # set the HTTP header `Accept`
664
+ if "Accept" not in _header_params:
665
+ _header_params["Accept"] = self.api_client.select_header_accept(
666
+ ["application/json"]
667
+ )
668
+
669
+ # set the HTTP header `Content-Type`
670
+ if _content_type:
671
+ _header_params["Content-Type"] = _content_type
672
+ else:
673
+ _default_content_type = self.api_client.select_header_content_type(
674
+ ["application/json"]
675
+ )
676
+ if _default_content_type is not None:
677
+ _header_params["Content-Type"] = _default_content_type
678
+
679
+ # authentication setting
680
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
681
+
682
+ return self.api_client.param_serialize(
683
+ method="POST",
684
+ resource_path="/api/v1/tenants/{tenant}/workflows/{workflow}/scheduled",
685
+ path_params=_path_params,
686
+ query_params=_query_params,
687
+ header_params=_header_params,
688
+ body=_body_params,
689
+ post_params=_form_params,
690
+ files=_files,
691
+ auth_settings=_auth_settings,
692
+ collection_formats=_collection_formats,
693
+ _host=_host,
694
+ _request_auth=_request_auth,
695
+ )
52
696
 
53
697
  @validate_call
54
698
  async def workflow_run_cancel(
@@ -314,9 +958,10 @@ class WorkflowRunApi:
314
958
  _body_params = workflow_runs_cancel_request
315
959
 
316
960
  # set the HTTP header `Accept`
317
- _header_params["Accept"] = self.api_client.select_header_accept(
318
- ["application/json"]
319
- )
961
+ if "Accept" not in _header_params:
962
+ _header_params["Accept"] = self.api_client.select_header_accept(
963
+ ["application/json"]
964
+ )
320
965
 
321
966
  # set the HTTP header `Content-Type`
322
967
  if _content_type:
@@ -648,9 +1293,10 @@ class WorkflowRunApi:
648
1293
  _body_params = trigger_workflow_run_request
649
1294
 
650
1295
  # set the HTTP header `Accept`
651
- _header_params["Accept"] = self.api_client.select_header_accept(
652
- ["application/json"]
653
- )
1296
+ if "Accept" not in _header_params:
1297
+ _header_params["Accept"] = self.api_client.select_header_accept(
1298
+ ["application/json"]
1299
+ )
654
1300
 
655
1301
  # set the HTTP header `Content-Type`
656
1302
  if _content_type:
@@ -962,9 +1608,10 @@ class WorkflowRunApi:
962
1608
  # process the body parameter
963
1609
 
964
1610
  # set the HTTP header `Accept`
965
- _header_params["Accept"] = self.api_client.select_header_accept(
966
- ["application/json"]
967
- )
1611
+ if "Accept" not in _header_params:
1612
+ _header_params["Accept"] = self.api_client.select_header_accept(
1613
+ ["application/json"]
1614
+ )
968
1615
 
969
1616
  # authentication setting
970
1617
  _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
@@ -1251,9 +1898,10 @@ class WorkflowRunApi:
1251
1898
  _body_params = replay_workflow_runs_request
1252
1899
 
1253
1900
  # set the HTTP header `Accept`
1254
- _header_params["Accept"] = self.api_client.select_header_accept(
1255
- ["application/json"]
1256
- )
1901
+ if "Accept" not in _header_params:
1902
+ _header_params["Accept"] = self.api_client.select_header_accept(
1903
+ ["application/json"]
1904
+ )
1257
1905
 
1258
1906
  # set the HTTP header `Content-Type`
1259
1907
  if _content_type: