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,113 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.set_nats_trigger_enabled_json_body import SetNatsTriggerEnabledJsonBody
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
workspace: str,
|
|
14
|
+
path: str,
|
|
15
|
+
*,
|
|
16
|
+
json_body: SetNatsTriggerEnabledJsonBody,
|
|
17
|
+
) -> Dict[str, Any]:
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
json_json_body = json_body.to_dict()
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
"method": "post",
|
|
24
|
+
"url": "/w/{workspace}/nats_triggers/setenabled/{path}".format(
|
|
25
|
+
workspace=workspace,
|
|
26
|
+
path=path,
|
|
27
|
+
),
|
|
28
|
+
"json": json_json_body,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
|
33
|
+
if client.raise_on_unexpected_status:
|
|
34
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
35
|
+
else:
|
|
36
|
+
return None
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
|
40
|
+
return Response(
|
|
41
|
+
status_code=HTTPStatus(response.status_code),
|
|
42
|
+
content=response.content,
|
|
43
|
+
headers=response.headers,
|
|
44
|
+
parsed=_parse_response(client=client, response=response),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def sync_detailed(
|
|
49
|
+
workspace: str,
|
|
50
|
+
path: str,
|
|
51
|
+
*,
|
|
52
|
+
client: Union[AuthenticatedClient, Client],
|
|
53
|
+
json_body: SetNatsTriggerEnabledJsonBody,
|
|
54
|
+
) -> Response[Any]:
|
|
55
|
+
"""set enabled nats trigger
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
workspace (str):
|
|
59
|
+
path (str):
|
|
60
|
+
json_body (SetNatsTriggerEnabledJsonBody):
|
|
61
|
+
|
|
62
|
+
Raises:
|
|
63
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
64
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
Response[Any]
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
kwargs = _get_kwargs(
|
|
71
|
+
workspace=workspace,
|
|
72
|
+
path=path,
|
|
73
|
+
json_body=json_body,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
response = client.get_httpx_client().request(
|
|
77
|
+
**kwargs,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return _build_response(client=client, response=response)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
async def asyncio_detailed(
|
|
84
|
+
workspace: str,
|
|
85
|
+
path: str,
|
|
86
|
+
*,
|
|
87
|
+
client: Union[AuthenticatedClient, Client],
|
|
88
|
+
json_body: SetNatsTriggerEnabledJsonBody,
|
|
89
|
+
) -> Response[Any]:
|
|
90
|
+
"""set enabled nats trigger
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
workspace (str):
|
|
94
|
+
path (str):
|
|
95
|
+
json_body (SetNatsTriggerEnabledJsonBody):
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Response[Any]
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
kwargs = _get_kwargs(
|
|
106
|
+
workspace=workspace,
|
|
107
|
+
path=path,
|
|
108
|
+
json_body=json_body,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
112
|
+
|
|
113
|
+
return _build_response(client=client, response=response)
|
|
@@ -5,29 +5,31 @@ import httpx
|
|
|
5
5
|
|
|
6
6
|
from ... import errors
|
|
7
7
|
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.update_nats_trigger_json_body import UpdateNatsTriggerJsonBody
|
|
8
9
|
from ...types import Response
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
def _get_kwargs(
|
|
12
13
|
workspace: str,
|
|
13
14
|
path: str,
|
|
15
|
+
*,
|
|
16
|
+
json_body: UpdateNatsTriggerJsonBody,
|
|
14
17
|
) -> Dict[str, Any]:
|
|
15
18
|
pass
|
|
16
19
|
|
|
20
|
+
json_json_body = json_body.to_dict()
|
|
21
|
+
|
|
17
22
|
return {
|
|
18
|
-
"method": "
|
|
19
|
-
"url": "/w/{workspace}/
|
|
23
|
+
"method": "post",
|
|
24
|
+
"url": "/w/{workspace}/nats_triggers/update/{path}".format(
|
|
20
25
|
workspace=workspace,
|
|
21
26
|
path=path,
|
|
22
27
|
),
|
|
28
|
+
"json": json_json_body,
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
|
|
26
32
|
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
|
27
|
-
if response.status_code == HTTPStatus.OK:
|
|
28
|
-
return None
|
|
29
|
-
if response.status_code == HTTPStatus.NOT_FOUND:
|
|
30
|
-
return None
|
|
31
33
|
if client.raise_on_unexpected_status:
|
|
32
34
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
33
35
|
else:
|
|
@@ -48,12 +50,14 @@ def sync_detailed(
|
|
|
48
50
|
path: str,
|
|
49
51
|
*,
|
|
50
52
|
client: Union[AuthenticatedClient, Client],
|
|
53
|
+
json_body: UpdateNatsTriggerJsonBody,
|
|
51
54
|
) -> Response[Any]:
|
|
52
|
-
"""
|
|
55
|
+
"""update nats trigger
|
|
53
56
|
|
|
54
57
|
Args:
|
|
55
58
|
workspace (str):
|
|
56
59
|
path (str):
|
|
60
|
+
json_body (UpdateNatsTriggerJsonBody):
|
|
57
61
|
|
|
58
62
|
Raises:
|
|
59
63
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -66,6 +70,7 @@ def sync_detailed(
|
|
|
66
70
|
kwargs = _get_kwargs(
|
|
67
71
|
workspace=workspace,
|
|
68
72
|
path=path,
|
|
73
|
+
json_body=json_body,
|
|
69
74
|
)
|
|
70
75
|
|
|
71
76
|
response = client.get_httpx_client().request(
|
|
@@ -80,12 +85,14 @@ async def asyncio_detailed(
|
|
|
80
85
|
path: str,
|
|
81
86
|
*,
|
|
82
87
|
client: Union[AuthenticatedClient, Client],
|
|
88
|
+
json_body: UpdateNatsTriggerJsonBody,
|
|
83
89
|
) -> Response[Any]:
|
|
84
|
-
"""
|
|
90
|
+
"""update nats trigger
|
|
85
91
|
|
|
86
92
|
Args:
|
|
87
93
|
workspace (str):
|
|
88
94
|
path (str):
|
|
95
|
+
json_body (UpdateNatsTriggerJsonBody):
|
|
89
96
|
|
|
90
97
|
Raises:
|
|
91
98
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -98,6 +105,7 @@ async def asyncio_detailed(
|
|
|
98
105
|
kwargs = _get_kwargs(
|
|
99
106
|
workspace=workspace,
|
|
100
107
|
path=path,
|
|
108
|
+
json_body=json_body,
|
|
101
109
|
)
|
|
102
110
|
|
|
103
111
|
response = await client.get_async_httpx_client().request(**kwargs)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Dict, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.change_workspace_color_json_body import ChangeWorkspaceColorJsonBody
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
workspace: str,
|
|
14
|
+
*,
|
|
15
|
+
json_body: ChangeWorkspaceColorJsonBody,
|
|
16
|
+
) -> Dict[str, Any]:
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
json_json_body = json_body.to_dict()
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
"method": "post",
|
|
23
|
+
"url": "/w/{workspace}/workspaces/change_workspace_color".format(
|
|
24
|
+
workspace=workspace,
|
|
25
|
+
),
|
|
26
|
+
"json": json_json_body,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
|
31
|
+
if client.raise_on_unexpected_status:
|
|
32
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
33
|
+
else:
|
|
34
|
+
return None
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
|
|
38
|
+
return Response(
|
|
39
|
+
status_code=HTTPStatus(response.status_code),
|
|
40
|
+
content=response.content,
|
|
41
|
+
headers=response.headers,
|
|
42
|
+
parsed=_parse_response(client=client, response=response),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def sync_detailed(
|
|
47
|
+
workspace: str,
|
|
48
|
+
*,
|
|
49
|
+
client: Union[AuthenticatedClient, Client],
|
|
50
|
+
json_body: ChangeWorkspaceColorJsonBody,
|
|
51
|
+
) -> Response[Any]:
|
|
52
|
+
"""change workspace id
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
workspace (str):
|
|
56
|
+
json_body (ChangeWorkspaceColorJsonBody):
|
|
57
|
+
|
|
58
|
+
Raises:
|
|
59
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
60
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
Response[Any]
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
kwargs = _get_kwargs(
|
|
67
|
+
workspace=workspace,
|
|
68
|
+
json_body=json_body,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
response = client.get_httpx_client().request(
|
|
72
|
+
**kwargs,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
return _build_response(client=client, response=response)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
async def asyncio_detailed(
|
|
79
|
+
workspace: str,
|
|
80
|
+
*,
|
|
81
|
+
client: Union[AuthenticatedClient, Client],
|
|
82
|
+
json_body: ChangeWorkspaceColorJsonBody,
|
|
83
|
+
) -> Response[Any]:
|
|
84
|
+
"""change workspace id
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
workspace (str):
|
|
88
|
+
json_body (ChangeWorkspaceColorJsonBody):
|
|
89
|
+
|
|
90
|
+
Raises:
|
|
91
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
92
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
Response[Any]
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
kwargs = _get_kwargs(
|
|
99
|
+
workspace=workspace,
|
|
100
|
+
json_body=json_body,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
104
|
+
|
|
105
|
+
return _build_response(client=client, response=response)
|
|
@@ -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
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from typing import Any, Dict, List, Type, TypeVar, Union
|
|
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="ChangeWorkspaceColorJsonBody")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@_attrs_define
|
|
12
|
+
class ChangeWorkspaceColorJsonBody:
|
|
13
|
+
"""
|
|
14
|
+
Attributes:
|
|
15
|
+
color (Union[Unset, str]):
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
color: Union[Unset, str] = UNSET
|
|
19
|
+
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
20
|
+
|
|
21
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
22
|
+
color = self.color
|
|
23
|
+
|
|
24
|
+
field_dict: Dict[str, Any] = {}
|
|
25
|
+
field_dict.update(self.additional_properties)
|
|
26
|
+
field_dict.update({})
|
|
27
|
+
if color is not UNSET:
|
|
28
|
+
field_dict["color"] = color
|
|
29
|
+
|
|
30
|
+
return field_dict
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
34
|
+
d = src_dict.copy()
|
|
35
|
+
color = d.pop("color", UNSET)
|
|
36
|
+
|
|
37
|
+
change_workspace_color_json_body = cls(
|
|
38
|
+
color=color,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
change_workspace_color_json_body.additional_properties = d
|
|
42
|
+
return change_workspace_color_json_body
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def additional_keys(self) -> List[str]:
|
|
46
|
+
return list(self.additional_properties.keys())
|
|
47
|
+
|
|
48
|
+
def __getitem__(self, key: str) -> Any:
|
|
49
|
+
return self.additional_properties[key]
|
|
50
|
+
|
|
51
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
52
|
+
self.additional_properties[key] = value
|
|
53
|
+
|
|
54
|
+
def __delitem__(self, key: str) -> None:
|
|
55
|
+
del self.additional_properties[key]
|
|
56
|
+
|
|
57
|
+
def __contains__(self, key: str) -> bool:
|
|
58
|
+
return key in self.additional_properties
|