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