hatchet-sdk 0.40.0a9__py3-none-any.whl → 0.42.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.
- hatchet_sdk/clients/admin.py +129 -59
- hatchet_sdk/clients/dispatcher/action_listener.py +25 -2
- hatchet_sdk/clients/events.py +91 -52
- hatchet_sdk/clients/rest/__init__.py +21 -0
- hatchet_sdk/clients/rest/api/api_token_api.py +12 -9
- hatchet_sdk/clients/rest/api/default_api.py +24 -18
- hatchet_sdk/clients/rest/api/event_api.py +32 -24
- hatchet_sdk/clients/rest/api/github_api.py +4 -3
- hatchet_sdk/clients/rest/api/log_api.py +4 -3
- hatchet_sdk/clients/rest/api/metadata_api.py +12 -9
- hatchet_sdk/clients/rest/api/rate_limits_api.py +7 -4
- hatchet_sdk/clients/rest/api/slack_api.py +8 -6
- hatchet_sdk/clients/rest/api/sns_api.py +12 -9
- hatchet_sdk/clients/rest/api/step_run_api.py +28 -21
- hatchet_sdk/clients/rest/api/tenant_api.py +67 -49
- hatchet_sdk/clients/rest/api/user_api.py +24 -18
- hatchet_sdk/clients/rest/api/worker_api.py +12 -9
- hatchet_sdk/clients/rest/api/workflow_api.py +3073 -936
- hatchet_sdk/clients/rest/api/workflow_run_api.py +669 -21
- hatchet_sdk/clients/rest/api_client.py +34 -11
- hatchet_sdk/clients/rest/configuration.py +161 -36
- hatchet_sdk/clients/rest/models/__init__.py +21 -0
- hatchet_sdk/clients/rest/models/api_errors.py +3 -3
- hatchet_sdk/clients/rest/models/bulk_create_event_request.py +3 -3
- hatchet_sdk/clients/rest/models/bulk_create_event_response.py +3 -3
- 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
- hatchet_sdk/clients/{cloud_rest/models/github_app_list_installations200_response_rows_inner.py → rest/models/cron_workflows.py} +54 -21
- hatchet_sdk/clients/{cloud_rest/models/log_list200_response.py → rest/models/cron_workflows_list.py} +13 -22
- hatchet_sdk/clients/rest/models/cron_workflows_order_by_field.py +37 -0
- hatchet_sdk/clients/rest/models/event_list.py +3 -3
- hatchet_sdk/clients/rest/models/get_step_run_diff_response.py +3 -3
- hatchet_sdk/clients/rest/models/job.py +3 -3
- hatchet_sdk/clients/rest/models/job_run.py +3 -3
- hatchet_sdk/clients/rest/models/list_api_tokens_response.py +3 -3
- hatchet_sdk/clients/rest/models/list_pull_requests_response.py +3 -3
- hatchet_sdk/clients/rest/models/list_slack_webhooks.py +3 -3
- hatchet_sdk/clients/rest/models/list_sns_integrations.py +3 -3
- hatchet_sdk/clients/rest/models/log_line_list.py +3 -3
- hatchet_sdk/clients/rest/models/rate_limit_list.py +3 -3
- hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py +3 -3
- hatchet_sdk/clients/{cloud_rest/models/log_list200_response_rows_inner.py → rest/models/schedule_workflow_run_request.py} +12 -12
- hatchet_sdk/clients/rest/models/scheduled_run_status.py +42 -0
- hatchet_sdk/clients/rest/models/scheduled_workflows.py +153 -0
- hatchet_sdk/clients/{cloud_rest/models/managed_worker_list200_response.py → rest/models/scheduled_workflows_list.py} +13 -22
- hatchet_sdk/clients/rest/models/scheduled_workflows_order_by_field.py +37 -0
- hatchet_sdk/clients/rest/models/step_run_archive_list.py +3 -3
- hatchet_sdk/clients/rest/models/step_run_event_list.py +3 -3
- hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py +3 -3
- hatchet_sdk/clients/rest/models/tenant_invite_list.py +3 -3
- hatchet_sdk/clients/rest/models/tenant_list.py +3 -3
- hatchet_sdk/clients/rest/models/tenant_member_list.py +3 -3
- hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +16 -0
- hatchet_sdk/clients/rest/models/tenant_resource_policy.py +3 -3
- hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py +1 -1
- hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py +3 -3
- hatchet_sdk/clients/rest/models/webhook_worker_list_response.py +3 -3
- hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py +3 -3
- hatchet_sdk/clients/rest/models/worker.py +20 -9
- hatchet_sdk/clients/rest/models/worker_list.py +3 -3
- hatchet_sdk/clients/{cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py → rest/models/worker_runtime_info.py} +23 -19
- hatchet_sdk/clients/rest/models/worker_runtime_sdks.py +38 -0
- hatchet_sdk/clients/rest/models/workflow.py +9 -9
- hatchet_sdk/clients/rest/models/workflow_list.py +3 -3
- hatchet_sdk/clients/rest/models/workflow_run.py +3 -3
- hatchet_sdk/clients/rest/models/workflow_run_list.py +3 -3
- hatchet_sdk/clients/rest/models/workflow_run_shape.py +3 -3
- hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +1 -5
- hatchet_sdk/clients/rest/models/workflow_triggers.py +6 -6
- hatchet_sdk/clients/rest/models/workflow_version.py +3 -3
- hatchet_sdk/clients/rest/rest.py +3 -3
- hatchet_sdk/clients/rest_client.py +200 -21
- hatchet_sdk/contracts/dispatcher_pb2.py +71 -67
- hatchet_sdk/contracts/dispatcher_pb2.pyi +31 -2
- hatchet_sdk/contracts/events_pb2.pyi +2 -0
- hatchet_sdk/contracts/workflows_pb2.py +42 -40
- hatchet_sdk/contracts/workflows_pb2.pyi +24 -6
- hatchet_sdk/features/cron.py +286 -0
- hatchet_sdk/features/scheduled.py +248 -0
- hatchet_sdk/hatchet.py +80 -79
- hatchet_sdk/loader.py +37 -14
- hatchet_sdk/utils/serialization.py +15 -0
- hatchet_sdk/utils/tracing.py +67 -0
- hatchet_sdk/worker/runner/runner.py +158 -112
- hatchet_sdk/worker/worker.py +1 -17
- hatchet_sdk/workflow.py +4 -0
- {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/METADATA +8 -2
- {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/RECORD +89 -143
- {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/entry_points.txt +1 -1
- hatchet_sdk/clients/cloud_rest/__init__.py +0 -186
- hatchet_sdk/clients/cloud_rest/api/__init__.py +0 -14
- hatchet_sdk/clients/cloud_rest/api/billing_api.py +0 -819
- hatchet_sdk/clients/cloud_rest/api/build_api.py +0 -298
- hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py +0 -295
- hatchet_sdk/clients/cloud_rest/api/github_api.py +0 -1347
- hatchet_sdk/clients/cloud_rest/api/log_api.py +0 -971
- hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py +0 -2546
- hatchet_sdk/clients/cloud_rest/api/metadata_api.py +0 -265
- hatchet_sdk/clients/cloud_rest/api/metrics_api.py +0 -1026
- hatchet_sdk/clients/cloud_rest/api/tenant_api.py +0 -301
- hatchet_sdk/clients/cloud_rest/api/user_api.py +0 -473
- hatchet_sdk/clients/cloud_rest/api/workflow_api.py +0 -369
- hatchet_sdk/clients/cloud_rest/api_client.py +0 -727
- hatchet_sdk/clients/cloud_rest/api_response.py +0 -22
- hatchet_sdk/clients/cloud_rest/configuration.py +0 -488
- hatchet_sdk/clients/cloud_rest/exceptions.py +0 -200
- hatchet_sdk/clients/cloud_rest/models/__init__.py +0 -157
- hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py +0 -85
- hatchet_sdk/clients/cloud_rest/models/build_get200_response.py +0 -121
- hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py +0 -86
- hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py +0 -119
- hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py +0 -95
- hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py +0 -98
- hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py +0 -86
- hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py +0 -107
- hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py +0 -136
- hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py +0 -83
- hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py +0 -100
- hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py +0 -86
- hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py +0 -83
- hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py +0 -128
- hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py +0 -121
- hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py +0 -166
- hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py +0 -119
- hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py +0 -117
- hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py +0 -119
- hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py +0 -113
- hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py +0 -154
- hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py +0 -151
- hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py +0 -109
- hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py +0 -171
- hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py +0 -131
- hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py +0 -101
- hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py +0 -105
- hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py +0 -102
- hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py +0 -108
- hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py +0 -102
- hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py +0 -113
- hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py +0 -93
- hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py +0 -83
- hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py +0 -114
- hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py +0 -88
- hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py +0 -170
- hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py +0 -137
- hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py +0 -103
- hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py +0 -114
- hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py +0 -107
- hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py +0 -105
- hatchet_sdk/clients/cloud_rest/rest.py +0 -182
- hatchet_sdk/compute/__init__.py +0 -0
- hatchet_sdk/compute/configs.py +0 -34
- hatchet_sdk/compute/managed_compute.py +0 -111
- {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.42.0.dist-info}/WHEEL +0 -0
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
import datetime
|
|
16
|
+
import decimal
|
|
16
17
|
import json
|
|
17
18
|
import mimetypes
|
|
18
19
|
import os
|
|
@@ -68,6 +69,7 @@ class ApiClient:
|
|
|
68
69
|
"bool": bool,
|
|
69
70
|
"date": datetime.date,
|
|
70
71
|
"datetime": datetime.datetime,
|
|
72
|
+
"decimal": decimal.Decimal,
|
|
71
73
|
"object": object,
|
|
72
74
|
}
|
|
73
75
|
_pool = None
|
|
@@ -220,7 +222,7 @@ class ApiClient:
|
|
|
220
222
|
body = self.sanitize_for_serialization(body)
|
|
221
223
|
|
|
222
224
|
# request url
|
|
223
|
-
if _host is None:
|
|
225
|
+
if _host is None or self.configuration.ignore_operation_servers:
|
|
224
226
|
url = self.configuration.host + resource_path
|
|
225
227
|
else:
|
|
226
228
|
# use server/host defined in path or operation instead
|
|
@@ -311,12 +313,9 @@ class ApiClient:
|
|
|
311
313
|
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
|
312
314
|
encoding = match.group(1) if match else "utf-8"
|
|
313
315
|
response_text = response_data.data.decode(encoding)
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
)
|
|
318
|
-
else:
|
|
319
|
-
return_data = self.deserialize(response_text, response_type)
|
|
316
|
+
return_data = self.deserialize(
|
|
317
|
+
response_text, response_type, content_type
|
|
318
|
+
)
|
|
320
319
|
finally:
|
|
321
320
|
if not 200 <= response_data.status <= 299:
|
|
322
321
|
raise ApiException.from_response(
|
|
@@ -340,6 +339,7 @@ class ApiClient:
|
|
|
340
339
|
If obj is str, int, long, float, bool, return directly.
|
|
341
340
|
If obj is datetime.datetime, datetime.date
|
|
342
341
|
convert to string in iso8601 format.
|
|
342
|
+
If obj is decimal.Decimal return string representation.
|
|
343
343
|
If obj is list, sanitize each element in the list.
|
|
344
344
|
If obj is dict, return the dict.
|
|
345
345
|
If obj is OpenAPI model, return the properties dict.
|
|
@@ -361,6 +361,8 @@ class ApiClient:
|
|
|
361
361
|
return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj)
|
|
362
362
|
elif isinstance(obj, (datetime.datetime, datetime.date)):
|
|
363
363
|
return obj.isoformat()
|
|
364
|
+
elif isinstance(obj, decimal.Decimal):
|
|
365
|
+
return str(obj)
|
|
364
366
|
|
|
365
367
|
elif isinstance(obj, dict):
|
|
366
368
|
obj_dict = obj
|
|
@@ -379,21 +381,40 @@ class ApiClient:
|
|
|
379
381
|
key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()
|
|
380
382
|
}
|
|
381
383
|
|
|
382
|
-
def deserialize(
|
|
384
|
+
def deserialize(
|
|
385
|
+
self, response_text: str, response_type: str, content_type: Optional[str]
|
|
386
|
+
):
|
|
383
387
|
"""Deserializes response into an object.
|
|
384
388
|
|
|
385
389
|
:param response: RESTResponse object to be deserialized.
|
|
386
390
|
:param response_type: class literal for
|
|
387
391
|
deserialized object, or string of class name.
|
|
392
|
+
:param content_type: content type of response.
|
|
388
393
|
|
|
389
394
|
:return: deserialized object.
|
|
390
395
|
"""
|
|
391
396
|
|
|
392
397
|
# fetch data from response object
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
398
|
+
if content_type is None:
|
|
399
|
+
try:
|
|
400
|
+
data = json.loads(response_text)
|
|
401
|
+
except ValueError:
|
|
402
|
+
data = response_text
|
|
403
|
+
elif re.match(
|
|
404
|
+
r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)",
|
|
405
|
+
content_type,
|
|
406
|
+
re.IGNORECASE,
|
|
407
|
+
):
|
|
408
|
+
if response_text == "":
|
|
409
|
+
data = ""
|
|
410
|
+
else:
|
|
411
|
+
data = json.loads(response_text)
|
|
412
|
+
elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE):
|
|
396
413
|
data = response_text
|
|
414
|
+
else:
|
|
415
|
+
raise ApiException(
|
|
416
|
+
status=0, reason="Unsupported content type: {0}".format(content_type)
|
|
417
|
+
)
|
|
397
418
|
|
|
398
419
|
return self.__deserialize(data, response_type)
|
|
399
420
|
|
|
@@ -435,6 +456,8 @@ class ApiClient:
|
|
|
435
456
|
return self.__deserialize_date(data)
|
|
436
457
|
elif klass == datetime.datetime:
|
|
437
458
|
return self.__deserialize_datetime(data)
|
|
459
|
+
elif klass == decimal.Decimal:
|
|
460
|
+
return decimal.Decimal(data)
|
|
438
461
|
elif issubclass(klass, Enum):
|
|
439
462
|
return self.__deserialize_enum(data, klass)
|
|
440
463
|
else:
|
|
@@ -17,9 +17,10 @@ import http.client as httplib
|
|
|
17
17
|
import logging
|
|
18
18
|
import sys
|
|
19
19
|
from logging import FileHandler
|
|
20
|
-
from typing import Optional
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict
|
|
21
21
|
|
|
22
22
|
import urllib3
|
|
23
|
+
from typing_extensions import NotRequired, Self
|
|
23
24
|
|
|
24
25
|
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
|
25
26
|
"multipleOf",
|
|
@@ -34,11 +35,115 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
|
|
34
35
|
"minItems",
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
ServerVariablesT = Dict[str, str]
|
|
39
|
+
|
|
40
|
+
GenericAuthSetting = TypedDict(
|
|
41
|
+
"GenericAuthSetting",
|
|
42
|
+
{
|
|
43
|
+
"type": str,
|
|
44
|
+
"in": str,
|
|
45
|
+
"key": str,
|
|
46
|
+
"value": str,
|
|
47
|
+
},
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
OAuth2AuthSetting = TypedDict(
|
|
52
|
+
"OAuth2AuthSetting",
|
|
53
|
+
{
|
|
54
|
+
"type": Literal["oauth2"],
|
|
55
|
+
"in": Literal["header"],
|
|
56
|
+
"key": Literal["Authorization"],
|
|
57
|
+
"value": str,
|
|
58
|
+
},
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
APIKeyAuthSetting = TypedDict(
|
|
63
|
+
"APIKeyAuthSetting",
|
|
64
|
+
{
|
|
65
|
+
"type": Literal["api_key"],
|
|
66
|
+
"in": str,
|
|
67
|
+
"key": str,
|
|
68
|
+
"value": Optional[str],
|
|
69
|
+
},
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
BasicAuthSetting = TypedDict(
|
|
74
|
+
"BasicAuthSetting",
|
|
75
|
+
{
|
|
76
|
+
"type": Literal["basic"],
|
|
77
|
+
"in": Literal["header"],
|
|
78
|
+
"key": Literal["Authorization"],
|
|
79
|
+
"value": Optional[str],
|
|
80
|
+
},
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
BearerFormatAuthSetting = TypedDict(
|
|
85
|
+
"BearerFormatAuthSetting",
|
|
86
|
+
{
|
|
87
|
+
"type": Literal["bearer"],
|
|
88
|
+
"in": Literal["header"],
|
|
89
|
+
"format": Literal["JWT"],
|
|
90
|
+
"key": Literal["Authorization"],
|
|
91
|
+
"value": str,
|
|
92
|
+
},
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
BearerAuthSetting = TypedDict(
|
|
97
|
+
"BearerAuthSetting",
|
|
98
|
+
{
|
|
99
|
+
"type": Literal["bearer"],
|
|
100
|
+
"in": Literal["header"],
|
|
101
|
+
"key": Literal["Authorization"],
|
|
102
|
+
"value": str,
|
|
103
|
+
},
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
HTTPSignatureAuthSetting = TypedDict(
|
|
108
|
+
"HTTPSignatureAuthSetting",
|
|
109
|
+
{
|
|
110
|
+
"type": Literal["http-signature"],
|
|
111
|
+
"in": Literal["header"],
|
|
112
|
+
"key": Literal["Authorization"],
|
|
113
|
+
"value": None,
|
|
114
|
+
},
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
AuthSettings = TypedDict(
|
|
119
|
+
"AuthSettings",
|
|
120
|
+
{
|
|
121
|
+
"bearerAuth": BearerAuthSetting,
|
|
122
|
+
"cookieAuth": APIKeyAuthSetting,
|
|
123
|
+
},
|
|
124
|
+
total=False,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class HostSettingVariable(TypedDict):
|
|
129
|
+
description: str
|
|
130
|
+
default_value: str
|
|
131
|
+
enum_values: List[str]
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
class HostSetting(TypedDict):
|
|
135
|
+
url: str
|
|
136
|
+
description: str
|
|
137
|
+
variables: NotRequired[Dict[str, HostSettingVariable]]
|
|
138
|
+
|
|
37
139
|
|
|
38
140
|
class Configuration:
|
|
39
141
|
"""This class contains various settings of the API client.
|
|
40
142
|
|
|
41
143
|
:param host: Base url.
|
|
144
|
+
:param ignore_operation_servers
|
|
145
|
+
Boolean to ignore operation servers for the API client.
|
|
146
|
+
Config will use `host` as the base url regardless of the operation servers.
|
|
42
147
|
:param api_key: Dict to store API key(s).
|
|
43
148
|
Each entry in the dict specifies an API key.
|
|
44
149
|
The dict key is the name of the security scheme in the OAS specification.
|
|
@@ -61,6 +166,7 @@ class Configuration:
|
|
|
61
166
|
values before.
|
|
62
167
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
|
63
168
|
in PEM format.
|
|
169
|
+
:param retries: Number of retries for API requests.
|
|
64
170
|
|
|
65
171
|
:Example:
|
|
66
172
|
|
|
@@ -84,21 +190,25 @@ class Configuration:
|
|
|
84
190
|
Cookie: JSESSIONID abc123
|
|
85
191
|
"""
|
|
86
192
|
|
|
87
|
-
_default = None
|
|
193
|
+
_default: ClassVar[Optional[Self]] = None
|
|
88
194
|
|
|
89
195
|
def __init__(
|
|
90
196
|
self,
|
|
91
|
-
host=None,
|
|
92
|
-
api_key=None,
|
|
93
|
-
api_key_prefix=None,
|
|
94
|
-
username=None,
|
|
95
|
-
password=None,
|
|
96
|
-
access_token=None,
|
|
97
|
-
server_index=None,
|
|
98
|
-
server_variables=None,
|
|
99
|
-
server_operation_index=None,
|
|
100
|
-
server_operation_variables=None,
|
|
101
|
-
|
|
197
|
+
host: Optional[str] = None,
|
|
198
|
+
api_key: Optional[Dict[str, str]] = None,
|
|
199
|
+
api_key_prefix: Optional[Dict[str, str]] = None,
|
|
200
|
+
username: Optional[str] = None,
|
|
201
|
+
password: Optional[str] = None,
|
|
202
|
+
access_token: Optional[str] = None,
|
|
203
|
+
server_index: Optional[int] = None,
|
|
204
|
+
server_variables: Optional[ServerVariablesT] = None,
|
|
205
|
+
server_operation_index: Optional[Dict[int, int]] = None,
|
|
206
|
+
server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None,
|
|
207
|
+
ignore_operation_servers: bool = False,
|
|
208
|
+
ssl_ca_cert: Optional[str] = None,
|
|
209
|
+
retries: Optional[int] = None,
|
|
210
|
+
*,
|
|
211
|
+
debug: Optional[bool] = None,
|
|
102
212
|
) -> None:
|
|
103
213
|
"""Constructor"""
|
|
104
214
|
self._base_path = "http://localhost" if host is None else host
|
|
@@ -112,6 +222,9 @@ class Configuration:
|
|
|
112
222
|
self.server_operation_variables = server_operation_variables or {}
|
|
113
223
|
"""Default server variables
|
|
114
224
|
"""
|
|
225
|
+
self.ignore_operation_servers = ignore_operation_servers
|
|
226
|
+
"""Ignore operation servers
|
|
227
|
+
"""
|
|
115
228
|
self.temp_folder_path = None
|
|
116
229
|
"""Temp file folder for downloading files
|
|
117
230
|
"""
|
|
@@ -155,7 +268,10 @@ class Configuration:
|
|
|
155
268
|
self.logger_file = None
|
|
156
269
|
"""Debug file location
|
|
157
270
|
"""
|
|
158
|
-
|
|
271
|
+
if debug is not None:
|
|
272
|
+
self.debug = debug
|
|
273
|
+
else:
|
|
274
|
+
self.__debug = False
|
|
159
275
|
"""Debug switch
|
|
160
276
|
"""
|
|
161
277
|
|
|
@@ -195,7 +311,7 @@ class Configuration:
|
|
|
195
311
|
self.safe_chars_for_path_param = ""
|
|
196
312
|
"""Safe chars for path_param
|
|
197
313
|
"""
|
|
198
|
-
self.retries =
|
|
314
|
+
self.retries = retries
|
|
199
315
|
"""Adding retries to override urllib3 default value 3
|
|
200
316
|
"""
|
|
201
317
|
# Enable client side validation
|
|
@@ -213,7 +329,7 @@ class Configuration:
|
|
|
213
329
|
"""date format
|
|
214
330
|
"""
|
|
215
331
|
|
|
216
|
-
def __deepcopy__(self, memo):
|
|
332
|
+
def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
|
|
217
333
|
cls = self.__class__
|
|
218
334
|
result = cls.__new__(cls)
|
|
219
335
|
memo[id(self)] = result
|
|
@@ -227,11 +343,11 @@ class Configuration:
|
|
|
227
343
|
result.debug = self.debug
|
|
228
344
|
return result
|
|
229
345
|
|
|
230
|
-
def __setattr__(self, name, value):
|
|
346
|
+
def __setattr__(self, name: str, value: Any) -> None:
|
|
231
347
|
object.__setattr__(self, name, value)
|
|
232
348
|
|
|
233
349
|
@classmethod
|
|
234
|
-
def set_default(cls, default):
|
|
350
|
+
def set_default(cls, default: Optional[Self]) -> None:
|
|
235
351
|
"""Set default instance of configuration.
|
|
236
352
|
|
|
237
353
|
It stores default configuration, which can be
|
|
@@ -242,7 +358,7 @@ class Configuration:
|
|
|
242
358
|
cls._default = default
|
|
243
359
|
|
|
244
360
|
@classmethod
|
|
245
|
-
def get_default_copy(cls):
|
|
361
|
+
def get_default_copy(cls) -> Self:
|
|
246
362
|
"""Deprecated. Please use `get_default` instead.
|
|
247
363
|
|
|
248
364
|
Deprecated. Please use `get_default` instead.
|
|
@@ -252,7 +368,7 @@ class Configuration:
|
|
|
252
368
|
return cls.get_default()
|
|
253
369
|
|
|
254
370
|
@classmethod
|
|
255
|
-
def get_default(cls):
|
|
371
|
+
def get_default(cls) -> Self:
|
|
256
372
|
"""Return the default configuration.
|
|
257
373
|
|
|
258
374
|
This method returns newly created, based on default constructor,
|
|
@@ -262,11 +378,11 @@ class Configuration:
|
|
|
262
378
|
:return: The configuration object.
|
|
263
379
|
"""
|
|
264
380
|
if cls._default is None:
|
|
265
|
-
cls._default =
|
|
381
|
+
cls._default = cls()
|
|
266
382
|
return cls._default
|
|
267
383
|
|
|
268
384
|
@property
|
|
269
|
-
def logger_file(self):
|
|
385
|
+
def logger_file(self) -> Optional[str]:
|
|
270
386
|
"""The logger file.
|
|
271
387
|
|
|
272
388
|
If the logger_file is None, then add stream handler and remove file
|
|
@@ -278,7 +394,7 @@ class Configuration:
|
|
|
278
394
|
return self.__logger_file
|
|
279
395
|
|
|
280
396
|
@logger_file.setter
|
|
281
|
-
def logger_file(self, value):
|
|
397
|
+
def logger_file(self, value: Optional[str]) -> None:
|
|
282
398
|
"""The logger file.
|
|
283
399
|
|
|
284
400
|
If the logger_file is None, then add stream handler and remove file
|
|
@@ -297,7 +413,7 @@ class Configuration:
|
|
|
297
413
|
logger.addHandler(self.logger_file_handler)
|
|
298
414
|
|
|
299
415
|
@property
|
|
300
|
-
def debug(self):
|
|
416
|
+
def debug(self) -> bool:
|
|
301
417
|
"""Debug status
|
|
302
418
|
|
|
303
419
|
:param value: The debug status, True or False.
|
|
@@ -306,7 +422,7 @@ class Configuration:
|
|
|
306
422
|
return self.__debug
|
|
307
423
|
|
|
308
424
|
@debug.setter
|
|
309
|
-
def debug(self, value):
|
|
425
|
+
def debug(self, value: bool) -> None:
|
|
310
426
|
"""Debug status
|
|
311
427
|
|
|
312
428
|
:param value: The debug status, True or False.
|
|
@@ -328,7 +444,7 @@ class Configuration:
|
|
|
328
444
|
httplib.HTTPConnection.debuglevel = 0
|
|
329
445
|
|
|
330
446
|
@property
|
|
331
|
-
def logger_format(self):
|
|
447
|
+
def logger_format(self) -> str:
|
|
332
448
|
"""The logger format.
|
|
333
449
|
|
|
334
450
|
The logger_formatter will be updated when sets logger_format.
|
|
@@ -339,7 +455,7 @@ class Configuration:
|
|
|
339
455
|
return self.__logger_format
|
|
340
456
|
|
|
341
457
|
@logger_format.setter
|
|
342
|
-
def logger_format(self, value):
|
|
458
|
+
def logger_format(self, value: str) -> None:
|
|
343
459
|
"""The logger format.
|
|
344
460
|
|
|
345
461
|
The logger_formatter will be updated when sets logger_format.
|
|
@@ -350,7 +466,9 @@ class Configuration:
|
|
|
350
466
|
self.__logger_format = value
|
|
351
467
|
self.logger_formatter = logging.Formatter(self.__logger_format)
|
|
352
468
|
|
|
353
|
-
def get_api_key_with_prefix(
|
|
469
|
+
def get_api_key_with_prefix(
|
|
470
|
+
self, identifier: str, alias: Optional[str] = None
|
|
471
|
+
) -> Optional[str]:
|
|
354
472
|
"""Gets API key (with prefix if set).
|
|
355
473
|
|
|
356
474
|
:param identifier: The identifier of apiKey.
|
|
@@ -369,7 +487,9 @@ class Configuration:
|
|
|
369
487
|
else:
|
|
370
488
|
return key
|
|
371
489
|
|
|
372
|
-
|
|
490
|
+
return None
|
|
491
|
+
|
|
492
|
+
def get_basic_auth_token(self) -> Optional[str]:
|
|
373
493
|
"""Gets HTTP basic authentication header (string).
|
|
374
494
|
|
|
375
495
|
:return: The token for basic HTTP authentication.
|
|
@@ -384,12 +504,12 @@ class Configuration:
|
|
|
384
504
|
"authorization"
|
|
385
505
|
)
|
|
386
506
|
|
|
387
|
-
def auth_settings(self):
|
|
507
|
+
def auth_settings(self) -> AuthSettings:
|
|
388
508
|
"""Gets Auth Settings dict for api client.
|
|
389
509
|
|
|
390
510
|
:return: The Auth Settings information dict.
|
|
391
511
|
"""
|
|
392
|
-
auth = {}
|
|
512
|
+
auth: AuthSettings = {}
|
|
393
513
|
if self.access_token is not None:
|
|
394
514
|
auth["bearerAuth"] = {
|
|
395
515
|
"type": "bearer",
|
|
@@ -408,7 +528,7 @@ class Configuration:
|
|
|
408
528
|
}
|
|
409
529
|
return auth
|
|
410
530
|
|
|
411
|
-
def to_debug_report(self):
|
|
531
|
+
def to_debug_report(self) -> str:
|
|
412
532
|
"""Gets the essential information for debugging.
|
|
413
533
|
|
|
414
534
|
:return: The report for debugging.
|
|
@@ -421,7 +541,7 @@ class Configuration:
|
|
|
421
541
|
"SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version)
|
|
422
542
|
)
|
|
423
543
|
|
|
424
|
-
def get_host_settings(self):
|
|
544
|
+
def get_host_settings(self) -> List[HostSetting]:
|
|
425
545
|
"""Gets an array of host settings
|
|
426
546
|
|
|
427
547
|
:return: An array of host settings
|
|
@@ -433,7 +553,12 @@ class Configuration:
|
|
|
433
553
|
}
|
|
434
554
|
]
|
|
435
555
|
|
|
436
|
-
def get_host_from_settings(
|
|
556
|
+
def get_host_from_settings(
|
|
557
|
+
self,
|
|
558
|
+
index: Optional[int],
|
|
559
|
+
variables: Optional[ServerVariablesT] = None,
|
|
560
|
+
servers: Optional[List[HostSetting]] = None,
|
|
561
|
+
) -> str:
|
|
437
562
|
"""Gets host URL based on the index and variables
|
|
438
563
|
:param index: array index of the host settings
|
|
439
564
|
:param variables: hash of variable and the corresponding value
|
|
@@ -473,14 +598,14 @@ class Configuration:
|
|
|
473
598
|
return url
|
|
474
599
|
|
|
475
600
|
@property
|
|
476
|
-
def host(self):
|
|
601
|
+
def host(self) -> str:
|
|
477
602
|
"""Return generated host."""
|
|
478
603
|
return self.get_host_from_settings(
|
|
479
604
|
self.server_index, variables=self.server_variables
|
|
480
605
|
)
|
|
481
606
|
|
|
482
607
|
@host.setter
|
|
483
|
-
def host(self, value):
|
|
608
|
+
def host(self, value: str) -> None:
|
|
484
609
|
"""Fix base path."""
|
|
485
610
|
self._base_path = value
|
|
486
611
|
self.server_index = None
|
|
@@ -37,6 +37,9 @@ from hatchet_sdk.clients.rest.models.create_api_token_request import (
|
|
|
37
37
|
from hatchet_sdk.clients.rest.models.create_api_token_response import (
|
|
38
38
|
CreateAPITokenResponse,
|
|
39
39
|
)
|
|
40
|
+
from hatchet_sdk.clients.rest.models.create_cron_workflow_trigger_request import (
|
|
41
|
+
CreateCronWorkflowTriggerRequest,
|
|
42
|
+
)
|
|
40
43
|
from hatchet_sdk.clients.rest.models.create_event_request import CreateEventRequest
|
|
41
44
|
from hatchet_sdk.clients.rest.models.create_pull_request_from_step_run import (
|
|
42
45
|
CreatePullRequestFromStepRun,
|
|
@@ -51,6 +54,11 @@ from hatchet_sdk.clients.rest.models.create_tenant_invite_request import (
|
|
|
51
54
|
CreateTenantInviteRequest,
|
|
52
55
|
)
|
|
53
56
|
from hatchet_sdk.clients.rest.models.create_tenant_request import CreateTenantRequest
|
|
57
|
+
from hatchet_sdk.clients.rest.models.cron_workflows import CronWorkflows
|
|
58
|
+
from hatchet_sdk.clients.rest.models.cron_workflows_list import CronWorkflowsList
|
|
59
|
+
from hatchet_sdk.clients.rest.models.cron_workflows_order_by_field import (
|
|
60
|
+
CronWorkflowsOrderByField,
|
|
61
|
+
)
|
|
54
62
|
from hatchet_sdk.clients.rest.models.event import Event
|
|
55
63
|
from hatchet_sdk.clients.rest.models.event_data import EventData
|
|
56
64
|
from hatchet_sdk.clients.rest.models.event_key_list import EventKeyList
|
|
@@ -108,6 +116,17 @@ from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import (
|
|
|
108
116
|
ReplayWorkflowRunsResponse,
|
|
109
117
|
)
|
|
110
118
|
from hatchet_sdk.clients.rest.models.rerun_step_run_request import RerunStepRunRequest
|
|
119
|
+
from hatchet_sdk.clients.rest.models.schedule_workflow_run_request import (
|
|
120
|
+
ScheduleWorkflowRunRequest,
|
|
121
|
+
)
|
|
122
|
+
from hatchet_sdk.clients.rest.models.scheduled_run_status import ScheduledRunStatus
|
|
123
|
+
from hatchet_sdk.clients.rest.models.scheduled_workflows import ScheduledWorkflows
|
|
124
|
+
from hatchet_sdk.clients.rest.models.scheduled_workflows_list import (
|
|
125
|
+
ScheduledWorkflowsList,
|
|
126
|
+
)
|
|
127
|
+
from hatchet_sdk.clients.rest.models.scheduled_workflows_order_by_field import (
|
|
128
|
+
ScheduledWorkflowsOrderByField,
|
|
129
|
+
)
|
|
111
130
|
from hatchet_sdk.clients.rest.models.semaphore_slots import SemaphoreSlots
|
|
112
131
|
from hatchet_sdk.clients.rest.models.slack_webhook import SlackWebhook
|
|
113
132
|
from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration
|
|
@@ -186,6 +205,8 @@ from hatchet_sdk.clients.rest.models.webhook_worker_request_method import (
|
|
|
186
205
|
from hatchet_sdk.clients.rest.models.worker import Worker
|
|
187
206
|
from hatchet_sdk.clients.rest.models.worker_label import WorkerLabel
|
|
188
207
|
from hatchet_sdk.clients.rest.models.worker_list import WorkerList
|
|
208
|
+
from hatchet_sdk.clients.rest.models.worker_runtime_info import WorkerRuntimeInfo
|
|
209
|
+
from hatchet_sdk.clients.rest.models.worker_runtime_sdks import WorkerRuntimeSDKs
|
|
189
210
|
from hatchet_sdk.clients.rest.models.workflow import Workflow
|
|
190
211
|
from hatchet_sdk.clients.rest.models.workflow_concurrency import WorkflowConcurrency
|
|
191
212
|
from hatchet_sdk.clients.rest.models.workflow_kind import WorkflowKind
|
|
@@ -73,9 +73,9 @@ class APIErrors(BaseModel):
|
|
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of each item in errors (list)
|
|
74
74
|
_items = []
|
|
75
75
|
if self.errors:
|
|
76
|
-
for
|
|
77
|
-
if
|
|
78
|
-
_items.append(
|
|
76
|
+
for _item_errors in self.errors:
|
|
77
|
+
if _item_errors:
|
|
78
|
+
_items.append(_item_errors.to_dict())
|
|
79
79
|
_dict["errors"] = _items
|
|
80
80
|
return _dict
|
|
81
81
|
|
|
@@ -73,9 +73,9 @@ class BulkCreateEventRequest(BaseModel):
|
|
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of each item in events (list)
|
|
74
74
|
_items = []
|
|
75
75
|
if self.events:
|
|
76
|
-
for
|
|
77
|
-
if
|
|
78
|
-
_items.append(
|
|
76
|
+
for _item_events in self.events:
|
|
77
|
+
if _item_events:
|
|
78
|
+
_items.append(_item_events.to_dict())
|
|
79
79
|
_dict["events"] = _items
|
|
80
80
|
return _dict
|
|
81
81
|
|
|
@@ -78,9 +78,9 @@ class BulkCreateEventResponse(BaseModel):
|
|
|
78
78
|
# override the default output from pydantic by calling `to_dict()` of each item in events (list)
|
|
79
79
|
_items = []
|
|
80
80
|
if self.events:
|
|
81
|
-
for
|
|
82
|
-
if
|
|
83
|
-
_items.append(
|
|
81
|
+
for _item_events in self.events:
|
|
82
|
+
if _item_events:
|
|
83
|
+
_items.append(_item_events.to_dict())
|
|
84
84
|
_dict["events"] = _items
|
|
85
85
|
return _dict
|
|
86
86
|
|
|
@@ -23,19 +23,21 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class CreateCronWorkflowTriggerRequest(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
CreateCronWorkflowTriggerRequest
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
input: Dict[str, Any]
|
|
32
|
+
additional_metadata: Dict[str, Any] = Field(alias="additionalMetadata")
|
|
33
|
+
cron_name: StrictStr = Field(alias="cronName")
|
|
34
|
+
cron_expression: StrictStr = Field(alias="cronExpression")
|
|
35
|
+
__properties: ClassVar[List[str]] = [
|
|
36
|
+
"input",
|
|
37
|
+
"additionalMetadata",
|
|
38
|
+
"cronName",
|
|
39
|
+
"cronExpression",
|
|
40
|
+
]
|
|
39
41
|
|
|
40
42
|
model_config = ConfigDict(
|
|
41
43
|
populate_by_name=True,
|
|
@@ -54,7 +56,7 @@ class ManagedWorkerCreateRequestBuildConfigStepsInner(BaseModel):
|
|
|
54
56
|
|
|
55
57
|
@classmethod
|
|
56
58
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
-
"""Create an instance of
|
|
59
|
+
"""Create an instance of CreateCronWorkflowTriggerRequest from a JSON string"""
|
|
58
60
|
return cls.from_dict(json.loads(json_str))
|
|
59
61
|
|
|
60
62
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -78,7 +80,7 @@ class ManagedWorkerCreateRequestBuildConfigStepsInner(BaseModel):
|
|
|
78
80
|
|
|
79
81
|
@classmethod
|
|
80
82
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
-
"""Create an instance of
|
|
83
|
+
"""Create an instance of CreateCronWorkflowTriggerRequest from a dict"""
|
|
82
84
|
if obj is None:
|
|
83
85
|
return None
|
|
84
86
|
|
|
@@ -87,8 +89,10 @@ class ManagedWorkerCreateRequestBuildConfigStepsInner(BaseModel):
|
|
|
87
89
|
|
|
88
90
|
_obj = cls.model_validate(
|
|
89
91
|
{
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
+
"input": obj.get("input"),
|
|
93
|
+
"additionalMetadata": obj.get("additionalMetadata"),
|
|
94
|
+
"cronName": obj.get("cronName"),
|
|
95
|
+
"cronExpression": obj.get("cronExpression"),
|
|
92
96
|
}
|
|
93
97
|
)
|
|
94
98
|
return _obj
|