hatchet-sdk 1.11.1__py3-none-any.whl → 1.12.1__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 (31) hide show
  1. hatchet_sdk/__init__.py +2 -0
  2. hatchet_sdk/client.py +2 -0
  3. hatchet_sdk/clients/events.py +42 -3
  4. hatchet_sdk/clients/rest/__init__.py +5 -0
  5. hatchet_sdk/clients/rest/api/event_api.py +490 -0
  6. hatchet_sdk/clients/rest/api/filter_api.py +339 -0
  7. hatchet_sdk/clients/rest/api/tenant_api.py +275 -0
  8. hatchet_sdk/clients/rest/api/workflow_runs_api.py +310 -0
  9. hatchet_sdk/clients/rest/models/__init__.py +5 -0
  10. hatchet_sdk/clients/rest/models/create_tenant_request.py +22 -2
  11. hatchet_sdk/clients/rest/models/tenant.py +6 -0
  12. hatchet_sdk/clients/rest/models/tenant_ui_version.py +37 -0
  13. hatchet_sdk/clients/rest/models/update_tenant_request.py +6 -0
  14. hatchet_sdk/clients/rest/models/v1_event.py +42 -0
  15. hatchet_sdk/clients/rest/models/v1_event_triggered_run.py +94 -0
  16. hatchet_sdk/clients/rest/models/v1_update_filter_request.py +98 -0
  17. hatchet_sdk/contracts/v1/workflows_pb2.py +26 -24
  18. hatchet_sdk/contracts/v1/workflows_pb2.pyi +14 -2
  19. hatchet_sdk/features/filters.py +36 -0
  20. hatchet_sdk/features/runs.py +22 -3
  21. hatchet_sdk/features/tenant.py +32 -0
  22. hatchet_sdk/hatchet.py +51 -8
  23. hatchet_sdk/runnables/action.py +1 -1
  24. hatchet_sdk/runnables/types.py +22 -4
  25. hatchet_sdk/runnables/workflow.py +413 -188
  26. hatchet_sdk/waits.py +2 -2
  27. {hatchet_sdk-1.11.1.dist-info → hatchet_sdk-1.12.1.dist-info}/METADATA +1 -1
  28. {hatchet_sdk-1.11.1.dist-info → hatchet_sdk-1.12.1.dist-info}/RECORD +30 -27
  29. hatchet_sdk/runnables/standalone.py +0 -391
  30. {hatchet_sdk-1.11.1.dist-info → hatchet_sdk-1.12.1.dist-info}/WHEEL +0 -0
  31. {hatchet_sdk-1.11.1.dist-info → hatchet_sdk-1.12.1.dist-info}/entry_points.txt +0 -0
@@ -915,6 +915,284 @@ class WorkflowRunsApi:
915
915
  _request_auth=_request_auth,
916
916
  )
917
917
 
918
+ @validate_call
919
+ def v1_workflow_run_get_status(
920
+ self,
921
+ v1_workflow_run: Annotated[
922
+ str,
923
+ Field(
924
+ min_length=36,
925
+ strict=True,
926
+ max_length=36,
927
+ description="The workflow run id to get the status for",
928
+ ),
929
+ ],
930
+ _request_timeout: Union[
931
+ None,
932
+ Annotated[StrictFloat, Field(gt=0)],
933
+ Tuple[
934
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
935
+ ],
936
+ ] = None,
937
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
938
+ _content_type: Optional[StrictStr] = None,
939
+ _headers: Optional[Dict[StrictStr, Any]] = None,
940
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
941
+ ) -> V1TaskStatus:
942
+ """Get workflow run status
943
+
944
+ Get the status of a workflow run.
945
+
946
+ :param v1_workflow_run: The workflow run id to get the status for (required)
947
+ :type v1_workflow_run: str
948
+ :param _request_timeout: timeout setting for this request. If one
949
+ number provided, it will be total request
950
+ timeout. It can also be a pair (tuple) of
951
+ (connection, read) timeouts.
952
+ :type _request_timeout: int, tuple(int, int), optional
953
+ :param _request_auth: set to override the auth_settings for an a single
954
+ request; this effectively ignores the
955
+ authentication in the spec for a single request.
956
+ :type _request_auth: dict, optional
957
+ :param _content_type: force content-type for the request.
958
+ :type _content_type: str, Optional
959
+ :param _headers: set to override the headers for a single
960
+ request; this effectively ignores the headers
961
+ in the spec for a single request.
962
+ :type _headers: dict, optional
963
+ :param _host_index: set to override the host_index for a single
964
+ request; this effectively ignores the host_index
965
+ in the spec for a single request.
966
+ :type _host_index: int, optional
967
+ :return: Returns the result object.
968
+ """ # noqa: E501
969
+
970
+ _param = self._v1_workflow_run_get_status_serialize(
971
+ v1_workflow_run=v1_workflow_run,
972
+ _request_auth=_request_auth,
973
+ _content_type=_content_type,
974
+ _headers=_headers,
975
+ _host_index=_host_index,
976
+ )
977
+
978
+ _response_types_map: Dict[str, Optional[str]] = {
979
+ "200": "V1TaskStatus",
980
+ "400": "APIErrors",
981
+ "403": "APIErrors",
982
+ "404": "APIErrors",
983
+ "501": "APIErrors",
984
+ }
985
+ response_data = self.api_client.call_api(
986
+ *_param, _request_timeout=_request_timeout
987
+ )
988
+ response_data.read()
989
+ return self.api_client.response_deserialize(
990
+ response_data=response_data,
991
+ response_types_map=_response_types_map,
992
+ ).data
993
+
994
+ @validate_call
995
+ def v1_workflow_run_get_status_with_http_info(
996
+ self,
997
+ v1_workflow_run: Annotated[
998
+ str,
999
+ Field(
1000
+ min_length=36,
1001
+ strict=True,
1002
+ max_length=36,
1003
+ description="The workflow run id to get the status for",
1004
+ ),
1005
+ ],
1006
+ _request_timeout: Union[
1007
+ None,
1008
+ Annotated[StrictFloat, Field(gt=0)],
1009
+ Tuple[
1010
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1011
+ ],
1012
+ ] = None,
1013
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1014
+ _content_type: Optional[StrictStr] = None,
1015
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1016
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1017
+ ) -> ApiResponse[V1TaskStatus]:
1018
+ """Get workflow run status
1019
+
1020
+ Get the status of a workflow run.
1021
+
1022
+ :param v1_workflow_run: The workflow run id to get the status for (required)
1023
+ :type v1_workflow_run: str
1024
+ :param _request_timeout: timeout setting for this request. If one
1025
+ number provided, it will be total request
1026
+ timeout. It can also be a pair (tuple) of
1027
+ (connection, read) timeouts.
1028
+ :type _request_timeout: int, tuple(int, int), optional
1029
+ :param _request_auth: set to override the auth_settings for an a single
1030
+ request; this effectively ignores the
1031
+ authentication in the spec for a single request.
1032
+ :type _request_auth: dict, optional
1033
+ :param _content_type: force content-type for the request.
1034
+ :type _content_type: str, Optional
1035
+ :param _headers: set to override the headers for a single
1036
+ request; this effectively ignores the headers
1037
+ in the spec for a single request.
1038
+ :type _headers: dict, optional
1039
+ :param _host_index: set to override the host_index for a single
1040
+ request; this effectively ignores the host_index
1041
+ in the spec for a single request.
1042
+ :type _host_index: int, optional
1043
+ :return: Returns the result object.
1044
+ """ # noqa: E501
1045
+
1046
+ _param = self._v1_workflow_run_get_status_serialize(
1047
+ v1_workflow_run=v1_workflow_run,
1048
+ _request_auth=_request_auth,
1049
+ _content_type=_content_type,
1050
+ _headers=_headers,
1051
+ _host_index=_host_index,
1052
+ )
1053
+
1054
+ _response_types_map: Dict[str, Optional[str]] = {
1055
+ "200": "V1TaskStatus",
1056
+ "400": "APIErrors",
1057
+ "403": "APIErrors",
1058
+ "404": "APIErrors",
1059
+ "501": "APIErrors",
1060
+ }
1061
+ response_data = self.api_client.call_api(
1062
+ *_param, _request_timeout=_request_timeout
1063
+ )
1064
+ response_data.read()
1065
+ return self.api_client.response_deserialize(
1066
+ response_data=response_data,
1067
+ response_types_map=_response_types_map,
1068
+ )
1069
+
1070
+ @validate_call
1071
+ def v1_workflow_run_get_status_without_preload_content(
1072
+ self,
1073
+ v1_workflow_run: Annotated[
1074
+ str,
1075
+ Field(
1076
+ min_length=36,
1077
+ strict=True,
1078
+ max_length=36,
1079
+ description="The workflow run id to get the status for",
1080
+ ),
1081
+ ],
1082
+ _request_timeout: Union[
1083
+ None,
1084
+ Annotated[StrictFloat, Field(gt=0)],
1085
+ Tuple[
1086
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1087
+ ],
1088
+ ] = None,
1089
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1090
+ _content_type: Optional[StrictStr] = None,
1091
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1092
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1093
+ ) -> RESTResponseType:
1094
+ """Get workflow run status
1095
+
1096
+ Get the status of a workflow run.
1097
+
1098
+ :param v1_workflow_run: The workflow run id to get the status for (required)
1099
+ :type v1_workflow_run: str
1100
+ :param _request_timeout: timeout setting for this request. If one
1101
+ number provided, it will be total request
1102
+ timeout. It can also be a pair (tuple) of
1103
+ (connection, read) timeouts.
1104
+ :type _request_timeout: int, tuple(int, int), optional
1105
+ :param _request_auth: set to override the auth_settings for an a single
1106
+ request; this effectively ignores the
1107
+ authentication in the spec for a single request.
1108
+ :type _request_auth: dict, optional
1109
+ :param _content_type: force content-type for the request.
1110
+ :type _content_type: str, Optional
1111
+ :param _headers: set to override the headers for a single
1112
+ request; this effectively ignores the headers
1113
+ in the spec for a single request.
1114
+ :type _headers: dict, optional
1115
+ :param _host_index: set to override the host_index for a single
1116
+ request; this effectively ignores the host_index
1117
+ in the spec for a single request.
1118
+ :type _host_index: int, optional
1119
+ :return: Returns the result object.
1120
+ """ # noqa: E501
1121
+
1122
+ _param = self._v1_workflow_run_get_status_serialize(
1123
+ v1_workflow_run=v1_workflow_run,
1124
+ _request_auth=_request_auth,
1125
+ _content_type=_content_type,
1126
+ _headers=_headers,
1127
+ _host_index=_host_index,
1128
+ )
1129
+
1130
+ _response_types_map: Dict[str, Optional[str]] = {
1131
+ "200": "V1TaskStatus",
1132
+ "400": "APIErrors",
1133
+ "403": "APIErrors",
1134
+ "404": "APIErrors",
1135
+ "501": "APIErrors",
1136
+ }
1137
+ response_data = self.api_client.call_api(
1138
+ *_param, _request_timeout=_request_timeout
1139
+ )
1140
+ return response_data.response
1141
+
1142
+ def _v1_workflow_run_get_status_serialize(
1143
+ self,
1144
+ v1_workflow_run,
1145
+ _request_auth,
1146
+ _content_type,
1147
+ _headers,
1148
+ _host_index,
1149
+ ) -> RequestSerialized:
1150
+
1151
+ _host = None
1152
+
1153
+ _collection_formats: Dict[str, str] = {}
1154
+
1155
+ _path_params: Dict[str, str] = {}
1156
+ _query_params: List[Tuple[str, str]] = []
1157
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1158
+ _form_params: List[Tuple[str, str]] = []
1159
+ _files: Dict[
1160
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1161
+ ] = {}
1162
+ _body_params: Optional[bytes] = None
1163
+
1164
+ # process the path parameters
1165
+ if v1_workflow_run is not None:
1166
+ _path_params["v1-workflow-run"] = v1_workflow_run
1167
+ # process the query parameters
1168
+ # process the header parameters
1169
+ # process the form parameters
1170
+ # process the body parameter
1171
+
1172
+ # set the HTTP header `Accept`
1173
+ if "Accept" not in _header_params:
1174
+ _header_params["Accept"] = self.api_client.select_header_accept(
1175
+ ["application/json"]
1176
+ )
1177
+
1178
+ # authentication setting
1179
+ _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1180
+
1181
+ return self.api_client.param_serialize(
1182
+ method="GET",
1183
+ resource_path="/api/v1/stable/workflow-runs/{v1-workflow-run}/status",
1184
+ path_params=_path_params,
1185
+ query_params=_query_params,
1186
+ header_params=_header_params,
1187
+ body=_body_params,
1188
+ post_params=_form_params,
1189
+ files=_files,
1190
+ auth_settings=_auth_settings,
1191
+ collection_formats=_collection_formats,
1192
+ _host=_host,
1193
+ _request_auth=_request_auth,
1194
+ )
1195
+
918
1196
  @validate_call
919
1197
  def v1_workflow_run_get_timings(
920
1198
  self,
@@ -1264,6 +1542,12 @@ class WorkflowRunsApi:
1264
1542
  description="The external id of the event that triggered the workflow run"
1265
1543
  ),
1266
1544
  ] = None,
1545
+ include_payloads: Annotated[
1546
+ Optional[StrictBool],
1547
+ Field(
1548
+ description="A flag for whether or not to include the input and output payloads in the response. Defaults to `true` if unset."
1549
+ ),
1550
+ ] = None,
1267
1551
  _request_timeout: Union[
1268
1552
  None,
1269
1553
  Annotated[StrictFloat, Field(gt=0)],
@@ -1304,6 +1588,8 @@ class WorkflowRunsApi:
1304
1588
  :type parent_task_external_id: str
1305
1589
  :param triggering_event_external_id: The external id of the event that triggered the workflow run
1306
1590
  :type triggering_event_external_id: str
1591
+ :param include_payloads: A flag for whether or not to include the input and output payloads in the response. Defaults to `true` if unset.
1592
+ :type include_payloads: bool
1307
1593
  :param _request_timeout: timeout setting for this request. If one
1308
1594
  number provided, it will be total request
1309
1595
  timeout. It can also be a pair (tuple) of
@@ -1339,6 +1625,7 @@ class WorkflowRunsApi:
1339
1625
  worker_id=worker_id,
1340
1626
  parent_task_external_id=parent_task_external_id,
1341
1627
  triggering_event_external_id=triggering_event_external_id,
1628
+ include_payloads=include_payloads,
1342
1629
  _request_auth=_request_auth,
1343
1630
  _content_type=_content_type,
1344
1631
  _headers=_headers,
@@ -1411,6 +1698,12 @@ class WorkflowRunsApi:
1411
1698
  description="The external id of the event that triggered the workflow run"
1412
1699
  ),
1413
1700
  ] = None,
1701
+ include_payloads: Annotated[
1702
+ Optional[StrictBool],
1703
+ Field(
1704
+ description="A flag for whether or not to include the input and output payloads in the response. Defaults to `true` if unset."
1705
+ ),
1706
+ ] = None,
1414
1707
  _request_timeout: Union[
1415
1708
  None,
1416
1709
  Annotated[StrictFloat, Field(gt=0)],
@@ -1451,6 +1744,8 @@ class WorkflowRunsApi:
1451
1744
  :type parent_task_external_id: str
1452
1745
  :param triggering_event_external_id: The external id of the event that triggered the workflow run
1453
1746
  :type triggering_event_external_id: str
1747
+ :param include_payloads: A flag for whether or not to include the input and output payloads in the response. Defaults to `true` if unset.
1748
+ :type include_payloads: bool
1454
1749
  :param _request_timeout: timeout setting for this request. If one
1455
1750
  number provided, it will be total request
1456
1751
  timeout. It can also be a pair (tuple) of
@@ -1486,6 +1781,7 @@ class WorkflowRunsApi:
1486
1781
  worker_id=worker_id,
1487
1782
  parent_task_external_id=parent_task_external_id,
1488
1783
  triggering_event_external_id=triggering_event_external_id,
1784
+ include_payloads=include_payloads,
1489
1785
  _request_auth=_request_auth,
1490
1786
  _content_type=_content_type,
1491
1787
  _headers=_headers,
@@ -1558,6 +1854,12 @@ class WorkflowRunsApi:
1558
1854
  description="The external id of the event that triggered the workflow run"
1559
1855
  ),
1560
1856
  ] = None,
1857
+ include_payloads: Annotated[
1858
+ Optional[StrictBool],
1859
+ Field(
1860
+ description="A flag for whether or not to include the input and output payloads in the response. Defaults to `true` if unset."
1861
+ ),
1862
+ ] = None,
1561
1863
  _request_timeout: Union[
1562
1864
  None,
1563
1865
  Annotated[StrictFloat, Field(gt=0)],
@@ -1598,6 +1900,8 @@ class WorkflowRunsApi:
1598
1900
  :type parent_task_external_id: str
1599
1901
  :param triggering_event_external_id: The external id of the event that triggered the workflow run
1600
1902
  :type triggering_event_external_id: str
1903
+ :param include_payloads: A flag for whether or not to include the input and output payloads in the response. Defaults to `true` if unset.
1904
+ :type include_payloads: bool
1601
1905
  :param _request_timeout: timeout setting for this request. If one
1602
1906
  number provided, it will be total request
1603
1907
  timeout. It can also be a pair (tuple) of
@@ -1633,6 +1937,7 @@ class WorkflowRunsApi:
1633
1937
  worker_id=worker_id,
1634
1938
  parent_task_external_id=parent_task_external_id,
1635
1939
  triggering_event_external_id=triggering_event_external_id,
1940
+ include_payloads=include_payloads,
1636
1941
  _request_auth=_request_auth,
1637
1942
  _content_type=_content_type,
1638
1943
  _headers=_headers,
@@ -1664,6 +1969,7 @@ class WorkflowRunsApi:
1664
1969
  worker_id,
1665
1970
  parent_task_external_id,
1666
1971
  triggering_event_external_id,
1972
+ include_payloads,
1667
1973
  _request_auth,
1668
1974
  _content_type,
1669
1975
  _headers,
@@ -1751,6 +2057,10 @@ class WorkflowRunsApi:
1751
2057
  ("triggering_event_external_id", triggering_event_external_id)
1752
2058
  )
1753
2059
 
2060
+ if include_payloads is not None:
2061
+
2062
+ _query_params.append(("include_payloads", include_payloads))
2063
+
1754
2064
  # process the header parameters
1755
2065
  # process the form parameters
1756
2066
  # process the body parameter
@@ -171,6 +171,7 @@ from hatchet_sdk.clients.rest.models.tenant_resource_policy import TenantResourc
171
171
  from hatchet_sdk.clients.rest.models.tenant_step_run_queue_metrics import (
172
172
  TenantStepRunQueueMetrics,
173
173
  )
174
+ from hatchet_sdk.clients.rest.models.tenant_ui_version import TenantUIVersion
174
175
  from hatchet_sdk.clients.rest.models.tenant_version import TenantVersion
175
176
  from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import (
176
177
  TriggerWorkflowRunRequest,
@@ -200,6 +201,7 @@ from hatchet_sdk.clients.rest.models.v1_create_filter_request import (
200
201
  from hatchet_sdk.clients.rest.models.v1_dag_children import V1DagChildren
201
202
  from hatchet_sdk.clients.rest.models.v1_event import V1Event
202
203
  from hatchet_sdk.clients.rest.models.v1_event_list import V1EventList
204
+ from hatchet_sdk.clients.rest.models.v1_event_triggered_run import V1EventTriggeredRun
203
205
  from hatchet_sdk.clients.rest.models.v1_event_workflow_run_summary import (
204
206
  V1EventWorkflowRunSummary,
205
207
  )
@@ -225,6 +227,9 @@ from hatchet_sdk.clients.rest.models.v1_task_timing_list import V1TaskTimingList
225
227
  from hatchet_sdk.clients.rest.models.v1_trigger_workflow_run_request import (
226
228
  V1TriggerWorkflowRunRequest,
227
229
  )
230
+ from hatchet_sdk.clients.rest.models.v1_update_filter_request import (
231
+ V1UpdateFilterRequest,
232
+ )
228
233
  from hatchet_sdk.clients.rest.models.v1_workflow_run import V1WorkflowRun
229
234
  from hatchet_sdk.clients.rest.models.v1_workflow_run_details import V1WorkflowRunDetails
230
235
  from hatchet_sdk.clients.rest.models.v1_workflow_run_display_name import (
@@ -22,6 +22,9 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
22
22
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
23
23
  from typing_extensions import Self
24
24
 
25
+ from hatchet_sdk.clients.rest.models.tenant_ui_version import TenantUIVersion
26
+ from hatchet_sdk.clients.rest.models.tenant_version import TenantVersion
27
+
25
28
 
26
29
  class CreateTenantRequest(BaseModel):
27
30
  """
@@ -30,7 +33,17 @@ class CreateTenantRequest(BaseModel):
30
33
 
31
34
  name: StrictStr = Field(description="The name of the tenant.")
32
35
  slug: StrictStr = Field(description="The slug of the tenant.")
33
- __properties: ClassVar[List[str]] = ["name", "slug"]
36
+ ui_version: Optional[TenantUIVersion] = Field(
37
+ default=None,
38
+ description="The UI version of the tenant. Defaults to V0.",
39
+ alias="uiVersion",
40
+ )
41
+ engine_version: Optional[TenantVersion] = Field(
42
+ default=None,
43
+ description="The engine version of the tenant. Defaults to V0.",
44
+ alias="engineVersion",
45
+ )
46
+ __properties: ClassVar[List[str]] = ["name", "slug", "uiVersion", "engineVersion"]
34
47
 
35
48
  model_config = ConfigDict(
36
49
  populate_by_name=True,
@@ -80,5 +93,12 @@ class CreateTenantRequest(BaseModel):
80
93
  if not isinstance(obj, dict):
81
94
  return cls.model_validate(obj)
82
95
 
83
- _obj = cls.model_validate({"name": obj.get("name"), "slug": obj.get("slug")})
96
+ _obj = cls.model_validate(
97
+ {
98
+ "name": obj.get("name"),
99
+ "slug": obj.get("slug"),
100
+ "uiVersion": obj.get("uiVersion"),
101
+ "engineVersion": obj.get("engineVersion"),
102
+ }
103
+ )
84
104
  return _obj
@@ -23,6 +23,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
23
23
  from typing_extensions import Self
24
24
 
25
25
  from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta
26
+ from hatchet_sdk.clients.rest.models.tenant_ui_version import TenantUIVersion
26
27
  from hatchet_sdk.clients.rest.models.tenant_version import TenantVersion
27
28
 
28
29
 
@@ -45,6 +46,9 @@ class Tenant(BaseModel):
45
46
  alias="alertMemberEmails",
46
47
  )
47
48
  version: TenantVersion = Field(description="The version of the tenant.")
49
+ ui_version: Optional[TenantUIVersion] = Field(
50
+ default=None, description="The UI of the tenant.", alias="uiVersion"
51
+ )
48
52
  __properties: ClassVar[List[str]] = [
49
53
  "metadata",
50
54
  "name",
@@ -52,6 +56,7 @@ class Tenant(BaseModel):
52
56
  "analyticsOptOut",
53
57
  "alertMemberEmails",
54
58
  "version",
59
+ "uiVersion",
55
60
  ]
56
61
 
57
62
  model_config = ConfigDict(
@@ -117,6 +122,7 @@ class Tenant(BaseModel):
117
122
  "analyticsOptOut": obj.get("analyticsOptOut"),
118
123
  "alertMemberEmails": obj.get("alertMemberEmails"),
119
124
  "version": obj.get("version"),
125
+ "uiVersion": obj.get("uiVersion"),
120
126
  }
121
127
  )
122
128
  return _obj
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Hatchet API
5
+
6
+ The Hatchet API
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ from enum import Enum
19
+
20
+ from typing_extensions import Self
21
+
22
+
23
+ class TenantUIVersion(str, Enum):
24
+ """
25
+ TenantUIVersion
26
+ """
27
+
28
+ """
29
+ allowed enum values
30
+ """
31
+ V0 = "V0"
32
+ V1 = "V1"
33
+
34
+ @classmethod
35
+ def from_json(cls, json_str: str) -> Self:
36
+ """Create an instance of TenantUIVersion from a JSON string"""
37
+ return cls(json.loads(json_str))
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
22
22
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
23
23
  from typing_extensions import Self
24
24
 
25
+ from hatchet_sdk.clients.rest.models.tenant_ui_version import TenantUIVersion
25
26
  from hatchet_sdk.clients.rest.models.tenant_version import TenantVersion
26
27
 
27
28
 
@@ -66,6 +67,9 @@ class UpdateTenantRequest(BaseModel):
66
67
  version: Optional[TenantVersion] = Field(
67
68
  default=None, description="The version of the tenant."
68
69
  )
70
+ ui_version: Optional[TenantUIVersion] = Field(
71
+ default=None, description="The UI of the tenant.", alias="uiVersion"
72
+ )
69
73
  __properties: ClassVar[List[str]] = [
70
74
  "name",
71
75
  "analyticsOptOut",
@@ -75,6 +79,7 @@ class UpdateTenantRequest(BaseModel):
75
79
  "enableTenantResourceLimitAlerts",
76
80
  "maxAlertingFrequency",
77
81
  "version",
82
+ "uiVersion",
78
83
  ]
79
84
 
80
85
  model_config = ConfigDict(
@@ -139,6 +144,7 @@ class UpdateTenantRequest(BaseModel):
139
144
  ),
140
145
  "maxAlertingFrequency": obj.get("maxAlertingFrequency"),
141
146
  "version": obj.get("version"),
147
+ "uiVersion": obj.get("uiVersion"),
142
148
  }
143
149
  )
144
150
  return _obj
@@ -17,6 +17,7 @@ from __future__ import annotations
17
17
  import json
18
18
  import pprint
19
19
  import re # noqa: F401
20
+ from datetime import datetime
20
21
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
22
 
22
23
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
@@ -24,6 +25,7 @@ from typing_extensions import Self
24
25
 
25
26
  from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta
26
27
  from hatchet_sdk.clients.rest.models.tenant import Tenant
28
+ from hatchet_sdk.clients.rest.models.v1_event_triggered_run import V1EventTriggeredRun
27
29
  from hatchet_sdk.clients.rest.models.v1_event_workflow_run_summary import (
28
30
  V1EventWorkflowRunSummary,
29
31
  )
@@ -51,6 +53,24 @@ class V1Event(BaseModel):
51
53
  description="Additional metadata for the event.",
52
54
  alias="additionalMetadata",
53
55
  )
56
+ payload: Optional[Dict[str, Any]] = Field(
57
+ default=None,
58
+ description="The payload of the event, which can be any JSON-serializable object.",
59
+ )
60
+ scope: Optional[StrictStr] = Field(
61
+ default=None,
62
+ description="The scope of the event, which can be used to filter or categorize events.",
63
+ )
64
+ seen_at: Optional[datetime] = Field(
65
+ default=None,
66
+ description="The timestamp when the event was seen.",
67
+ alias="seenAt",
68
+ )
69
+ triggered_runs: Optional[List[V1EventTriggeredRun]] = Field(
70
+ default=None,
71
+ description="The external IDs of the runs that were triggered by this event.",
72
+ alias="triggeredRuns",
73
+ )
54
74
  __properties: ClassVar[List[str]] = [
55
75
  "metadata",
56
76
  "key",
@@ -58,6 +78,10 @@ class V1Event(BaseModel):
58
78
  "tenantId",
59
79
  "workflowRunSummary",
60
80
  "additionalMetadata",
81
+ "payload",
82
+ "scope",
83
+ "seenAt",
84
+ "triggeredRuns",
61
85
  ]
62
86
 
63
87
  model_config = ConfigDict(
@@ -106,6 +130,13 @@ class V1Event(BaseModel):
106
130
  # override the default output from pydantic by calling `to_dict()` of workflow_run_summary
107
131
  if self.workflow_run_summary:
108
132
  _dict["workflowRunSummary"] = self.workflow_run_summary.to_dict()
133
+ # override the default output from pydantic by calling `to_dict()` of each item in triggered_runs (list)
134
+ _items = []
135
+ if self.triggered_runs:
136
+ for _item_triggered_runs in self.triggered_runs:
137
+ if _item_triggered_runs:
138
+ _items.append(_item_triggered_runs.to_dict())
139
+ _dict["triggeredRuns"] = _items
109
140
  return _dict
110
141
 
111
142
  @classmethod
@@ -137,6 +168,17 @@ class V1Event(BaseModel):
137
168
  else None
138
169
  ),
139
170
  "additionalMetadata": obj.get("additionalMetadata"),
171
+ "payload": obj.get("payload"),
172
+ "scope": obj.get("scope"),
173
+ "seenAt": obj.get("seenAt"),
174
+ "triggeredRuns": (
175
+ [
176
+ V1EventTriggeredRun.from_dict(_item)
177
+ for _item in obj["triggeredRuns"]
178
+ ]
179
+ if obj.get("triggeredRuns") is not None
180
+ else None
181
+ ),
140
182
  }
141
183
  )
142
184
  return _obj