Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit 4657229

Browse files
macwilksrhinos
andauthored
Patch OpenAPI Generated Code When Generating New RESTful Client Code (#166)
* Add Patch File * Apply Patch At End of Generate Script --------- Co-authored-by: srhinos <[email protected]>
1 parent 7f64f39 commit 4657229

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

generate.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ fi
7373

7474
# ensure that pre-commit is applied without errors
7575
pre-commit run --all-files || pre-commit run --all-files
76+
77+
# apply patch to openapi-generator generated code
78+
patch -p1 --no-backup-if-mismatch <./openapi_patch.patch

hatchet_sdk/clients/rest/api/workflow_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Do not edit the class manually.
1212
""" # noqa: E501
1313

14+
import warnings
1415
from datetime import datetime
1516
from typing import Any, Dict, List, Optional, Tuple, Union
1617

openapi_patch.patch

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
diff --git a/hatchet_sdk/clients/rest/api/workflow_api.py b/hatchet_sdk/clients/rest/api/workflow_api.py
2+
index 5716532..c32ba44 100644
3+
--- a/hatchet_sdk/clients/rest/api/workflow_api.py
4+
+++ b/hatchet_sdk/clients/rest/api/workflow_api.py
5+
@@ -2185,9 +2185,7 @@ class WorkflowApi:
6+
_query_params.append(
7+
(
8+
"createdAfter",
9+
- created_after.strftime(
10+
- self.api_client.configuration.datetime_format
11+
- ),
12+
+ created_after.isoformat(),
13+
)
14+
)
15+
else:
16+
@@ -2198,9 +2196,7 @@ class WorkflowApi:
17+
_query_params.append(
18+
(
19+
"createdBefore",
20+
- created_before.strftime(
21+
- self.api_client.configuration.datetime_format
22+
- ),
23+
+ created_before.isoformat(),
24+
)
25+
)
26+
else:
27+
@@ -2789,9 +2785,7 @@ class WorkflowApi:
28+
_query_params.append(
29+
(
30+
"createdAfter",
31+
- created_after.strftime(
32+
- self.api_client.configuration.datetime_format
33+
- ),
34+
+ created_after.isoformat(),
35+
)
36+
)
37+
else:
38+
@@ -2802,9 +2796,7 @@ class WorkflowApi:
39+
_query_params.append(
40+
(
41+
"createdBefore",
42+
- created_before.strftime(
43+
- self.api_client.configuration.datetime_format
44+
- ),
45+
+ created_before.isoformat(),
46+
)
47+
)
48+
else:
49+
diff --git a/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py b/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py
50+
index 71b6351..5f70c44 100644
51+
--- a/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py
52+
+++ b/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py
53+
@@ -22,13 +22,17 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
54+
from pydantic import BaseModel, ConfigDict
55+
from typing_extensions import Self
56+
57+
+from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import (
58+
+ WorkflowRunsMetricsCounts,
59+
+)
60+
+
61+
62+
class WorkflowRunsMetrics(BaseModel):
63+
"""
64+
WorkflowRunsMetrics
65+
""" # noqa: E501
66+
67+
- counts: Optional[Dict[str, Any]] = None
68+
+ counts: Optional[WorkflowRunsMetricsCounts] = None
69+
__properties: ClassVar[List[str]] = ["counts"]
70+
71+
model_config = ConfigDict(

0 commit comments

Comments
 (0)