windmill-api 1.442.0__py3-none-any.whl → 1.444.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/{create_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/{update_capture.py → ping_capture_config.py} +22 -4
- windmill_api/api/capture/{get_capture.py → set_capture_config.py} +16 -14
- windmill_api/api/job/get_slack_approval_payload.py +8 -8
- windmill_api/models/capture.py +94 -0
- windmill_api/models/capture_config.py +95 -0
- windmill_api/models/capture_config_trigger_kind.py +12 -0
- windmill_api/models/capture_trigger_kind.py +12 -0
- windmill_api/models/create_websocket_trigger_json_body.py +42 -29
- 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 +12 -0
- windmill_api/models/get_capture_configs_runnable_kind.py +9 -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 +12 -0
- windmill_api/models/list_captures_runnable_kind.py +9 -0
- windmill_api/models/list_captures_trigger_kind.py +12 -0
- windmill_api/models/list_websocket_triggers_response_200_item.py +54 -41
- 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 +12 -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 +12 -0
- windmill_api/models/update_websocket_trigger_json_body.py +40 -24
- windmill_api/models/websocket_trigger.py +48 -38
- {windmill_api-1.442.0.dist-info → windmill_api-1.444.0.dist-info}/METADATA +1 -1
- {windmill_api-1.442.0.dist-info → windmill_api-1.444.0.dist-info}/RECORD +33 -15
- {windmill_api-1.442.0.dist-info → windmill_api-1.444.0.dist-info}/LICENSE +0 -0
- {windmill_api-1.442.0.dist-info → windmill_api-1.444.0.dist-info}/WHEEL +0 -0
|
@@ -18,7 +18,7 @@ def _get_kwargs(
|
|
|
18
18
|
channel_id: str,
|
|
19
19
|
flow_step_id: str,
|
|
20
20
|
default_args_json: Union[Unset, None, str] = UNSET,
|
|
21
|
-
|
|
21
|
+
dynamic_enums_json: Union[Unset, None, str] = UNSET,
|
|
22
22
|
) -> Dict[str, Any]:
|
|
23
23
|
pass
|
|
24
24
|
|
|
@@ -35,7 +35,7 @@ def _get_kwargs(
|
|
|
35
35
|
|
|
36
36
|
params["default_args_json"] = default_args_json
|
|
37
37
|
|
|
38
|
-
params["
|
|
38
|
+
params["dynamic_enums_json"] = dynamic_enums_json
|
|
39
39
|
|
|
40
40
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
41
41
|
|
|
@@ -78,7 +78,7 @@ def sync_detailed(
|
|
|
78
78
|
channel_id: str,
|
|
79
79
|
flow_step_id: str,
|
|
80
80
|
default_args_json: Union[Unset, None, str] = UNSET,
|
|
81
|
-
|
|
81
|
+
dynamic_enums_json: Union[Unset, None, str] = UNSET,
|
|
82
82
|
) -> Response[Any]:
|
|
83
83
|
"""generate interactive slack approval for suspended job
|
|
84
84
|
|
|
@@ -91,7 +91,7 @@ def sync_detailed(
|
|
|
91
91
|
channel_id (str):
|
|
92
92
|
flow_step_id (str):
|
|
93
93
|
default_args_json (Union[Unset, None, str]):
|
|
94
|
-
|
|
94
|
+
dynamic_enums_json (Union[Unset, None, str]):
|
|
95
95
|
|
|
96
96
|
Raises:
|
|
97
97
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -110,7 +110,7 @@ def sync_detailed(
|
|
|
110
110
|
channel_id=channel_id,
|
|
111
111
|
flow_step_id=flow_step_id,
|
|
112
112
|
default_args_json=default_args_json,
|
|
113
|
-
|
|
113
|
+
dynamic_enums_json=dynamic_enums_json,
|
|
114
114
|
)
|
|
115
115
|
|
|
116
116
|
response = client.get_httpx_client().request(
|
|
@@ -131,7 +131,7 @@ async def asyncio_detailed(
|
|
|
131
131
|
channel_id: str,
|
|
132
132
|
flow_step_id: str,
|
|
133
133
|
default_args_json: Union[Unset, None, str] = UNSET,
|
|
134
|
-
|
|
134
|
+
dynamic_enums_json: Union[Unset, None, str] = UNSET,
|
|
135
135
|
) -> Response[Any]:
|
|
136
136
|
"""generate interactive slack approval for suspended job
|
|
137
137
|
|
|
@@ -144,7 +144,7 @@ async def asyncio_detailed(
|
|
|
144
144
|
channel_id (str):
|
|
145
145
|
flow_step_id (str):
|
|
146
146
|
default_args_json (Union[Unset, None, str]):
|
|
147
|
-
|
|
147
|
+
dynamic_enums_json (Union[Unset, None, str]):
|
|
148
148
|
|
|
149
149
|
Raises:
|
|
150
150
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -163,7 +163,7 @@ async def asyncio_detailed(
|
|
|
163
163
|
channel_id=channel_id,
|
|
164
164
|
flow_step_id=flow_step_id,
|
|
165
165
|
default_args_json=default_args_json,
|
|
166
|
-
|
|
166
|
+
dynamic_enums_json=dynamic_enums_json,
|
|
167
167
|
)
|
|
168
168
|
|
|
169
169
|
response = await client.get_async_httpx_client().request(**kwargs)
|
|
@@ -0,0 +1,94 @@
|
|
|
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.capture_trigger_kind import CaptureTriggerKind
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="Capture")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class Capture:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
trigger_kind (CaptureTriggerKind):
|
|
19
|
+
payload (Any):
|
|
20
|
+
id (int):
|
|
21
|
+
created_at (datetime.datetime):
|
|
22
|
+
trigger_extra (Union[Unset, Any]):
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
trigger_kind: CaptureTriggerKind
|
|
26
|
+
payload: Any
|
|
27
|
+
id: int
|
|
28
|
+
created_at: datetime.datetime
|
|
29
|
+
trigger_extra: Union[Unset, Any] = UNSET
|
|
30
|
+
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
33
|
+
trigger_kind = self.trigger_kind.value
|
|
34
|
+
|
|
35
|
+
payload = self.payload
|
|
36
|
+
id = self.id
|
|
37
|
+
created_at = self.created_at.isoformat()
|
|
38
|
+
|
|
39
|
+
trigger_extra = self.trigger_extra
|
|
40
|
+
|
|
41
|
+
field_dict: Dict[str, Any] = {}
|
|
42
|
+
field_dict.update(self.additional_properties)
|
|
43
|
+
field_dict.update(
|
|
44
|
+
{
|
|
45
|
+
"trigger_kind": trigger_kind,
|
|
46
|
+
"payload": payload,
|
|
47
|
+
"id": id,
|
|
48
|
+
"created_at": created_at,
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
if trigger_extra is not UNSET:
|
|
52
|
+
field_dict["trigger_extra"] = trigger_extra
|
|
53
|
+
|
|
54
|
+
return field_dict
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
58
|
+
d = src_dict.copy()
|
|
59
|
+
trigger_kind = CaptureTriggerKind(d.pop("trigger_kind"))
|
|
60
|
+
|
|
61
|
+
payload = d.pop("payload")
|
|
62
|
+
|
|
63
|
+
id = d.pop("id")
|
|
64
|
+
|
|
65
|
+
created_at = isoparse(d.pop("created_at"))
|
|
66
|
+
|
|
67
|
+
trigger_extra = d.pop("trigger_extra", UNSET)
|
|
68
|
+
|
|
69
|
+
capture = cls(
|
|
70
|
+
trigger_kind=trigger_kind,
|
|
71
|
+
payload=payload,
|
|
72
|
+
id=id,
|
|
73
|
+
created_at=created_at,
|
|
74
|
+
trigger_extra=trigger_extra,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
capture.additional_properties = d
|
|
78
|
+
return capture
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def additional_keys(self) -> List[str]:
|
|
82
|
+
return list(self.additional_properties.keys())
|
|
83
|
+
|
|
84
|
+
def __getitem__(self, key: str) -> Any:
|
|
85
|
+
return self.additional_properties[key]
|
|
86
|
+
|
|
87
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
88
|
+
self.additional_properties[key] = value
|
|
89
|
+
|
|
90
|
+
def __delitem__(self, key: str) -> None:
|
|
91
|
+
del self.additional_properties[key]
|
|
92
|
+
|
|
93
|
+
def __contains__(self, key: str) -> bool:
|
|
94
|
+
return key in self.additional_properties
|
|
@@ -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.capture_config_trigger_kind import CaptureConfigTriggerKind
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="CaptureConfig")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class CaptureConfig:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
trigger_kind (CaptureConfigTriggerKind):
|
|
19
|
+
trigger_config (Union[Unset, Any]):
|
|
20
|
+
error (Union[Unset, str]):
|
|
21
|
+
last_server_ping (Union[Unset, datetime.datetime]):
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
trigger_kind: CaptureConfigTriggerKind
|
|
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 = CaptureConfigTriggerKind(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
|
+
capture_config = cls(
|
|
72
|
+
trigger_kind=trigger_kind,
|
|
73
|
+
trigger_config=trigger_config,
|
|
74
|
+
error=error,
|
|
75
|
+
last_server_ping=last_server_ping,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
capture_config.additional_properties = d
|
|
79
|
+
return capture_config
|
|
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
|
|
@@ -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
|
|
@@ -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
|