windmill-api 1.423.2__py3-none-any.whl → 1.425.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.

Files changed (27) hide show
  1. windmill_api/api/job/count_completed_jobs.py +211 -0
  2. windmill_api/api/setting/workspace_acknowledge_all_critical_alerts.py +146 -0
  3. windmill_api/api/setting/workspace_acknowledge_critical_alert.py +160 -0
  4. windmill_api/api/setting/workspace_get_critical_alerts.py +219 -0
  5. windmill_api/api/setting/workspace_mute_critical_alerts_ui.py +164 -0
  6. windmill_api/api/user/set_login_type_for_user.py +105 -0
  7. windmill_api/api/user/set_password_for_user.py +105 -0
  8. windmill_api/api/worker/get_counts_of_jobs_waiting_per_tag.py +126 -0
  9. windmill_api/models/ai_resource.py +65 -0
  10. windmill_api/models/audit_log_operation.py +1 -1
  11. windmill_api/models/critical_alert.py +8 -0
  12. windmill_api/models/edit_copilot_config_json_body.py +21 -8
  13. windmill_api/models/edit_copilot_config_json_body_ai_resource.py +65 -0
  14. windmill_api/models/get_audit_log_response_200_operation.py +1 -1
  15. windmill_api/models/get_counts_of_jobs_waiting_per_tag_response_200.py +44 -0
  16. windmill_api/models/get_critical_alerts_response_200_item.py +8 -0
  17. windmill_api/models/get_settings_response_200.py +26 -7
  18. windmill_api/models/get_settings_response_200_ai_resource.py +65 -0
  19. windmill_api/models/list_audit_logs_response_200_item_operation.py +1 -1
  20. windmill_api/models/set_login_type_for_user_json_body.py +58 -0
  21. windmill_api/models/set_password_for_user_json_body.py +58 -0
  22. windmill_api/models/workspace_get_critical_alerts_response_200_item.py +109 -0
  23. windmill_api/models/workspace_mute_critical_alerts_ui_json_body.py +58 -0
  24. {windmill_api-1.423.2.dist-info → windmill_api-1.425.0.dist-info}/METADATA +1 -1
  25. {windmill_api-1.423.2.dist-info → windmill_api-1.425.0.dist-info}/RECORD +27 -11
  26. {windmill_api-1.423.2.dist-info → windmill_api-1.425.0.dist-info}/LICENSE +0 -0
  27. {windmill_api-1.423.2.dist-info → windmill_api-1.425.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,211 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import UNSET, Response, Unset
9
+
10
+
11
+ def _get_kwargs(
12
+ workspace: str,
13
+ *,
14
+ completed_after_s_ago: Union[Unset, None, int] = UNSET,
15
+ success: Union[Unset, None, bool] = UNSET,
16
+ tags: Union[Unset, None, str] = UNSET,
17
+ all_workspaces: Union[Unset, None, bool] = UNSET,
18
+ ) -> Dict[str, Any]:
19
+ pass
20
+
21
+ params: Dict[str, Any] = {}
22
+ params["completed_after_s_ago"] = completed_after_s_ago
23
+
24
+ params["success"] = success
25
+
26
+ params["tags"] = tags
27
+
28
+ params["all_workspaces"] = all_workspaces
29
+
30
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
31
+
32
+ return {
33
+ "method": "get",
34
+ "url": "/w/{workspace}/jobs/completed/count_jobs".format(
35
+ workspace=workspace,
36
+ ),
37
+ "params": params,
38
+ }
39
+
40
+
41
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[int]:
42
+ if response.status_code == HTTPStatus.OK:
43
+ response_200 = cast(int, response.json())
44
+ return response_200
45
+ if client.raise_on_unexpected_status:
46
+ raise errors.UnexpectedStatus(response.status_code, response.content)
47
+ else:
48
+ return None
49
+
50
+
51
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[int]:
52
+ return Response(
53
+ status_code=HTTPStatus(response.status_code),
54
+ content=response.content,
55
+ headers=response.headers,
56
+ parsed=_parse_response(client=client, response=response),
57
+ )
58
+
59
+
60
+ def sync_detailed(
61
+ workspace: str,
62
+ *,
63
+ client: Union[AuthenticatedClient, Client],
64
+ completed_after_s_ago: Union[Unset, None, int] = UNSET,
65
+ success: Union[Unset, None, bool] = UNSET,
66
+ tags: Union[Unset, None, str] = UNSET,
67
+ all_workspaces: Union[Unset, None, bool] = UNSET,
68
+ ) -> Response[int]:
69
+ """count number of completed jobs with filter
70
+
71
+ Args:
72
+ workspace (str):
73
+ completed_after_s_ago (Union[Unset, None, int]):
74
+ success (Union[Unset, None, bool]):
75
+ tags (Union[Unset, None, str]):
76
+ all_workspaces (Union[Unset, None, bool]):
77
+
78
+ Raises:
79
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
80
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
81
+
82
+ Returns:
83
+ Response[int]
84
+ """
85
+
86
+ kwargs = _get_kwargs(
87
+ workspace=workspace,
88
+ completed_after_s_ago=completed_after_s_ago,
89
+ success=success,
90
+ tags=tags,
91
+ all_workspaces=all_workspaces,
92
+ )
93
+
94
+ response = client.get_httpx_client().request(
95
+ **kwargs,
96
+ )
97
+
98
+ return _build_response(client=client, response=response)
99
+
100
+
101
+ def sync(
102
+ workspace: str,
103
+ *,
104
+ client: Union[AuthenticatedClient, Client],
105
+ completed_after_s_ago: Union[Unset, None, int] = UNSET,
106
+ success: Union[Unset, None, bool] = UNSET,
107
+ tags: Union[Unset, None, str] = UNSET,
108
+ all_workspaces: Union[Unset, None, bool] = UNSET,
109
+ ) -> Optional[int]:
110
+ """count number of completed jobs with filter
111
+
112
+ Args:
113
+ workspace (str):
114
+ completed_after_s_ago (Union[Unset, None, int]):
115
+ success (Union[Unset, None, bool]):
116
+ tags (Union[Unset, None, str]):
117
+ all_workspaces (Union[Unset, None, bool]):
118
+
119
+ Raises:
120
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
121
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
122
+
123
+ Returns:
124
+ int
125
+ """
126
+
127
+ return sync_detailed(
128
+ workspace=workspace,
129
+ client=client,
130
+ completed_after_s_ago=completed_after_s_ago,
131
+ success=success,
132
+ tags=tags,
133
+ all_workspaces=all_workspaces,
134
+ ).parsed
135
+
136
+
137
+ async def asyncio_detailed(
138
+ workspace: str,
139
+ *,
140
+ client: Union[AuthenticatedClient, Client],
141
+ completed_after_s_ago: Union[Unset, None, int] = UNSET,
142
+ success: Union[Unset, None, bool] = UNSET,
143
+ tags: Union[Unset, None, str] = UNSET,
144
+ all_workspaces: Union[Unset, None, bool] = UNSET,
145
+ ) -> Response[int]:
146
+ """count number of completed jobs with filter
147
+
148
+ Args:
149
+ workspace (str):
150
+ completed_after_s_ago (Union[Unset, None, int]):
151
+ success (Union[Unset, None, bool]):
152
+ tags (Union[Unset, None, str]):
153
+ all_workspaces (Union[Unset, None, bool]):
154
+
155
+ Raises:
156
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
157
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
158
+
159
+ Returns:
160
+ Response[int]
161
+ """
162
+
163
+ kwargs = _get_kwargs(
164
+ workspace=workspace,
165
+ completed_after_s_ago=completed_after_s_ago,
166
+ success=success,
167
+ tags=tags,
168
+ all_workspaces=all_workspaces,
169
+ )
170
+
171
+ response = await client.get_async_httpx_client().request(**kwargs)
172
+
173
+ return _build_response(client=client, response=response)
174
+
175
+
176
+ async def asyncio(
177
+ workspace: str,
178
+ *,
179
+ client: Union[AuthenticatedClient, Client],
180
+ completed_after_s_ago: Union[Unset, None, int] = UNSET,
181
+ success: Union[Unset, None, bool] = UNSET,
182
+ tags: Union[Unset, None, str] = UNSET,
183
+ all_workspaces: Union[Unset, None, bool] = UNSET,
184
+ ) -> Optional[int]:
185
+ """count number of completed jobs with filter
186
+
187
+ Args:
188
+ workspace (str):
189
+ completed_after_s_ago (Union[Unset, None, int]):
190
+ success (Union[Unset, None, bool]):
191
+ tags (Union[Unset, None, str]):
192
+ all_workspaces (Union[Unset, None, bool]):
193
+
194
+ Raises:
195
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
196
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
197
+
198
+ Returns:
199
+ int
200
+ """
201
+
202
+ return (
203
+ await asyncio_detailed(
204
+ workspace=workspace,
205
+ client=client,
206
+ completed_after_s_ago=completed_after_s_ago,
207
+ success=success,
208
+ tags=tags,
209
+ all_workspaces=all_workspaces,
210
+ )
211
+ ).parsed
@@ -0,0 +1,146 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ workspace: str,
13
+ ) -> Dict[str, Any]:
14
+ pass
15
+
16
+ return {
17
+ "method": "post",
18
+ "url": "/w/{workspace}/workspaces/critical_alerts/acknowledge_all".format(
19
+ workspace=workspace,
20
+ ),
21
+ }
22
+
23
+
24
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[str]:
25
+ if response.status_code == HTTPStatus.OK:
26
+ response_200 = cast(str, response.json())
27
+ return response_200
28
+ if client.raise_on_unexpected_status:
29
+ raise errors.UnexpectedStatus(response.status_code, response.content)
30
+ else:
31
+ return None
32
+
33
+
34
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[str]:
35
+ return Response(
36
+ status_code=HTTPStatus(response.status_code),
37
+ content=response.content,
38
+ headers=response.headers,
39
+ parsed=_parse_response(client=client, response=response),
40
+ )
41
+
42
+
43
+ def sync_detailed(
44
+ workspace: str,
45
+ *,
46
+ client: Union[AuthenticatedClient, Client],
47
+ ) -> Response[str]:
48
+ """Acknowledge all unacknowledged critical alerts for this workspace
49
+
50
+ Args:
51
+ workspace (str):
52
+
53
+ Raises:
54
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
55
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
56
+
57
+ Returns:
58
+ Response[str]
59
+ """
60
+
61
+ kwargs = _get_kwargs(
62
+ workspace=workspace,
63
+ )
64
+
65
+ response = client.get_httpx_client().request(
66
+ **kwargs,
67
+ )
68
+
69
+ return _build_response(client=client, response=response)
70
+
71
+
72
+ def sync(
73
+ workspace: str,
74
+ *,
75
+ client: Union[AuthenticatedClient, Client],
76
+ ) -> Optional[str]:
77
+ """Acknowledge all unacknowledged critical alerts for this workspace
78
+
79
+ Args:
80
+ workspace (str):
81
+
82
+ Raises:
83
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
84
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
85
+
86
+ Returns:
87
+ str
88
+ """
89
+
90
+ return sync_detailed(
91
+ workspace=workspace,
92
+ client=client,
93
+ ).parsed
94
+
95
+
96
+ async def asyncio_detailed(
97
+ workspace: str,
98
+ *,
99
+ client: Union[AuthenticatedClient, Client],
100
+ ) -> Response[str]:
101
+ """Acknowledge all unacknowledged critical alerts for this workspace
102
+
103
+ Args:
104
+ workspace (str):
105
+
106
+ Raises:
107
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
108
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
109
+
110
+ Returns:
111
+ Response[str]
112
+ """
113
+
114
+ kwargs = _get_kwargs(
115
+ workspace=workspace,
116
+ )
117
+
118
+ response = await client.get_async_httpx_client().request(**kwargs)
119
+
120
+ return _build_response(client=client, response=response)
121
+
122
+
123
+ async def asyncio(
124
+ workspace: str,
125
+ *,
126
+ client: Union[AuthenticatedClient, Client],
127
+ ) -> Optional[str]:
128
+ """Acknowledge all unacknowledged critical alerts for this workspace
129
+
130
+ Args:
131
+ workspace (str):
132
+
133
+ Raises:
134
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
135
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
136
+
137
+ Returns:
138
+ str
139
+ """
140
+
141
+ return (
142
+ await asyncio_detailed(
143
+ workspace=workspace,
144
+ client=client,
145
+ )
146
+ ).parsed
@@ -0,0 +1,160 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ workspace: str,
13
+ id: int,
14
+ ) -> Dict[str, Any]:
15
+ pass
16
+
17
+ return {
18
+ "method": "post",
19
+ "url": "/w/{workspace}/workspaces/critical_alerts/{id}/acknowledge".format(
20
+ workspace=workspace,
21
+ id=id,
22
+ ),
23
+ }
24
+
25
+
26
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[str]:
27
+ if response.status_code == HTTPStatus.OK:
28
+ response_200 = cast(str, response.json())
29
+ return response_200
30
+ if client.raise_on_unexpected_status:
31
+ raise errors.UnexpectedStatus(response.status_code, response.content)
32
+ else:
33
+ return None
34
+
35
+
36
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[str]:
37
+ return Response(
38
+ status_code=HTTPStatus(response.status_code),
39
+ content=response.content,
40
+ headers=response.headers,
41
+ parsed=_parse_response(client=client, response=response),
42
+ )
43
+
44
+
45
+ def sync_detailed(
46
+ workspace: str,
47
+ id: int,
48
+ *,
49
+ client: Union[AuthenticatedClient, Client],
50
+ ) -> Response[str]:
51
+ """Acknowledge a critical alert for this workspace
52
+
53
+ Args:
54
+ workspace (str):
55
+ id (int):
56
+
57
+ Raises:
58
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
59
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
60
+
61
+ Returns:
62
+ Response[str]
63
+ """
64
+
65
+ kwargs = _get_kwargs(
66
+ workspace=workspace,
67
+ id=id,
68
+ )
69
+
70
+ response = client.get_httpx_client().request(
71
+ **kwargs,
72
+ )
73
+
74
+ return _build_response(client=client, response=response)
75
+
76
+
77
+ def sync(
78
+ workspace: str,
79
+ id: int,
80
+ *,
81
+ client: Union[AuthenticatedClient, Client],
82
+ ) -> Optional[str]:
83
+ """Acknowledge a critical alert for this workspace
84
+
85
+ Args:
86
+ workspace (str):
87
+ id (int):
88
+
89
+ Raises:
90
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
91
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
92
+
93
+ Returns:
94
+ str
95
+ """
96
+
97
+ return sync_detailed(
98
+ workspace=workspace,
99
+ id=id,
100
+ client=client,
101
+ ).parsed
102
+
103
+
104
+ async def asyncio_detailed(
105
+ workspace: str,
106
+ id: int,
107
+ *,
108
+ client: Union[AuthenticatedClient, Client],
109
+ ) -> Response[str]:
110
+ """Acknowledge a critical alert for this workspace
111
+
112
+ Args:
113
+ workspace (str):
114
+ id (int):
115
+
116
+ Raises:
117
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
119
+
120
+ Returns:
121
+ Response[str]
122
+ """
123
+
124
+ kwargs = _get_kwargs(
125
+ workspace=workspace,
126
+ id=id,
127
+ )
128
+
129
+ response = await client.get_async_httpx_client().request(**kwargs)
130
+
131
+ return _build_response(client=client, response=response)
132
+
133
+
134
+ async def asyncio(
135
+ workspace: str,
136
+ id: int,
137
+ *,
138
+ client: Union[AuthenticatedClient, Client],
139
+ ) -> Optional[str]:
140
+ """Acknowledge a critical alert for this workspace
141
+
142
+ Args:
143
+ workspace (str):
144
+ id (int):
145
+
146
+ Raises:
147
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
148
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
149
+
150
+ Returns:
151
+ str
152
+ """
153
+
154
+ return (
155
+ await asyncio_detailed(
156
+ workspace=workspace,
157
+ id=id,
158
+ client=client,
159
+ )
160
+ ).parsed