windmill-api 1.443.0__py3-none-any.whl → 1.445.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 windmill-api might be problematic. Click here for more details.
- windmill_api/api/capture/{update_capture.py → delete_capture.py} +13 -13
- windmill_api/api/capture/get_capture_configs.py +186 -0
- windmill_api/api/capture/list_captures.py +211 -0
- windmill_api/api/capture/ping_capture_config.py +121 -0
- windmill_api/api/capture/set_capture_config.py +107 -0
- windmill_api/api/nats_trigger/__init__.py +0 -0
- windmill_api/api/nats_trigger/create_nats_trigger.py +105 -0
- windmill_api/api/{capture/create_capture.py → nats_trigger/delete_nats_trigger.py} +4 -6
- windmill_api/api/nats_trigger/exists_nats_trigger.py +160 -0
- windmill_api/api/nats_trigger/get_nats_trigger.py +166 -0
- windmill_api/api/nats_trigger/list_nats_triggers.py +237 -0
- windmill_api/api/nats_trigger/set_nats_trigger_enabled.py +113 -0
- windmill_api/api/{capture/get_capture.py → nats_trigger/update_nats_trigger.py} +16 -8
- windmill_api/api/workspace/change_workspace_color.py +105 -0
- windmill_api/models/add_granular_acls_kind.py +1 -0
- windmill_api/models/capture.py +94 -0
- windmill_api/models/capture_config.py +95 -0
- windmill_api/models/capture_config_trigger_kind.py +13 -0
- windmill_api/models/capture_trigger_kind.py +13 -0
- windmill_api/models/change_workspace_color_json_body.py +58 -0
- windmill_api/models/create_nats_trigger_json_body.py +120 -0
- windmill_api/models/create_websocket_trigger_json_body.py +42 -29
- windmill_api/models/create_workspace.py +8 -0
- windmill_api/models/create_workspace_json_body.py +8 -0
- windmill_api/models/edit_nats_trigger.py +112 -0
- windmill_api/models/edit_websocket_trigger.py +35 -21
- windmill_api/models/get_capture_configs_response_200_item.py +95 -0
- windmill_api/models/get_capture_configs_response_200_item_trigger_kind.py +13 -0
- windmill_api/models/get_capture_configs_runnable_kind.py +9 -0
- windmill_api/models/get_granular_acls_kind.py +1 -0
- windmill_api/models/get_nats_trigger_response_200.py +196 -0
- windmill_api/models/get_nats_trigger_response_200_extra_perms.py +44 -0
- windmill_api/models/get_settings_response_200.py +8 -0
- windmill_api/models/get_triggers_count_of_flow_response_200.py +8 -0
- windmill_api/models/get_triggers_count_of_script_response_200.py +8 -0
- windmill_api/models/get_used_triggers_response_200.py +7 -0
- windmill_api/models/get_websocket_trigger_response_200.py +54 -41
- windmill_api/models/list_captures_response_200_item.py +94 -0
- windmill_api/models/list_captures_response_200_item_trigger_kind.py +13 -0
- windmill_api/models/list_captures_runnable_kind.py +9 -0
- windmill_api/models/list_captures_trigger_kind.py +13 -0
- windmill_api/models/list_nats_triggers_response_200_item.py +196 -0
- windmill_api/models/list_nats_triggers_response_200_item_extra_perms.py +44 -0
- windmill_api/models/list_user_workspaces_response_200_workspaces_item.py +7 -0
- windmill_api/models/list_websocket_triggers_response_200_item.py +54 -41
- windmill_api/models/list_workspaces_as_super_admin_response_200_item.py +8 -0
- windmill_api/models/list_workspaces_response_200_item.py +8 -0
- windmill_api/models/nats_trigger.py +196 -0
- windmill_api/models/nats_trigger_extra_perms.py +44 -0
- windmill_api/models/new_nats_trigger.py +120 -0
- windmill_api/models/new_websocket_trigger.py +36 -26
- windmill_api/models/ping_capture_config_runnable_kind.py +9 -0
- windmill_api/models/ping_capture_config_trigger_kind.py +13 -0
- windmill_api/models/remove_granular_acls_kind.py +1 -0
- windmill_api/models/set_capture_config_json_body.py +97 -0
- windmill_api/models/set_capture_config_json_body_trigger_config.py +44 -0
- windmill_api/models/set_capture_config_json_body_trigger_kind.py +13 -0
- windmill_api/models/set_nats_trigger_enabled_json_body.py +58 -0
- windmill_api/models/triggers_count.py +8 -0
- windmill_api/models/update_nats_trigger_json_body.py +112 -0
- windmill_api/models/update_websocket_trigger_json_body.py +40 -24
- windmill_api/models/user_workspace_list_workspaces_item.py +7 -0
- windmill_api/models/websocket_trigger.py +48 -38
- windmill_api/models/workspace.py +8 -0
- {windmill_api-1.443.0.dist-info → windmill_api-1.445.0.dist-info}/METADATA +1 -1
- {windmill_api-1.443.0.dist-info → windmill_api-1.445.0.dist-info}/RECORD +68 -29
- {windmill_api-1.443.0.dist-info → windmill_api-1.445.0.dist-info}/LICENSE +0 -0
- {windmill_api-1.443.0.dist-info → windmill_api-1.445.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
|
2
|
+
|
|
3
|
+
from attrs import define as _attrs_define
|
|
4
|
+
from attrs import field as _attrs_field
|
|
5
|
+
|
|
6
|
+
from ..types import UNSET, Unset
|
|
7
|
+
|
|
8
|
+
T = TypeVar("T", bound="CreateNatsTriggerJsonBody")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@_attrs_define
|
|
12
|
+
class CreateNatsTriggerJsonBody:
|
|
13
|
+
"""
|
|
14
|
+
Attributes:
|
|
15
|
+
path (str):
|
|
16
|
+
script_path (str):
|
|
17
|
+
is_flow (bool):
|
|
18
|
+
nats_resource_path (str):
|
|
19
|
+
use_jetstream (bool):
|
|
20
|
+
subjects (List[str]):
|
|
21
|
+
stream_name (Union[Unset, str]):
|
|
22
|
+
consumer_name (Union[Unset, str]):
|
|
23
|
+
enabled (Union[Unset, bool]):
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
path: str
|
|
27
|
+
script_path: str
|
|
28
|
+
is_flow: bool
|
|
29
|
+
nats_resource_path: str
|
|
30
|
+
use_jetstream: bool
|
|
31
|
+
subjects: List[str]
|
|
32
|
+
stream_name: Union[Unset, str] = UNSET
|
|
33
|
+
consumer_name: Union[Unset, str] = UNSET
|
|
34
|
+
enabled: Union[Unset, bool] = UNSET
|
|
35
|
+
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
36
|
+
|
|
37
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
38
|
+
path = self.path
|
|
39
|
+
script_path = self.script_path
|
|
40
|
+
is_flow = self.is_flow
|
|
41
|
+
nats_resource_path = self.nats_resource_path
|
|
42
|
+
use_jetstream = self.use_jetstream
|
|
43
|
+
subjects = self.subjects
|
|
44
|
+
|
|
45
|
+
stream_name = self.stream_name
|
|
46
|
+
consumer_name = self.consumer_name
|
|
47
|
+
enabled = self.enabled
|
|
48
|
+
|
|
49
|
+
field_dict: Dict[str, Any] = {}
|
|
50
|
+
field_dict.update(self.additional_properties)
|
|
51
|
+
field_dict.update(
|
|
52
|
+
{
|
|
53
|
+
"path": path,
|
|
54
|
+
"script_path": script_path,
|
|
55
|
+
"is_flow": is_flow,
|
|
56
|
+
"nats_resource_path": nats_resource_path,
|
|
57
|
+
"use_jetstream": use_jetstream,
|
|
58
|
+
"subjects": subjects,
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
if stream_name is not UNSET:
|
|
62
|
+
field_dict["stream_name"] = stream_name
|
|
63
|
+
if consumer_name is not UNSET:
|
|
64
|
+
field_dict["consumer_name"] = consumer_name
|
|
65
|
+
if enabled is not UNSET:
|
|
66
|
+
field_dict["enabled"] = enabled
|
|
67
|
+
|
|
68
|
+
return field_dict
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
72
|
+
d = src_dict.copy()
|
|
73
|
+
path = d.pop("path")
|
|
74
|
+
|
|
75
|
+
script_path = d.pop("script_path")
|
|
76
|
+
|
|
77
|
+
is_flow = d.pop("is_flow")
|
|
78
|
+
|
|
79
|
+
nats_resource_path = d.pop("nats_resource_path")
|
|
80
|
+
|
|
81
|
+
use_jetstream = d.pop("use_jetstream")
|
|
82
|
+
|
|
83
|
+
subjects = cast(List[str], d.pop("subjects"))
|
|
84
|
+
|
|
85
|
+
stream_name = d.pop("stream_name", UNSET)
|
|
86
|
+
|
|
87
|
+
consumer_name = d.pop("consumer_name", UNSET)
|
|
88
|
+
|
|
89
|
+
enabled = d.pop("enabled", UNSET)
|
|
90
|
+
|
|
91
|
+
create_nats_trigger_json_body = cls(
|
|
92
|
+
path=path,
|
|
93
|
+
script_path=script_path,
|
|
94
|
+
is_flow=is_flow,
|
|
95
|
+
nats_resource_path=nats_resource_path,
|
|
96
|
+
use_jetstream=use_jetstream,
|
|
97
|
+
subjects=subjects,
|
|
98
|
+
stream_name=stream_name,
|
|
99
|
+
consumer_name=consumer_name,
|
|
100
|
+
enabled=enabled,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
create_nats_trigger_json_body.additional_properties = d
|
|
104
|
+
return create_nats_trigger_json_body
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def additional_keys(self) -> List[str]:
|
|
108
|
+
return list(self.additional_properties.keys())
|
|
109
|
+
|
|
110
|
+
def __getitem__(self, key: str) -> Any:
|
|
111
|
+
return self.additional_properties[key]
|
|
112
|
+
|
|
113
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
114
|
+
self.additional_properties[key] = value
|
|
115
|
+
|
|
116
|
+
def __delitem__(self, key: str) -> None:
|
|
117
|
+
del self.additional_properties[key]
|
|
118
|
+
|
|
119
|
+
def __contains__(self, key: str) -> bool:
|
|
120
|
+
return key in self.additional_properties
|
|
@@ -30,10 +30,10 @@ class CreateWebsocketTriggerJsonBody:
|
|
|
30
30
|
is_flow (bool):
|
|
31
31
|
url (str):
|
|
32
32
|
filters (List['CreateWebsocketTriggerJsonBodyFiltersItem']):
|
|
33
|
-
initial_messages (List[Union['CreateWebsocketTriggerJsonBodyInitialMessagesItemType0',
|
|
34
|
-
'CreateWebsocketTriggerJsonBodyInitialMessagesItemType1']]):
|
|
35
|
-
url_runnable_args (CreateWebsocketTriggerJsonBodyUrlRunnableArgs):
|
|
36
33
|
enabled (Union[Unset, bool]):
|
|
34
|
+
initial_messages (Union[Unset, List[Union['CreateWebsocketTriggerJsonBodyInitialMessagesItemType0',
|
|
35
|
+
'CreateWebsocketTriggerJsonBodyInitialMessagesItemType1']]]):
|
|
36
|
+
url_runnable_args (Union[Unset, CreateWebsocketTriggerJsonBodyUrlRunnableArgs]):
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
39
|
path: str
|
|
@@ -41,14 +41,17 @@ class CreateWebsocketTriggerJsonBody:
|
|
|
41
41
|
is_flow: bool
|
|
42
42
|
url: str
|
|
43
43
|
filters: List["CreateWebsocketTriggerJsonBodyFiltersItem"]
|
|
44
|
-
initial_messages: List[
|
|
45
|
-
Union[
|
|
46
|
-
"CreateWebsocketTriggerJsonBodyInitialMessagesItemType0",
|
|
47
|
-
"CreateWebsocketTriggerJsonBodyInitialMessagesItemType1",
|
|
48
|
-
]
|
|
49
|
-
]
|
|
50
|
-
url_runnable_args: "CreateWebsocketTriggerJsonBodyUrlRunnableArgs"
|
|
51
44
|
enabled: Union[Unset, bool] = UNSET
|
|
45
|
+
initial_messages: Union[
|
|
46
|
+
Unset,
|
|
47
|
+
List[
|
|
48
|
+
Union[
|
|
49
|
+
"CreateWebsocketTriggerJsonBodyInitialMessagesItemType0",
|
|
50
|
+
"CreateWebsocketTriggerJsonBodyInitialMessagesItemType1",
|
|
51
|
+
]
|
|
52
|
+
],
|
|
53
|
+
] = UNSET
|
|
54
|
+
url_runnable_args: Union[Unset, "CreateWebsocketTriggerJsonBodyUrlRunnableArgs"] = UNSET
|
|
52
55
|
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
53
56
|
|
|
54
57
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -66,21 +69,24 @@ class CreateWebsocketTriggerJsonBody:
|
|
|
66
69
|
|
|
67
70
|
filters.append(filters_item)
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
initial_messages_item
|
|
72
|
+
enabled = self.enabled
|
|
73
|
+
initial_messages: Union[Unset, List[Dict[str, Any]]] = UNSET
|
|
74
|
+
if not isinstance(self.initial_messages, Unset):
|
|
75
|
+
initial_messages = []
|
|
76
|
+
for initial_messages_item_data in self.initial_messages:
|
|
77
|
+
initial_messages_item: Dict[str, Any]
|
|
75
78
|
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
if isinstance(initial_messages_item_data, CreateWebsocketTriggerJsonBodyInitialMessagesItemType0):
|
|
80
|
+
initial_messages_item = initial_messages_item_data.to_dict()
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
else:
|
|
83
|
+
initial_messages_item = initial_messages_item_data.to_dict()
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
initial_messages.append(initial_messages_item)
|
|
82
86
|
|
|
83
|
-
|
|
87
|
+
url_runnable_args: Union[Unset, Dict[str, Any]] = UNSET
|
|
88
|
+
if not isinstance(self.url_runnable_args, Unset):
|
|
89
|
+
url_runnable_args = self.url_runnable_args.to_dict()
|
|
84
90
|
|
|
85
91
|
field_dict: Dict[str, Any] = {}
|
|
86
92
|
field_dict.update(self.additional_properties)
|
|
@@ -91,12 +97,14 @@ class CreateWebsocketTriggerJsonBody:
|
|
|
91
97
|
"is_flow": is_flow,
|
|
92
98
|
"url": url,
|
|
93
99
|
"filters": filters,
|
|
94
|
-
"initial_messages": initial_messages,
|
|
95
|
-
"url_runnable_args": url_runnable_args,
|
|
96
100
|
}
|
|
97
101
|
)
|
|
98
102
|
if enabled is not UNSET:
|
|
99
103
|
field_dict["enabled"] = enabled
|
|
104
|
+
if initial_messages is not UNSET:
|
|
105
|
+
field_dict["initial_messages"] = initial_messages
|
|
106
|
+
if url_runnable_args is not UNSET:
|
|
107
|
+
field_dict["url_runnable_args"] = url_runnable_args
|
|
100
108
|
|
|
101
109
|
return field_dict
|
|
102
110
|
|
|
@@ -129,9 +137,11 @@ class CreateWebsocketTriggerJsonBody:
|
|
|
129
137
|
|
|
130
138
|
filters.append(filters_item)
|
|
131
139
|
|
|
140
|
+
enabled = d.pop("enabled", UNSET)
|
|
141
|
+
|
|
132
142
|
initial_messages = []
|
|
133
|
-
_initial_messages = d.pop("initial_messages")
|
|
134
|
-
for initial_messages_item_data in _initial_messages:
|
|
143
|
+
_initial_messages = d.pop("initial_messages", UNSET)
|
|
144
|
+
for initial_messages_item_data in _initial_messages or []:
|
|
135
145
|
|
|
136
146
|
def _parse_initial_messages_item(
|
|
137
147
|
data: object,
|
|
@@ -159,9 +169,12 @@ class CreateWebsocketTriggerJsonBody:
|
|
|
159
169
|
|
|
160
170
|
initial_messages.append(initial_messages_item)
|
|
161
171
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
172
|
+
_url_runnable_args = d.pop("url_runnable_args", UNSET)
|
|
173
|
+
url_runnable_args: Union[Unset, CreateWebsocketTriggerJsonBodyUrlRunnableArgs]
|
|
174
|
+
if isinstance(_url_runnable_args, Unset):
|
|
175
|
+
url_runnable_args = UNSET
|
|
176
|
+
else:
|
|
177
|
+
url_runnable_args = CreateWebsocketTriggerJsonBodyUrlRunnableArgs.from_dict(_url_runnable_args)
|
|
165
178
|
|
|
166
179
|
create_websocket_trigger_json_body = cls(
|
|
167
180
|
path=path,
|
|
@@ -169,9 +182,9 @@ class CreateWebsocketTriggerJsonBody:
|
|
|
169
182
|
is_flow=is_flow,
|
|
170
183
|
url=url,
|
|
171
184
|
filters=filters,
|
|
185
|
+
enabled=enabled,
|
|
172
186
|
initial_messages=initial_messages,
|
|
173
187
|
url_runnable_args=url_runnable_args,
|
|
174
|
-
enabled=enabled,
|
|
175
188
|
)
|
|
176
189
|
|
|
177
190
|
create_websocket_trigger_json_body.additional_properties = d
|
|
@@ -15,17 +15,20 @@ class CreateWorkspace:
|
|
|
15
15
|
id (str):
|
|
16
16
|
name (str):
|
|
17
17
|
username (Union[Unset, str]):
|
|
18
|
+
color (Union[Unset, str]):
|
|
18
19
|
"""
|
|
19
20
|
|
|
20
21
|
id: str
|
|
21
22
|
name: str
|
|
22
23
|
username: Union[Unset, str] = UNSET
|
|
24
|
+
color: Union[Unset, str] = UNSET
|
|
23
25
|
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
26
|
|
|
25
27
|
def to_dict(self) -> Dict[str, Any]:
|
|
26
28
|
id = self.id
|
|
27
29
|
name = self.name
|
|
28
30
|
username = self.username
|
|
31
|
+
color = self.color
|
|
29
32
|
|
|
30
33
|
field_dict: Dict[str, Any] = {}
|
|
31
34
|
field_dict.update(self.additional_properties)
|
|
@@ -37,6 +40,8 @@ class CreateWorkspace:
|
|
|
37
40
|
)
|
|
38
41
|
if username is not UNSET:
|
|
39
42
|
field_dict["username"] = username
|
|
43
|
+
if color is not UNSET:
|
|
44
|
+
field_dict["color"] = color
|
|
40
45
|
|
|
41
46
|
return field_dict
|
|
42
47
|
|
|
@@ -49,10 +54,13 @@ class CreateWorkspace:
|
|
|
49
54
|
|
|
50
55
|
username = d.pop("username", UNSET)
|
|
51
56
|
|
|
57
|
+
color = d.pop("color", UNSET)
|
|
58
|
+
|
|
52
59
|
create_workspace = cls(
|
|
53
60
|
id=id,
|
|
54
61
|
name=name,
|
|
55
62
|
username=username,
|
|
63
|
+
color=color,
|
|
56
64
|
)
|
|
57
65
|
|
|
58
66
|
create_workspace.additional_properties = d
|
|
@@ -15,17 +15,20 @@ class CreateWorkspaceJsonBody:
|
|
|
15
15
|
id (str):
|
|
16
16
|
name (str):
|
|
17
17
|
username (Union[Unset, str]):
|
|
18
|
+
color (Union[Unset, str]):
|
|
18
19
|
"""
|
|
19
20
|
|
|
20
21
|
id: str
|
|
21
22
|
name: str
|
|
22
23
|
username: Union[Unset, str] = UNSET
|
|
24
|
+
color: Union[Unset, str] = UNSET
|
|
23
25
|
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
26
|
|
|
25
27
|
def to_dict(self) -> Dict[str, Any]:
|
|
26
28
|
id = self.id
|
|
27
29
|
name = self.name
|
|
28
30
|
username = self.username
|
|
31
|
+
color = self.color
|
|
29
32
|
|
|
30
33
|
field_dict: Dict[str, Any] = {}
|
|
31
34
|
field_dict.update(self.additional_properties)
|
|
@@ -37,6 +40,8 @@ class CreateWorkspaceJsonBody:
|
|
|
37
40
|
)
|
|
38
41
|
if username is not UNSET:
|
|
39
42
|
field_dict["username"] = username
|
|
43
|
+
if color is not UNSET:
|
|
44
|
+
field_dict["color"] = color
|
|
40
45
|
|
|
41
46
|
return field_dict
|
|
42
47
|
|
|
@@ -49,10 +54,13 @@ class CreateWorkspaceJsonBody:
|
|
|
49
54
|
|
|
50
55
|
username = d.pop("username", UNSET)
|
|
51
56
|
|
|
57
|
+
color = d.pop("color", UNSET)
|
|
58
|
+
|
|
52
59
|
create_workspace_json_body = cls(
|
|
53
60
|
id=id,
|
|
54
61
|
name=name,
|
|
55
62
|
username=username,
|
|
63
|
+
color=color,
|
|
56
64
|
)
|
|
57
65
|
|
|
58
66
|
create_workspace_json_body.additional_properties = d
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
|
2
|
+
|
|
3
|
+
from attrs import define as _attrs_define
|
|
4
|
+
from attrs import field as _attrs_field
|
|
5
|
+
|
|
6
|
+
from ..types import UNSET, Unset
|
|
7
|
+
|
|
8
|
+
T = TypeVar("T", bound="EditNatsTrigger")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@_attrs_define
|
|
12
|
+
class EditNatsTrigger:
|
|
13
|
+
"""
|
|
14
|
+
Attributes:
|
|
15
|
+
nats_resource_path (str):
|
|
16
|
+
use_jetstream (bool):
|
|
17
|
+
subjects (List[str]):
|
|
18
|
+
path (str):
|
|
19
|
+
script_path (str):
|
|
20
|
+
is_flow (bool):
|
|
21
|
+
stream_name (Union[Unset, str]):
|
|
22
|
+
consumer_name (Union[Unset, str]):
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
nats_resource_path: str
|
|
26
|
+
use_jetstream: bool
|
|
27
|
+
subjects: List[str]
|
|
28
|
+
path: str
|
|
29
|
+
script_path: str
|
|
30
|
+
is_flow: bool
|
|
31
|
+
stream_name: Union[Unset, str] = UNSET
|
|
32
|
+
consumer_name: Union[Unset, str] = UNSET
|
|
33
|
+
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
36
|
+
nats_resource_path = self.nats_resource_path
|
|
37
|
+
use_jetstream = self.use_jetstream
|
|
38
|
+
subjects = self.subjects
|
|
39
|
+
|
|
40
|
+
path = self.path
|
|
41
|
+
script_path = self.script_path
|
|
42
|
+
is_flow = self.is_flow
|
|
43
|
+
stream_name = self.stream_name
|
|
44
|
+
consumer_name = self.consumer_name
|
|
45
|
+
|
|
46
|
+
field_dict: Dict[str, Any] = {}
|
|
47
|
+
field_dict.update(self.additional_properties)
|
|
48
|
+
field_dict.update(
|
|
49
|
+
{
|
|
50
|
+
"nats_resource_path": nats_resource_path,
|
|
51
|
+
"use_jetstream": use_jetstream,
|
|
52
|
+
"subjects": subjects,
|
|
53
|
+
"path": path,
|
|
54
|
+
"script_path": script_path,
|
|
55
|
+
"is_flow": is_flow,
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
if stream_name is not UNSET:
|
|
59
|
+
field_dict["stream_name"] = stream_name
|
|
60
|
+
if consumer_name is not UNSET:
|
|
61
|
+
field_dict["consumer_name"] = consumer_name
|
|
62
|
+
|
|
63
|
+
return field_dict
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
67
|
+
d = src_dict.copy()
|
|
68
|
+
nats_resource_path = d.pop("nats_resource_path")
|
|
69
|
+
|
|
70
|
+
use_jetstream = d.pop("use_jetstream")
|
|
71
|
+
|
|
72
|
+
subjects = cast(List[str], d.pop("subjects"))
|
|
73
|
+
|
|
74
|
+
path = d.pop("path")
|
|
75
|
+
|
|
76
|
+
script_path = d.pop("script_path")
|
|
77
|
+
|
|
78
|
+
is_flow = d.pop("is_flow")
|
|
79
|
+
|
|
80
|
+
stream_name = d.pop("stream_name", UNSET)
|
|
81
|
+
|
|
82
|
+
consumer_name = d.pop("consumer_name", UNSET)
|
|
83
|
+
|
|
84
|
+
edit_nats_trigger = cls(
|
|
85
|
+
nats_resource_path=nats_resource_path,
|
|
86
|
+
use_jetstream=use_jetstream,
|
|
87
|
+
subjects=subjects,
|
|
88
|
+
path=path,
|
|
89
|
+
script_path=script_path,
|
|
90
|
+
is_flow=is_flow,
|
|
91
|
+
stream_name=stream_name,
|
|
92
|
+
consumer_name=consumer_name,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
edit_nats_trigger.additional_properties = d
|
|
96
|
+
return edit_nats_trigger
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def additional_keys(self) -> List[str]:
|
|
100
|
+
return list(self.additional_properties.keys())
|
|
101
|
+
|
|
102
|
+
def __getitem__(self, key: str) -> Any:
|
|
103
|
+
return self.additional_properties[key]
|
|
104
|
+
|
|
105
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
106
|
+
self.additional_properties[key] = value
|
|
107
|
+
|
|
108
|
+
def __delitem__(self, key: str) -> None:
|
|
109
|
+
del self.additional_properties[key]
|
|
110
|
+
|
|
111
|
+
def __contains__(self, key: str) -> bool:
|
|
112
|
+
return key in self.additional_properties
|
|
@@ -3,6 +3,8 @@ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
|
|
|
3
3
|
from attrs import define as _attrs_define
|
|
4
4
|
from attrs import field as _attrs_field
|
|
5
5
|
|
|
6
|
+
from ..types import UNSET, Unset
|
|
7
|
+
|
|
6
8
|
if TYPE_CHECKING:
|
|
7
9
|
from ..models.edit_websocket_trigger_filters_item import EditWebsocketTriggerFiltersItem
|
|
8
10
|
from ..models.edit_websocket_trigger_initial_messages_item_type_0 import (
|
|
@@ -26,9 +28,9 @@ class EditWebsocketTrigger:
|
|
|
26
28
|
script_path (str):
|
|
27
29
|
is_flow (bool):
|
|
28
30
|
filters (List['EditWebsocketTriggerFiltersItem']):
|
|
29
|
-
initial_messages (List[Union['EditWebsocketTriggerInitialMessagesItemType0',
|
|
30
|
-
'EditWebsocketTriggerInitialMessagesItemType1']]):
|
|
31
|
-
url_runnable_args (EditWebsocketTriggerUrlRunnableArgs):
|
|
31
|
+
initial_messages (Union[Unset, List[Union['EditWebsocketTriggerInitialMessagesItemType0',
|
|
32
|
+
'EditWebsocketTriggerInitialMessagesItemType1']]]):
|
|
33
|
+
url_runnable_args (Union[Unset, EditWebsocketTriggerUrlRunnableArgs]):
|
|
32
34
|
"""
|
|
33
35
|
|
|
34
36
|
url: str
|
|
@@ -36,10 +38,11 @@ class EditWebsocketTrigger:
|
|
|
36
38
|
script_path: str
|
|
37
39
|
is_flow: bool
|
|
38
40
|
filters: List["EditWebsocketTriggerFiltersItem"]
|
|
39
|
-
initial_messages:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
initial_messages: Union[
|
|
42
|
+
Unset,
|
|
43
|
+
List[Union["EditWebsocketTriggerInitialMessagesItemType0", "EditWebsocketTriggerInitialMessagesItemType1"]],
|
|
44
|
+
] = UNSET
|
|
45
|
+
url_runnable_args: Union[Unset, "EditWebsocketTriggerUrlRunnableArgs"] = UNSET
|
|
43
46
|
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
44
47
|
|
|
45
48
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -57,19 +60,23 @@ class EditWebsocketTrigger:
|
|
|
57
60
|
|
|
58
61
|
filters.append(filters_item)
|
|
59
62
|
|
|
60
|
-
initial_messages
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
initial_messages: Union[Unset, List[Dict[str, Any]]] = UNSET
|
|
64
|
+
if not isinstance(self.initial_messages, Unset):
|
|
65
|
+
initial_messages = []
|
|
66
|
+
for initial_messages_item_data in self.initial_messages:
|
|
67
|
+
initial_messages_item: Dict[str, Any]
|
|
63
68
|
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
if isinstance(initial_messages_item_data, EditWebsocketTriggerInitialMessagesItemType0):
|
|
70
|
+
initial_messages_item = initial_messages_item_data.to_dict()
|
|
66
71
|
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
else:
|
|
73
|
+
initial_messages_item = initial_messages_item_data.to_dict()
|
|
69
74
|
|
|
70
|
-
|
|
75
|
+
initial_messages.append(initial_messages_item)
|
|
71
76
|
|
|
72
|
-
url_runnable_args =
|
|
77
|
+
url_runnable_args: Union[Unset, Dict[str, Any]] = UNSET
|
|
78
|
+
if not isinstance(self.url_runnable_args, Unset):
|
|
79
|
+
url_runnable_args = self.url_runnable_args.to_dict()
|
|
73
80
|
|
|
74
81
|
field_dict: Dict[str, Any] = {}
|
|
75
82
|
field_dict.update(self.additional_properties)
|
|
@@ -80,10 +87,12 @@ class EditWebsocketTrigger:
|
|
|
80
87
|
"script_path": script_path,
|
|
81
88
|
"is_flow": is_flow,
|
|
82
89
|
"filters": filters,
|
|
83
|
-
"initial_messages": initial_messages,
|
|
84
|
-
"url_runnable_args": url_runnable_args,
|
|
85
90
|
}
|
|
86
91
|
)
|
|
92
|
+
if initial_messages is not UNSET:
|
|
93
|
+
field_dict["initial_messages"] = initial_messages
|
|
94
|
+
if url_runnable_args is not UNSET:
|
|
95
|
+
field_dict["url_runnable_args"] = url_runnable_args
|
|
87
96
|
|
|
88
97
|
return field_dict
|
|
89
98
|
|
|
@@ -115,8 +124,8 @@ class EditWebsocketTrigger:
|
|
|
115
124
|
filters.append(filters_item)
|
|
116
125
|
|
|
117
126
|
initial_messages = []
|
|
118
|
-
_initial_messages = d.pop("initial_messages")
|
|
119
|
-
for initial_messages_item_data in _initial_messages:
|
|
127
|
+
_initial_messages = d.pop("initial_messages", UNSET)
|
|
128
|
+
for initial_messages_item_data in _initial_messages or []:
|
|
120
129
|
|
|
121
130
|
def _parse_initial_messages_item(
|
|
122
131
|
data: object,
|
|
@@ -139,7 +148,12 @@ class EditWebsocketTrigger:
|
|
|
139
148
|
|
|
140
149
|
initial_messages.append(initial_messages_item)
|
|
141
150
|
|
|
142
|
-
|
|
151
|
+
_url_runnable_args = d.pop("url_runnable_args", UNSET)
|
|
152
|
+
url_runnable_args: Union[Unset, EditWebsocketTriggerUrlRunnableArgs]
|
|
153
|
+
if isinstance(_url_runnable_args, Unset):
|
|
154
|
+
url_runnable_args = UNSET
|
|
155
|
+
else:
|
|
156
|
+
url_runnable_args = EditWebsocketTriggerUrlRunnableArgs.from_dict(_url_runnable_args)
|
|
143
157
|
|
|
144
158
|
edit_websocket_trigger = cls(
|
|
145
159
|
url=url,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from typing import Any, Dict, List, Type, TypeVar, Union
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
from dateutil.parser import isoparse
|
|
7
|
+
|
|
8
|
+
from ..models.get_capture_configs_response_200_item_trigger_kind import GetCaptureConfigsResponse200ItemTriggerKind
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="GetCaptureConfigsResponse200Item")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class GetCaptureConfigsResponse200Item:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
trigger_kind (GetCaptureConfigsResponse200ItemTriggerKind):
|
|
19
|
+
trigger_config (Union[Unset, Any]):
|
|
20
|
+
error (Union[Unset, str]):
|
|
21
|
+
last_server_ping (Union[Unset, datetime.datetime]):
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
trigger_kind: GetCaptureConfigsResponse200ItemTriggerKind
|
|
25
|
+
trigger_config: Union[Unset, Any] = UNSET
|
|
26
|
+
error: Union[Unset, str] = UNSET
|
|
27
|
+
last_server_ping: Union[Unset, datetime.datetime] = UNSET
|
|
28
|
+
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
31
|
+
trigger_kind = self.trigger_kind.value
|
|
32
|
+
|
|
33
|
+
trigger_config = self.trigger_config
|
|
34
|
+
error = self.error
|
|
35
|
+
last_server_ping: Union[Unset, str] = UNSET
|
|
36
|
+
if not isinstance(self.last_server_ping, Unset):
|
|
37
|
+
last_server_ping = self.last_server_ping.isoformat()
|
|
38
|
+
|
|
39
|
+
field_dict: Dict[str, Any] = {}
|
|
40
|
+
field_dict.update(self.additional_properties)
|
|
41
|
+
field_dict.update(
|
|
42
|
+
{
|
|
43
|
+
"trigger_kind": trigger_kind,
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
if trigger_config is not UNSET:
|
|
47
|
+
field_dict["trigger_config"] = trigger_config
|
|
48
|
+
if error is not UNSET:
|
|
49
|
+
field_dict["error"] = error
|
|
50
|
+
if last_server_ping is not UNSET:
|
|
51
|
+
field_dict["last_server_ping"] = last_server_ping
|
|
52
|
+
|
|
53
|
+
return field_dict
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
57
|
+
d = src_dict.copy()
|
|
58
|
+
trigger_kind = GetCaptureConfigsResponse200ItemTriggerKind(d.pop("trigger_kind"))
|
|
59
|
+
|
|
60
|
+
trigger_config = d.pop("trigger_config", UNSET)
|
|
61
|
+
|
|
62
|
+
error = d.pop("error", UNSET)
|
|
63
|
+
|
|
64
|
+
_last_server_ping = d.pop("last_server_ping", UNSET)
|
|
65
|
+
last_server_ping: Union[Unset, datetime.datetime]
|
|
66
|
+
if isinstance(_last_server_ping, Unset):
|
|
67
|
+
last_server_ping = UNSET
|
|
68
|
+
else:
|
|
69
|
+
last_server_ping = isoparse(_last_server_ping)
|
|
70
|
+
|
|
71
|
+
get_capture_configs_response_200_item = cls(
|
|
72
|
+
trigger_kind=trigger_kind,
|
|
73
|
+
trigger_config=trigger_config,
|
|
74
|
+
error=error,
|
|
75
|
+
last_server_ping=last_server_ping,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
get_capture_configs_response_200_item.additional_properties = d
|
|
79
|
+
return get_capture_configs_response_200_item
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def additional_keys(self) -> List[str]:
|
|
83
|
+
return list(self.additional_properties.keys())
|
|
84
|
+
|
|
85
|
+
def __getitem__(self, key: str) -> Any:
|
|
86
|
+
return self.additional_properties[key]
|
|
87
|
+
|
|
88
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
89
|
+
self.additional_properties[key] = value
|
|
90
|
+
|
|
91
|
+
def __delitem__(self, key: str) -> None:
|
|
92
|
+
del self.additional_properties[key]
|
|
93
|
+
|
|
94
|
+
def __contains__(self, key: str) -> bool:
|
|
95
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class GetCaptureConfigsResponse200ItemTriggerKind(str, Enum):
|
|
5
|
+
EMAIL = "email"
|
|
6
|
+
HTTP = "http"
|
|
7
|
+
KAFKA = "kafka"
|
|
8
|
+
NATS = "nats"
|
|
9
|
+
WEBHOOK = "webhook"
|
|
10
|
+
WEBSOCKET = "websocket"
|
|
11
|
+
|
|
12
|
+
def __str__(self) -> str:
|
|
13
|
+
return str(self.value)
|