hatchet-sdk 1.9.1__py3-none-any.whl → 1.10.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.
- hatchet_sdk/__init__.py +5 -1
- hatchet_sdk/client.py +2 -0
- hatchet_sdk/clients/admin.py +2 -6
- hatchet_sdk/clients/dispatcher/action_listener.py +43 -23
- hatchet_sdk/clients/events.py +58 -8
- hatchet_sdk/clients/rest/__init__.py +11 -0
- hatchet_sdk/clients/rest/api/__init__.py +1 -0
- hatchet_sdk/clients/rest/api/event_api.py +335 -0
- hatchet_sdk/clients/rest/api/filter_api.py +1305 -0
- hatchet_sdk/clients/rest/api/task_api.py +51 -0
- hatchet_sdk/clients/rest/api/workflow_runs_api.py +34 -0
- hatchet_sdk/clients/rest/models/__init__.py +10 -0
- hatchet_sdk/clients/rest/models/create_event_request.py +16 -2
- hatchet_sdk/clients/rest/models/v1_create_filter_request.py +99 -0
- hatchet_sdk/clients/rest/models/v1_event.py +142 -0
- hatchet_sdk/clients/rest/models/v1_event_list.py +110 -0
- hatchet_sdk/clients/rest/models/v1_event_workflow_run_summary.py +101 -0
- hatchet_sdk/clients/rest/models/v1_filter.py +127 -0
- hatchet_sdk/clients/rest/models/v1_filter_list.py +110 -0
- hatchet_sdk/clients/rest/models/v1_log_line.py +21 -2
- hatchet_sdk/clients/rest/models/v1_task_event.py +12 -0
- hatchet_sdk/clients/rest/models/v1_task_summary.py +12 -0
- hatchet_sdk/clients/rest/models/v1_task_timing.py +19 -0
- hatchet_sdk/clients/rest/models/workflow.py +5 -0
- hatchet_sdk/config.py +42 -0
- hatchet_sdk/context/context.py +1 -0
- hatchet_sdk/contracts/events_pb2.py +20 -20
- hatchet_sdk/contracts/events_pb2.pyi +14 -6
- hatchet_sdk/features/cron.py +1 -1
- hatchet_sdk/features/filters.py +181 -0
- hatchet_sdk/features/runs.py +7 -1
- hatchet_sdk/features/scheduled.py +1 -1
- hatchet_sdk/features/workflows.py +1 -1
- hatchet_sdk/hatchet.py +82 -71
- hatchet_sdk/opentelemetry/instrumentor.py +7 -2
- hatchet_sdk/runnables/standalone.py +6 -0
- hatchet_sdk/runnables/workflow.py +29 -2
- hatchet_sdk/utils/opentelemetry.py +19 -0
- hatchet_sdk/worker/worker.py +1 -1
- {hatchet_sdk-1.9.1.dist-info → hatchet_sdk-1.10.1.dist-info}/METADATA +1 -1
- {hatchet_sdk-1.9.1.dist-info → hatchet_sdk-1.10.1.dist-info}/RECORD +43 -34
- {hatchet_sdk-1.9.1.dist-info → hatchet_sdk-1.10.1.dist-info}/WHEEL +0 -0
- {hatchet_sdk-1.9.1.dist-info → hatchet_sdk-1.10.1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse
|
|
26
|
+
from hatchet_sdk.clients.rest.models.v1_event import V1Event
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class V1EventList(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
V1EventList
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
|
|
34
|
+
pagination: Optional[PaginationResponse] = None
|
|
35
|
+
rows: Optional[List[V1Event]] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["pagination", "rows"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of V1EventList from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of pagination
|
|
76
|
+
if self.pagination:
|
|
77
|
+
_dict["pagination"] = self.pagination.to_dict()
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in rows (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.rows:
|
|
81
|
+
for _item_rows in self.rows:
|
|
82
|
+
if _item_rows:
|
|
83
|
+
_items.append(_item_rows.to_dict())
|
|
84
|
+
_dict["rows"] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of V1EventList from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate(
|
|
97
|
+
{
|
|
98
|
+
"pagination": (
|
|
99
|
+
PaginationResponse.from_dict(obj["pagination"])
|
|
100
|
+
if obj.get("pagination") is not None
|
|
101
|
+
else None
|
|
102
|
+
),
|
|
103
|
+
"rows": (
|
|
104
|
+
[V1Event.from_dict(_item) for _item in obj["rows"]]
|
|
105
|
+
if obj.get("rows") is not None
|
|
106
|
+
else None
|
|
107
|
+
),
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
return _obj
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class V1EventWorkflowRunSummary(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
V1EventWorkflowRunSummary
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
running: StrictInt = Field(description="The number of running runs.")
|
|
32
|
+
queued: StrictInt = Field(description="The number of queued runs.")
|
|
33
|
+
succeeded: StrictInt = Field(description="The number of succeeded runs.")
|
|
34
|
+
failed: StrictInt = Field(description="The number of failed runs.")
|
|
35
|
+
cancelled: StrictInt = Field(description="The number of cancelled runs.")
|
|
36
|
+
__properties: ClassVar[List[str]] = [
|
|
37
|
+
"running",
|
|
38
|
+
"queued",
|
|
39
|
+
"succeeded",
|
|
40
|
+
"failed",
|
|
41
|
+
"cancelled",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(
|
|
45
|
+
populate_by_name=True,
|
|
46
|
+
validate_assignment=True,
|
|
47
|
+
protected_namespaces=(),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of V1EventWorkflowRunSummary from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of V1EventWorkflowRunSummary from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate(
|
|
93
|
+
{
|
|
94
|
+
"running": obj.get("running"),
|
|
95
|
+
"queued": obj.get("queued"),
|
|
96
|
+
"succeeded": obj.get("succeeded"),
|
|
97
|
+
"failed": obj.get("failed"),
|
|
98
|
+
"cancelled": obj.get("cancelled"),
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
return _obj
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
23
|
+
from typing_extensions import Annotated, Self
|
|
24
|
+
|
|
25
|
+
from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class V1Filter(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
V1Filter
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
metadata: APIResourceMeta
|
|
34
|
+
tenant_id: StrictStr = Field(
|
|
35
|
+
description="The ID of the tenant associated with this filter.",
|
|
36
|
+
alias="tenantId",
|
|
37
|
+
)
|
|
38
|
+
workflow_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = (
|
|
39
|
+
Field(
|
|
40
|
+
description="The workflow id associated with this filter.",
|
|
41
|
+
alias="workflowId",
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
scope: StrictStr = Field(
|
|
45
|
+
description="The scope associated with this filter. Used for subsetting candidate filters at evaluation time"
|
|
46
|
+
)
|
|
47
|
+
expression: StrictStr = Field(
|
|
48
|
+
description="The expression associated with this filter."
|
|
49
|
+
)
|
|
50
|
+
payload: Dict[str, Any] = Field(
|
|
51
|
+
description="Additional payload data associated with the filter"
|
|
52
|
+
)
|
|
53
|
+
__properties: ClassVar[List[str]] = [
|
|
54
|
+
"metadata",
|
|
55
|
+
"tenantId",
|
|
56
|
+
"workflowId",
|
|
57
|
+
"scope",
|
|
58
|
+
"expression",
|
|
59
|
+
"payload",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
model_config = ConfigDict(
|
|
63
|
+
populate_by_name=True,
|
|
64
|
+
validate_assignment=True,
|
|
65
|
+
protected_namespaces=(),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
def to_str(self) -> str:
|
|
69
|
+
"""Returns the string representation of the model using alias"""
|
|
70
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
71
|
+
|
|
72
|
+
def to_json(self) -> str:
|
|
73
|
+
"""Returns the JSON representation of the model using alias"""
|
|
74
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
75
|
+
return json.dumps(self.to_dict())
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of V1Filter from a JSON string"""
|
|
80
|
+
return cls.from_dict(json.loads(json_str))
|
|
81
|
+
|
|
82
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
83
|
+
"""Return the dictionary representation of the model using alias.
|
|
84
|
+
|
|
85
|
+
This has the following differences from calling pydantic's
|
|
86
|
+
`self.model_dump(by_alias=True)`:
|
|
87
|
+
|
|
88
|
+
* `None` is only added to the output dict for nullable fields that
|
|
89
|
+
were set at model initialization. Other fields with value `None`
|
|
90
|
+
are ignored.
|
|
91
|
+
"""
|
|
92
|
+
excluded_fields: Set[str] = set([])
|
|
93
|
+
|
|
94
|
+
_dict = self.model_dump(
|
|
95
|
+
by_alias=True,
|
|
96
|
+
exclude=excluded_fields,
|
|
97
|
+
exclude_none=True,
|
|
98
|
+
)
|
|
99
|
+
# override the default output from pydantic by calling `to_dict()` of metadata
|
|
100
|
+
if self.metadata:
|
|
101
|
+
_dict["metadata"] = self.metadata.to_dict()
|
|
102
|
+
return _dict
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
106
|
+
"""Create an instance of V1Filter from a dict"""
|
|
107
|
+
if obj is None:
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
if not isinstance(obj, dict):
|
|
111
|
+
return cls.model_validate(obj)
|
|
112
|
+
|
|
113
|
+
_obj = cls.model_validate(
|
|
114
|
+
{
|
|
115
|
+
"metadata": (
|
|
116
|
+
APIResourceMeta.from_dict(obj["metadata"])
|
|
117
|
+
if obj.get("metadata") is not None
|
|
118
|
+
else None
|
|
119
|
+
),
|
|
120
|
+
"tenantId": obj.get("tenantId"),
|
|
121
|
+
"workflowId": obj.get("workflowId"),
|
|
122
|
+
"scope": obj.get("scope"),
|
|
123
|
+
"expression": obj.get("expression"),
|
|
124
|
+
"payload": obj.get("payload"),
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
return _obj
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse
|
|
26
|
+
from hatchet_sdk.clients.rest.models.v1_filter import V1Filter
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class V1FilterList(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
V1FilterList
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
|
|
34
|
+
pagination: Optional[PaginationResponse] = None
|
|
35
|
+
rows: Optional[List[V1Filter]] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["pagination", "rows"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of V1FilterList from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of pagination
|
|
76
|
+
if self.pagination:
|
|
77
|
+
_dict["pagination"] = self.pagination.to_dict()
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in rows (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.rows:
|
|
81
|
+
for _item_rows in self.rows:
|
|
82
|
+
if _item_rows:
|
|
83
|
+
_items.append(_item_rows.to_dict())
|
|
84
|
+
_dict["rows"] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of V1FilterList from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate(
|
|
97
|
+
{
|
|
98
|
+
"pagination": (
|
|
99
|
+
PaginationResponse.from_dict(obj["pagination"])
|
|
100
|
+
if obj.get("pagination") is not None
|
|
101
|
+
else None
|
|
102
|
+
),
|
|
103
|
+
"rows": (
|
|
104
|
+
[V1Filter.from_dict(_item) for _item in obj["rows"]]
|
|
105
|
+
if obj.get("rows") is not None
|
|
106
|
+
else None
|
|
107
|
+
),
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
return _obj
|
|
@@ -20,9 +20,11 @@ import re # noqa: F401
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
22
22
|
|
|
23
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
23
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
+
from hatchet_sdk.clients.rest.models.v1_log_line_level import V1LogLineLevel
|
|
27
|
+
|
|
26
28
|
|
|
27
29
|
class V1LogLine(BaseModel):
|
|
28
30
|
"""
|
|
@@ -34,7 +36,21 @@ class V1LogLine(BaseModel):
|
|
|
34
36
|
)
|
|
35
37
|
message: StrictStr = Field(description="The log message.")
|
|
36
38
|
metadata: Dict[str, Any] = Field(description="The log metadata.")
|
|
37
|
-
|
|
39
|
+
retry_count: Optional[StrictInt] = Field(
|
|
40
|
+
default=None, description="The retry count of the log line.", alias="retryCount"
|
|
41
|
+
)
|
|
42
|
+
attempt: Optional[StrictInt] = Field(
|
|
43
|
+
default=None, description="The attempt number of the log line."
|
|
44
|
+
)
|
|
45
|
+
level: Optional[V1LogLineLevel] = Field(default=None, description="The log level.")
|
|
46
|
+
__properties: ClassVar[List[str]] = [
|
|
47
|
+
"createdAt",
|
|
48
|
+
"message",
|
|
49
|
+
"metadata",
|
|
50
|
+
"retryCount",
|
|
51
|
+
"attempt",
|
|
52
|
+
"level",
|
|
53
|
+
]
|
|
38
54
|
|
|
39
55
|
model_config = ConfigDict(
|
|
40
56
|
populate_by_name=True,
|
|
@@ -89,6 +105,9 @@ class V1LogLine(BaseModel):
|
|
|
89
105
|
"createdAt": obj.get("createdAt"),
|
|
90
106
|
"message": obj.get("message"),
|
|
91
107
|
"metadata": obj.get("metadata"),
|
|
108
|
+
"retryCount": obj.get("retryCount"),
|
|
109
|
+
"attempt": obj.get("attempt"),
|
|
110
|
+
"level": obj.get("level"),
|
|
92
111
|
}
|
|
93
112
|
)
|
|
94
113
|
return _obj
|
|
@@ -42,6 +42,14 @@ class V1TaskEvent(BaseModel):
|
|
|
42
42
|
task_display_name: Optional[StrictStr] = Field(
|
|
43
43
|
default=None, alias="taskDisplayName"
|
|
44
44
|
)
|
|
45
|
+
retry_count: Optional[StrictInt] = Field(
|
|
46
|
+
default=None,
|
|
47
|
+
description="The number of retries of the task.",
|
|
48
|
+
alias="retryCount",
|
|
49
|
+
)
|
|
50
|
+
attempt: Optional[StrictInt] = Field(
|
|
51
|
+
default=None, description="The attempt number of the task."
|
|
52
|
+
)
|
|
45
53
|
__properties: ClassVar[List[str]] = [
|
|
46
54
|
"id",
|
|
47
55
|
"taskId",
|
|
@@ -52,6 +60,8 @@ class V1TaskEvent(BaseModel):
|
|
|
52
60
|
"output",
|
|
53
61
|
"workerId",
|
|
54
62
|
"taskDisplayName",
|
|
63
|
+
"retryCount",
|
|
64
|
+
"attempt",
|
|
55
65
|
]
|
|
56
66
|
|
|
57
67
|
model_config = ConfigDict(
|
|
@@ -113,6 +123,8 @@ class V1TaskEvent(BaseModel):
|
|
|
113
123
|
"output": obj.get("output"),
|
|
114
124
|
"workerId": obj.get("workerId"),
|
|
115
125
|
"taskDisplayName": obj.get("taskDisplayName"),
|
|
126
|
+
"retryCount": obj.get("retryCount"),
|
|
127
|
+
"attempt": obj.get("attempt"),
|
|
116
128
|
}
|
|
117
129
|
)
|
|
118
130
|
return _obj
|
|
@@ -37,6 +37,14 @@ class V1TaskSummary(BaseModel):
|
|
|
37
37
|
action_id: Optional[StrictStr] = Field(
|
|
38
38
|
default=None, description="The action ID of the task.", alias="actionId"
|
|
39
39
|
)
|
|
40
|
+
retry_count: Optional[StrictInt] = Field(
|
|
41
|
+
default=None,
|
|
42
|
+
description="The number of retries of the task.",
|
|
43
|
+
alias="retryCount",
|
|
44
|
+
)
|
|
45
|
+
attempt: Optional[StrictInt] = Field(
|
|
46
|
+
default=None, description="The attempt number of the task."
|
|
47
|
+
)
|
|
40
48
|
additional_metadata: Optional[Dict[str, Any]] = Field(
|
|
41
49
|
default=None,
|
|
42
50
|
description="Additional metadata for the task run.",
|
|
@@ -106,6 +114,8 @@ class V1TaskSummary(BaseModel):
|
|
|
106
114
|
__properties: ClassVar[List[str]] = [
|
|
107
115
|
"metadata",
|
|
108
116
|
"actionId",
|
|
117
|
+
"retryCount",
|
|
118
|
+
"attempt",
|
|
109
119
|
"additionalMetadata",
|
|
110
120
|
"children",
|
|
111
121
|
"createdAt",
|
|
@@ -196,6 +206,8 @@ class V1TaskSummary(BaseModel):
|
|
|
196
206
|
else None
|
|
197
207
|
),
|
|
198
208
|
"actionId": obj.get("actionId"),
|
|
209
|
+
"retryCount": obj.get("retryCount"),
|
|
210
|
+
"attempt": obj.get("attempt"),
|
|
199
211
|
"additionalMetadata": obj.get("additionalMetadata"),
|
|
200
212
|
"children": (
|
|
201
213
|
[V1TaskSummary.from_dict(_item) for _item in obj["children"]]
|
|
@@ -70,6 +70,19 @@ class V1TaskTiming(BaseModel):
|
|
|
70
70
|
description="The timestamp the task run finished.",
|
|
71
71
|
alias="finishedAt",
|
|
72
72
|
)
|
|
73
|
+
workflow_run_id: Optional[StrictStr] = Field(
|
|
74
|
+
default=None,
|
|
75
|
+
description="The external ID of the workflow run.",
|
|
76
|
+
alias="workflowRunId",
|
|
77
|
+
)
|
|
78
|
+
retry_count: Optional[StrictInt] = Field(
|
|
79
|
+
default=None,
|
|
80
|
+
description="The number of retries of the task.",
|
|
81
|
+
alias="retryCount",
|
|
82
|
+
)
|
|
83
|
+
attempt: Optional[StrictInt] = Field(
|
|
84
|
+
default=None, description="The attempt number of the task."
|
|
85
|
+
)
|
|
73
86
|
__properties: ClassVar[List[str]] = [
|
|
74
87
|
"metadata",
|
|
75
88
|
"depth",
|
|
@@ -83,6 +96,9 @@ class V1TaskTiming(BaseModel):
|
|
|
83
96
|
"queuedAt",
|
|
84
97
|
"startedAt",
|
|
85
98
|
"finishedAt",
|
|
99
|
+
"workflowRunId",
|
|
100
|
+
"retryCount",
|
|
101
|
+
"attempt",
|
|
86
102
|
]
|
|
87
103
|
|
|
88
104
|
model_config = ConfigDict(
|
|
@@ -154,6 +170,9 @@ class V1TaskTiming(BaseModel):
|
|
|
154
170
|
"queuedAt": obj.get("queuedAt"),
|
|
155
171
|
"startedAt": obj.get("startedAt"),
|
|
156
172
|
"finishedAt": obj.get("finishedAt"),
|
|
173
|
+
"workflowRunId": obj.get("workflowRunId"),
|
|
174
|
+
"retryCount": obj.get("retryCount"),
|
|
175
|
+
"attempt": obj.get("attempt"),
|
|
157
176
|
}
|
|
158
177
|
)
|
|
159
178
|
return _obj
|
|
@@ -47,6 +47,9 @@ class Workflow(BaseModel):
|
|
|
47
47
|
jobs: Optional[List[Job]] = Field(
|
|
48
48
|
default=None, description="The jobs of the workflow."
|
|
49
49
|
)
|
|
50
|
+
tenant_id: StrictStr = Field(
|
|
51
|
+
description="The tenant id of the workflow.", alias="tenantId"
|
|
52
|
+
)
|
|
50
53
|
__properties: ClassVar[List[str]] = [
|
|
51
54
|
"metadata",
|
|
52
55
|
"name",
|
|
@@ -55,6 +58,7 @@ class Workflow(BaseModel):
|
|
|
55
58
|
"versions",
|
|
56
59
|
"tags",
|
|
57
60
|
"jobs",
|
|
61
|
+
"tenantId",
|
|
58
62
|
]
|
|
59
63
|
|
|
60
64
|
model_config = ConfigDict(
|
|
@@ -154,6 +158,7 @@ class Workflow(BaseModel):
|
|
|
154
158
|
if obj.get("jobs") is not None
|
|
155
159
|
else None
|
|
156
160
|
),
|
|
161
|
+
"tenantId": obj.get("tenantId"),
|
|
157
162
|
}
|
|
158
163
|
)
|
|
159
164
|
return _obj
|