hatchet-sdk 1.16.4__py3-none-any.whl → 1.17.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/__init__.py +2 -1
- hatchet_sdk/clients/events.py +5 -2
- hatchet_sdk/clients/rest/__init__.py +32 -0
- hatchet_sdk/clients/rest/api/__init__.py +1 -0
- hatchet_sdk/clients/rest/api/webhook_api.py +1551 -0
- hatchet_sdk/clients/rest/models/__init__.py +31 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request.py +215 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_api_key.py +126 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_api_key_all_of_auth_type.py +82 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_base.py +98 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_basic_auth.py +126 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_basic_auth_all_of_auth_type.py +82 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_hmac.py +126 -0
- hatchet_sdk/clients/rest/models/v1_create_webhook_request_hmac_all_of_auth_type.py +82 -0
- hatchet_sdk/clients/rest/models/v1_event.py +7 -0
- hatchet_sdk/clients/rest/models/v1_webhook.py +126 -0
- hatchet_sdk/clients/rest/models/v1_webhook_api_key_auth.py +90 -0
- hatchet_sdk/clients/rest/models/v1_webhook_auth_type.py +38 -0
- hatchet_sdk/clients/rest/models/v1_webhook_basic_auth.py +86 -0
- hatchet_sdk/clients/rest/models/v1_webhook_hmac_algorithm.py +39 -0
- hatchet_sdk/clients/rest/models/v1_webhook_hmac_auth.py +115 -0
- hatchet_sdk/clients/rest/models/v1_webhook_hmac_encoding.py +38 -0
- hatchet_sdk/clients/rest/models/v1_webhook_list.py +110 -0
- hatchet_sdk/clients/rest/models/v1_webhook_receive200_response.py +83 -0
- hatchet_sdk/clients/rest/models/v1_webhook_source_name.py +38 -0
- hatchet_sdk/context/context.py +31 -2
- hatchet_sdk/exceptions.py +70 -5
- hatchet_sdk/hatchet.py +29 -11
- hatchet_sdk/rate_limit.py +1 -21
- hatchet_sdk/runnables/task.py +109 -19
- hatchet_sdk/runnables/workflow.py +23 -8
- hatchet_sdk/utils/typing.py +27 -0
- hatchet_sdk/worker/runner/runner.py +27 -19
- hatchet_sdk/worker/runner/utils/capture_logs.py +24 -11
- {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/METADATA +2 -3
- {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/RECORD +38 -19
- {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/WHEEL +0 -0
- {hatchet_sdk-1.16.4.dist-info → hatchet_sdk-1.17.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
|
|
26
|
+
class V1CreateWebhookRequestBasicAuthAllOfAuthType(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
V1CreateWebhookRequestBasicAuthAllOfAuthType
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
__properties: ClassVar[List[str]] = []
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of V1CreateWebhookRequestBasicAuthAllOfAuthType from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([])
|
|
64
|
+
|
|
65
|
+
_dict = self.model_dump(
|
|
66
|
+
by_alias=True,
|
|
67
|
+
exclude=excluded_fields,
|
|
68
|
+
exclude_none=True,
|
|
69
|
+
)
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of V1CreateWebhookRequestBasicAuthAllOfAuthType from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return cls.model_validate(obj)
|
|
80
|
+
|
|
81
|
+
_obj = cls.model_validate({})
|
|
82
|
+
return _obj
|
|
@@ -0,0 +1,126 @@
|
|
|
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, field_validator
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
from hatchet_sdk.clients.rest.models.v1_webhook_hmac_auth import V1WebhookHMACAuth
|
|
26
|
+
from hatchet_sdk.clients.rest.models.v1_webhook_source_name import V1WebhookSourceName
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class V1CreateWebhookRequestHMAC(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
V1CreateWebhookRequestHMAC
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
|
|
34
|
+
source_name: V1WebhookSourceName = Field(
|
|
35
|
+
description="The name of the source for this webhook", alias="sourceName"
|
|
36
|
+
)
|
|
37
|
+
name: StrictStr = Field(description="The name of the webhook")
|
|
38
|
+
event_key_expression: StrictStr = Field(
|
|
39
|
+
description="The CEL expression to use for the event key. This is used to create the event key from the webhook payload.",
|
|
40
|
+
alias="eventKeyExpression",
|
|
41
|
+
)
|
|
42
|
+
auth_type: StrictStr = Field(
|
|
43
|
+
description="The type of authentication to use for the webhook",
|
|
44
|
+
alias="authType",
|
|
45
|
+
)
|
|
46
|
+
auth: V1WebhookHMACAuth
|
|
47
|
+
__properties: ClassVar[List[str]] = [
|
|
48
|
+
"sourceName",
|
|
49
|
+
"name",
|
|
50
|
+
"eventKeyExpression",
|
|
51
|
+
"authType",
|
|
52
|
+
"auth",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
@field_validator("auth_type")
|
|
56
|
+
def auth_type_validate_enum(cls, value):
|
|
57
|
+
"""Validates the enum"""
|
|
58
|
+
if value not in set(["HMAC"]):
|
|
59
|
+
raise ValueError("must be one of enum values ('HMAC')")
|
|
60
|
+
return value
|
|
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 V1CreateWebhookRequestHMAC 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 auth
|
|
100
|
+
if self.auth:
|
|
101
|
+
_dict["auth"] = self.auth.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 V1CreateWebhookRequestHMAC 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
|
+
"sourceName": obj.get("sourceName"),
|
|
116
|
+
"name": obj.get("name"),
|
|
117
|
+
"eventKeyExpression": obj.get("eventKeyExpression"),
|
|
118
|
+
"authType": obj.get("authType"),
|
|
119
|
+
"auth": (
|
|
120
|
+
V1WebhookHMACAuth.from_dict(obj["auth"])
|
|
121
|
+
if obj.get("auth") is not None
|
|
122
|
+
else None
|
|
123
|
+
),
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
return _obj
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
|
|
26
|
+
class V1CreateWebhookRequestHMACAllOfAuthType(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
V1CreateWebhookRequestHMACAllOfAuthType
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
__properties: ClassVar[List[str]] = []
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of V1CreateWebhookRequestHMACAllOfAuthType from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([])
|
|
64
|
+
|
|
65
|
+
_dict = self.model_dump(
|
|
66
|
+
by_alias=True,
|
|
67
|
+
exclude=excluded_fields,
|
|
68
|
+
exclude_none=True,
|
|
69
|
+
)
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of V1CreateWebhookRequestHMACAllOfAuthType from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return cls.model_validate(obj)
|
|
80
|
+
|
|
81
|
+
_obj = cls.model_validate({})
|
|
82
|
+
return _obj
|
|
@@ -71,6 +71,11 @@ class V1Event(BaseModel):
|
|
|
71
71
|
description="The external IDs of the runs that were triggered by this event.",
|
|
72
72
|
alias="triggeredRuns",
|
|
73
73
|
)
|
|
74
|
+
triggering_webhook_name: Optional[StrictStr] = Field(
|
|
75
|
+
default=None,
|
|
76
|
+
description="The name of the webhook that triggered this event, if applicable.",
|
|
77
|
+
alias="triggeringWebhookName",
|
|
78
|
+
)
|
|
74
79
|
__properties: ClassVar[List[str]] = [
|
|
75
80
|
"metadata",
|
|
76
81
|
"key",
|
|
@@ -82,6 +87,7 @@ class V1Event(BaseModel):
|
|
|
82
87
|
"scope",
|
|
83
88
|
"seenAt",
|
|
84
89
|
"triggeredRuns",
|
|
90
|
+
"triggeringWebhookName",
|
|
85
91
|
]
|
|
86
92
|
|
|
87
93
|
model_config = ConfigDict(
|
|
@@ -179,6 +185,7 @@ class V1Event(BaseModel):
|
|
|
179
185
|
if obj.get("triggeredRuns") is not None
|
|
180
186
|
else None
|
|
181
187
|
),
|
|
188
|
+
"triggeringWebhookName": obj.get("triggeringWebhookName"),
|
|
182
189
|
}
|
|
183
190
|
)
|
|
184
191
|
return _obj
|
|
@@ -0,0 +1,126 @@
|
|
|
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 Self
|
|
24
|
+
|
|
25
|
+
from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta
|
|
26
|
+
from hatchet_sdk.clients.rest.models.v1_webhook_auth_type import V1WebhookAuthType
|
|
27
|
+
from hatchet_sdk.clients.rest.models.v1_webhook_source_name import V1WebhookSourceName
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class V1Webhook(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
V1Webhook
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
|
|
35
|
+
metadata: APIResourceMeta
|
|
36
|
+
tenant_id: StrictStr = Field(
|
|
37
|
+
description="The ID of the tenant associated with this webhook.",
|
|
38
|
+
alias="tenantId",
|
|
39
|
+
)
|
|
40
|
+
name: StrictStr = Field(description="The name of the webhook")
|
|
41
|
+
source_name: V1WebhookSourceName = Field(
|
|
42
|
+
description="The name of the source for this webhook", alias="sourceName"
|
|
43
|
+
)
|
|
44
|
+
event_key_expression: StrictStr = Field(
|
|
45
|
+
description="The CEL expression to use for the event key. This is used to create the event key from the webhook payload.",
|
|
46
|
+
alias="eventKeyExpression",
|
|
47
|
+
)
|
|
48
|
+
auth_type: V1WebhookAuthType = Field(
|
|
49
|
+
description="The type of authentication to use for the webhook",
|
|
50
|
+
alias="authType",
|
|
51
|
+
)
|
|
52
|
+
__properties: ClassVar[List[str]] = [
|
|
53
|
+
"metadata",
|
|
54
|
+
"tenantId",
|
|
55
|
+
"name",
|
|
56
|
+
"sourceName",
|
|
57
|
+
"eventKeyExpression",
|
|
58
|
+
"authType",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
model_config = ConfigDict(
|
|
62
|
+
populate_by_name=True,
|
|
63
|
+
validate_assignment=True,
|
|
64
|
+
protected_namespaces=(),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
def to_str(self) -> str:
|
|
68
|
+
"""Returns the string representation of the model using alias"""
|
|
69
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
70
|
+
|
|
71
|
+
def to_json(self) -> str:
|
|
72
|
+
"""Returns the JSON representation of the model using alias"""
|
|
73
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
74
|
+
return json.dumps(self.to_dict())
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of V1Webhook from a JSON string"""
|
|
79
|
+
return cls.from_dict(json.loads(json_str))
|
|
80
|
+
|
|
81
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
82
|
+
"""Return the dictionary representation of the model using alias.
|
|
83
|
+
|
|
84
|
+
This has the following differences from calling pydantic's
|
|
85
|
+
`self.model_dump(by_alias=True)`:
|
|
86
|
+
|
|
87
|
+
* `None` is only added to the output dict for nullable fields that
|
|
88
|
+
were set at model initialization. Other fields with value `None`
|
|
89
|
+
are ignored.
|
|
90
|
+
"""
|
|
91
|
+
excluded_fields: Set[str] = set([])
|
|
92
|
+
|
|
93
|
+
_dict = self.model_dump(
|
|
94
|
+
by_alias=True,
|
|
95
|
+
exclude=excluded_fields,
|
|
96
|
+
exclude_none=True,
|
|
97
|
+
)
|
|
98
|
+
# override the default output from pydantic by calling `to_dict()` of metadata
|
|
99
|
+
if self.metadata:
|
|
100
|
+
_dict["metadata"] = self.metadata.to_dict()
|
|
101
|
+
return _dict
|
|
102
|
+
|
|
103
|
+
@classmethod
|
|
104
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
105
|
+
"""Create an instance of V1Webhook from a dict"""
|
|
106
|
+
if obj is None:
|
|
107
|
+
return None
|
|
108
|
+
|
|
109
|
+
if not isinstance(obj, dict):
|
|
110
|
+
return cls.model_validate(obj)
|
|
111
|
+
|
|
112
|
+
_obj = cls.model_validate(
|
|
113
|
+
{
|
|
114
|
+
"metadata": (
|
|
115
|
+
APIResourceMeta.from_dict(obj["metadata"])
|
|
116
|
+
if obj.get("metadata") is not None
|
|
117
|
+
else None
|
|
118
|
+
),
|
|
119
|
+
"tenantId": obj.get("tenantId"),
|
|
120
|
+
"name": obj.get("name"),
|
|
121
|
+
"sourceName": obj.get("sourceName"),
|
|
122
|
+
"eventKeyExpression": obj.get("eventKeyExpression"),
|
|
123
|
+
"authType": obj.get("authType"),
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
return _obj
|
|
@@ -0,0 +1,90 @@
|
|
|
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 Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class V1WebhookAPIKeyAuth(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
V1WebhookAPIKeyAuth
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
header_name: StrictStr = Field(
|
|
32
|
+
description="The name of the header to use for the API key", alias="headerName"
|
|
33
|
+
)
|
|
34
|
+
api_key: StrictStr = Field(
|
|
35
|
+
description="The API key to use for authentication", alias="apiKey"
|
|
36
|
+
)
|
|
37
|
+
__properties: ClassVar[List[str]] = ["headerName", "apiKey"]
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
populate_by_name=True,
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of V1WebhookAPIKeyAuth from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of V1WebhookAPIKeyAuth from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate(
|
|
88
|
+
{"headerName": obj.get("headerName"), "apiKey": obj.get("apiKey")}
|
|
89
|
+
)
|
|
90
|
+
return _obj
|
|
@@ -0,0 +1,38 @@
|
|
|
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 V1WebhookAuthType(str, Enum):
|
|
24
|
+
"""
|
|
25
|
+
V1WebhookAuthType
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
allowed enum values
|
|
30
|
+
"""
|
|
31
|
+
BASIC = "BASIC"
|
|
32
|
+
API_KEY = "API_KEY"
|
|
33
|
+
HMAC = "HMAC"
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_json(cls, json_str: str) -> Self:
|
|
37
|
+
"""Create an instance of V1WebhookAuthType from a JSON string"""
|
|
38
|
+
return cls(json.loads(json_str))
|
|
@@ -0,0 +1,86 @@
|
|
|
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 Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class V1WebhookBasicAuth(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
V1WebhookBasicAuth
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
username: StrictStr = Field(description="The username for basic auth")
|
|
32
|
+
password: StrictStr = Field(description="The password for basic auth")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["username", "password"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of V1WebhookBasicAuth from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of V1WebhookBasicAuth from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate(
|
|
84
|
+
{"username": obj.get("username"), "password": obj.get("password")}
|
|
85
|
+
)
|
|
86
|
+
return _obj
|
|
@@ -0,0 +1,39 @@
|
|
|
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 V1WebhookHMACAlgorithm(str, Enum):
|
|
24
|
+
"""
|
|
25
|
+
V1WebhookHMACAlgorithm
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
allowed enum values
|
|
30
|
+
"""
|
|
31
|
+
SHA1 = "SHA1"
|
|
32
|
+
SHA256 = "SHA256"
|
|
33
|
+
SHA512 = "SHA512"
|
|
34
|
+
MD5 = "MD5"
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def from_json(cls, json_str: str) -> Self:
|
|
38
|
+
"""Create an instance of V1WebhookHMACAlgorithm from a JSON string"""
|
|
39
|
+
return cls(json.loads(json_str))
|