cyberdesk 1.11.0__py3-none-any.whl → 2.1.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 cyberdesk might be problematic. Click here for more details.

Files changed (66) hide show
  1. cyberdesk/__init__.py +1 -1
  2. cyberdesk/client.py +358 -6
  3. {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/METADATA +1 -1
  4. {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/RECORD +66 -49
  5. openapi_client/cyberdesk_cloud_client/api/connections/create_connection_v1_connections_post.py +4 -4
  6. openapi_client/cyberdesk_cloud_client/api/connections/delete_connection_v1_connections_connection_id_delete.py +4 -4
  7. openapi_client/cyberdesk_cloud_client/api/connections/get_connection_v1_connections_connection_id_get.py +4 -4
  8. openapi_client/cyberdesk_cloud_client/api/connections/list_connections_v1_connections_get.py +4 -4
  9. openapi_client/cyberdesk_cloud_client/api/connections/update_connection_v1_connections_connection_id_patch.py +4 -4
  10. openapi_client/cyberdesk_cloud_client/api/machines/create_machine_v1_machines_post.py +4 -4
  11. openapi_client/cyberdesk_cloud_client/api/machines/delete_machine_v1_machines_machine_id_delete.py +4 -4
  12. openapi_client/cyberdesk_cloud_client/api/machines/get_machine_pools_v1_machines_machine_id_pools_get.py +169 -0
  13. openapi_client/cyberdesk_cloud_client/api/machines/get_machine_v1_machines_machine_id_get.py +4 -4
  14. openapi_client/cyberdesk_cloud_client/api/machines/list_machines_v1_machines_get.py +4 -4
  15. openapi_client/cyberdesk_cloud_client/api/machines/update_machine_pools_v1_machines_machine_id_pools_put.py +190 -0
  16. openapi_client/cyberdesk_cloud_client/api/machines/update_machine_v1_machines_machine_id_patch.py +4 -4
  17. openapi_client/cyberdesk_cloud_client/api/pools/__init__.py +1 -0
  18. openapi_client/cyberdesk_cloud_client/api/pools/add_machines_to_pool_v1_pools_pool_id_machines_post.py +186 -0
  19. openapi_client/cyberdesk_cloud_client/api/pools/create_pool_v1_pools_post.py +172 -0
  20. openapi_client/cyberdesk_cloud_client/api/pools/delete_pool_v1_pools_pool_id_delete.py +162 -0
  21. openapi_client/cyberdesk_cloud_client/api/pools/get_pool_v1_pools_pool_id_get.py +185 -0
  22. openapi_client/cyberdesk_cloud_client/api/pools/list_pools_v1_pools_get.py +186 -0
  23. openapi_client/cyberdesk_cloud_client/api/pools/remove_machines_from_pool_v1_pools_pool_id_machines_delete.py +184 -0
  24. openapi_client/cyberdesk_cloud_client/api/pools/update_pool_v1_pools_pool_id_patch.py +186 -0
  25. openapi_client/cyberdesk_cloud_client/api/request_logs/create_request_log_v1_request_logs_post.py +4 -4
  26. openapi_client/cyberdesk_cloud_client/api/request_logs/delete_request_log_v1_request_logs_log_id_delete.py +4 -4
  27. openapi_client/cyberdesk_cloud_client/api/request_logs/get_request_log_v1_request_logs_log_id_get.py +4 -4
  28. openapi_client/cyberdesk_cloud_client/api/request_logs/list_request_logs_v1_request_logs_get.py +4 -4
  29. openapi_client/cyberdesk_cloud_client/api/request_logs/update_request_log_v1_request_logs_log_id_patch.py +4 -4
  30. openapi_client/cyberdesk_cloud_client/api/run_attachments/list_run_attachments_v1_run_attachments_get.py +4 -4
  31. openapi_client/cyberdesk_cloud_client/api/runs/create_run_v1_runs_post.py +12 -8
  32. openapi_client/cyberdesk_cloud_client/api/runs/delete_run_v1_runs_run_id_delete.py +8 -4
  33. openapi_client/cyberdesk_cloud_client/api/runs/get_run_v1_runs_run_id_get.py +4 -4
  34. openapi_client/cyberdesk_cloud_client/api/runs/list_runs_v1_runs_get.py +4 -4
  35. openapi_client/cyberdesk_cloud_client/api/runs/update_run_v1_runs_run_id_patch.py +8 -12
  36. openapi_client/cyberdesk_cloud_client/api/trajectories/create_trajectory_v1_trajectories_post.py +4 -4
  37. openapi_client/cyberdesk_cloud_client/api/trajectories/delete_trajectory_v1_trajectories_trajectory_id_delete.py +4 -4
  38. openapi_client/cyberdesk_cloud_client/api/trajectories/get_latest_trajectory_for_workflow_v1_workflows_workflow_id_latest_trajectory_get.py +4 -4
  39. openapi_client/cyberdesk_cloud_client/api/trajectories/get_trajectory_v1_trajectories_trajectory_id_get.py +4 -4
  40. openapi_client/cyberdesk_cloud_client/api/trajectories/list_trajectories_v1_trajectories_get.py +4 -4
  41. openapi_client/cyberdesk_cloud_client/api/trajectories/update_trajectory_v1_trajectories_trajectory_id_patch.py +4 -4
  42. openapi_client/cyberdesk_cloud_client/api/workflows/create_workflow_v1_workflows_post.py +4 -4
  43. openapi_client/cyberdesk_cloud_client/api/workflows/delete_workflow_v1_workflows_workflow_id_delete.py +4 -4
  44. openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_v1_workflows_workflow_id_get.py +4 -4
  45. openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_versions_v1_workflows_workflow_id_versions_get.py +4 -4
  46. openapi_client/cyberdesk_cloud_client/api/workflows/list_workflows_v1_workflows_get.py +4 -4
  47. openapi_client/cyberdesk_cloud_client/api/workflows/update_workflow_v1_workflows_workflow_id_patch.py +4 -4
  48. openapi_client/cyberdesk_cloud_client/models/__init__.py +14 -0
  49. openapi_client/cyberdesk_cloud_client/models/machine_pool_assignment.py +69 -0
  50. openapi_client/cyberdesk_cloud_client/models/machine_pool_update.py +69 -0
  51. openapi_client/cyberdesk_cloud_client/models/machine_response.py +96 -9
  52. openapi_client/cyberdesk_cloud_client/models/paginated_response_pool_response.py +97 -0
  53. openapi_client/cyberdesk_cloud_client/models/pool_create.py +82 -0
  54. openapi_client/cyberdesk_cloud_client/models/pool_response.py +137 -0
  55. openapi_client/cyberdesk_cloud_client/models/pool_update.py +92 -0
  56. openapi_client/cyberdesk_cloud_client/models/pool_with_machines.py +162 -0
  57. openapi_client/cyberdesk_cloud_client/models/request_log_response.py +20 -0
  58. openapi_client/cyberdesk_cloud_client/models/run_attachment_response.py +50 -8
  59. openapi_client/cyberdesk_cloud_client/models/run_bulk_create.py +40 -0
  60. openapi_client/cyberdesk_cloud_client/models/run_create.py +40 -0
  61. openapi_client/cyberdesk_cloud_client/models/run_response.py +90 -8
  62. openapi_client/cyberdesk_cloud_client/models/trajectory_response.py +50 -8
  63. openapi_client/cyberdesk_cloud_client/models/workflow_response.py +50 -8
  64. {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/WHEEL +0 -0
  65. {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/licenses/LICENSE +0 -0
  66. {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,162 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ pool_id: UUID,
15
+ ) -> dict[str, Any]:
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "delete",
18
+ "url": f"/v1/pools/{pool_id}",
19
+ }
20
+
21
+ return _kwargs
22
+
23
+
24
+ def _parse_response(
25
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
+ ) -> Optional[Union[Any, HTTPValidationError]]:
27
+ if response.status_code == 204:
28
+ response_204 = cast(Any, None)
29
+ return response_204
30
+ if response.status_code == 422:
31
+ response_422 = HTTPValidationError.from_dict(response.json())
32
+
33
+ return response_422
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(
41
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
42
+ ) -> Response[Union[Any, HTTPValidationError]]:
43
+ return Response(
44
+ status_code=HTTPStatus(response.status_code),
45
+ content=response.content,
46
+ headers=response.headers,
47
+ parsed=_parse_response(client=client, response=response),
48
+ )
49
+
50
+
51
+ def sync_detailed(
52
+ pool_id: UUID,
53
+ *,
54
+ client: AuthenticatedClient,
55
+ ) -> Response[Union[Any, HTTPValidationError]]:
56
+ """Delete Pool
57
+
58
+ Delete a pool. This will not delete the machines in the pool.
59
+
60
+ Args:
61
+ pool_id (UUID):
62
+
63
+ Raises:
64
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
65
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
66
+
67
+ Returns:
68
+ Response[Union[Any, HTTPValidationError]]
69
+ """
70
+
71
+ kwargs = _get_kwargs(
72
+ pool_id=pool_id,
73
+ )
74
+
75
+ response = client.get_httpx_client().request(
76
+ **kwargs,
77
+ )
78
+
79
+ return _build_response(client=client, response=response)
80
+
81
+
82
+ def sync(
83
+ pool_id: UUID,
84
+ *,
85
+ client: AuthenticatedClient,
86
+ ) -> Optional[Union[Any, HTTPValidationError]]:
87
+ """Delete Pool
88
+
89
+ Delete a pool. This will not delete the machines in the pool.
90
+
91
+ Args:
92
+ pool_id (UUID):
93
+
94
+ Raises:
95
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
96
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
97
+
98
+ Returns:
99
+ Union[Any, HTTPValidationError]
100
+ """
101
+
102
+ return sync_detailed(
103
+ pool_id=pool_id,
104
+ client=client,
105
+ ).parsed
106
+
107
+
108
+ async def asyncio_detailed(
109
+ pool_id: UUID,
110
+ *,
111
+ client: AuthenticatedClient,
112
+ ) -> Response[Union[Any, HTTPValidationError]]:
113
+ """Delete Pool
114
+
115
+ Delete a pool. This will not delete the machines in the pool.
116
+
117
+ Args:
118
+ pool_id (UUID):
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[Union[Any, HTTPValidationError]]
126
+ """
127
+
128
+ kwargs = _get_kwargs(
129
+ pool_id=pool_id,
130
+ )
131
+
132
+ response = await client.get_async_httpx_client().request(**kwargs)
133
+
134
+ return _build_response(client=client, response=response)
135
+
136
+
137
+ async def asyncio(
138
+ pool_id: UUID,
139
+ *,
140
+ client: AuthenticatedClient,
141
+ ) -> Optional[Union[Any, HTTPValidationError]]:
142
+ """Delete Pool
143
+
144
+ Delete a pool. This will not delete the machines in the pool.
145
+
146
+ Args:
147
+ pool_id (UUID):
148
+
149
+ Raises:
150
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
151
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
152
+
153
+ Returns:
154
+ Union[Any, HTTPValidationError]
155
+ """
156
+
157
+ return (
158
+ await asyncio_detailed(
159
+ pool_id=pool_id,
160
+ client=client,
161
+ )
162
+ ).parsed
@@ -0,0 +1,185 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...models.pool_with_machines import PoolWithMachines
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ pool_id: UUID,
16
+ *,
17
+ include_machines: Union[Unset, bool] = False,
18
+ ) -> dict[str, Any]:
19
+ params: dict[str, Any] = {}
20
+
21
+ params["include_machines"] = include_machines
22
+
23
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
24
+
25
+ _kwargs: dict[str, Any] = {
26
+ "method": "get",
27
+ "url": f"/v1/pools/{pool_id}",
28
+ "params": params,
29
+ }
30
+
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(
35
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
36
+ ) -> Optional[Union[HTTPValidationError, PoolWithMachines]]:
37
+ if response.status_code == 200:
38
+ response_200 = PoolWithMachines.from_dict(response.json())
39
+
40
+ return response_200
41
+ if response.status_code == 422:
42
+ response_422 = HTTPValidationError.from_dict(response.json())
43
+
44
+ return response_422
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(
52
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
53
+ ) -> Response[Union[HTTPValidationError, PoolWithMachines]]:
54
+ return Response(
55
+ status_code=HTTPStatus(response.status_code),
56
+ content=response.content,
57
+ headers=response.headers,
58
+ parsed=_parse_response(client=client, response=response),
59
+ )
60
+
61
+
62
+ def sync_detailed(
63
+ pool_id: UUID,
64
+ *,
65
+ client: AuthenticatedClient,
66
+ include_machines: Union[Unset, bool] = False,
67
+ ) -> Response[Union[HTTPValidationError, PoolWithMachines]]:
68
+ """Get Pool
69
+
70
+ Get a specific pool by ID.
71
+
72
+ Args:
73
+ pool_id (UUID):
74
+ include_machines (Union[Unset, bool]): Include full machine details Default: False.
75
+
76
+ Raises:
77
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
78
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
79
+
80
+ Returns:
81
+ Response[Union[HTTPValidationError, PoolWithMachines]]
82
+ """
83
+
84
+ kwargs = _get_kwargs(
85
+ pool_id=pool_id,
86
+ include_machines=include_machines,
87
+ )
88
+
89
+ response = client.get_httpx_client().request(
90
+ **kwargs,
91
+ )
92
+
93
+ return _build_response(client=client, response=response)
94
+
95
+
96
+ def sync(
97
+ pool_id: UUID,
98
+ *,
99
+ client: AuthenticatedClient,
100
+ include_machines: Union[Unset, bool] = False,
101
+ ) -> Optional[Union[HTTPValidationError, PoolWithMachines]]:
102
+ """Get Pool
103
+
104
+ Get a specific pool by ID.
105
+
106
+ Args:
107
+ pool_id (UUID):
108
+ include_machines (Union[Unset, bool]): Include full machine details Default: False.
109
+
110
+ Raises:
111
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
112
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
113
+
114
+ Returns:
115
+ Union[HTTPValidationError, PoolWithMachines]
116
+ """
117
+
118
+ return sync_detailed(
119
+ pool_id=pool_id,
120
+ client=client,
121
+ include_machines=include_machines,
122
+ ).parsed
123
+
124
+
125
+ async def asyncio_detailed(
126
+ pool_id: UUID,
127
+ *,
128
+ client: AuthenticatedClient,
129
+ include_machines: Union[Unset, bool] = False,
130
+ ) -> Response[Union[HTTPValidationError, PoolWithMachines]]:
131
+ """Get Pool
132
+
133
+ Get a specific pool by ID.
134
+
135
+ Args:
136
+ pool_id (UUID):
137
+ include_machines (Union[Unset, bool]): Include full machine details Default: False.
138
+
139
+ Raises:
140
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
141
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
142
+
143
+ Returns:
144
+ Response[Union[HTTPValidationError, PoolWithMachines]]
145
+ """
146
+
147
+ kwargs = _get_kwargs(
148
+ pool_id=pool_id,
149
+ include_machines=include_machines,
150
+ )
151
+
152
+ response = await client.get_async_httpx_client().request(**kwargs)
153
+
154
+ return _build_response(client=client, response=response)
155
+
156
+
157
+ async def asyncio(
158
+ pool_id: UUID,
159
+ *,
160
+ client: AuthenticatedClient,
161
+ include_machines: Union[Unset, bool] = False,
162
+ ) -> Optional[Union[HTTPValidationError, PoolWithMachines]]:
163
+ """Get Pool
164
+
165
+ Get a specific pool by ID.
166
+
167
+ Args:
168
+ pool_id (UUID):
169
+ include_machines (Union[Unset, bool]): Include full machine details Default: False.
170
+
171
+ Raises:
172
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
173
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
174
+
175
+ Returns:
176
+ Union[HTTPValidationError, PoolWithMachines]
177
+ """
178
+
179
+ return (
180
+ await asyncio_detailed(
181
+ pool_id=pool_id,
182
+ client=client,
183
+ include_machines=include_machines,
184
+ )
185
+ ).parsed
@@ -0,0 +1,186 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...models.paginated_response_pool_response import PaginatedResponsePoolResponse
10
+ from ...types import UNSET, Response, Unset
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ skip: Union[Unset, int] = 0,
16
+ limit: Union[Unset, int] = 100,
17
+ ) -> dict[str, Any]:
18
+ params: dict[str, Any] = {}
19
+
20
+ params["skip"] = skip
21
+
22
+ params["limit"] = limit
23
+
24
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
25
+
26
+ _kwargs: dict[str, Any] = {
27
+ "method": "get",
28
+ "url": "/v1/pools",
29
+ "params": params,
30
+ }
31
+
32
+ return _kwargs
33
+
34
+
35
+ def _parse_response(
36
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
37
+ ) -> Optional[Union[HTTPValidationError, PaginatedResponsePoolResponse]]:
38
+ if response.status_code == 200:
39
+ response_200 = PaginatedResponsePoolResponse.from_dict(response.json())
40
+
41
+ return response_200
42
+ if response.status_code == 422:
43
+ response_422 = HTTPValidationError.from_dict(response.json())
44
+
45
+ return response_422
46
+ if client.raise_on_unexpected_status:
47
+ raise errors.UnexpectedStatus(response.status_code, response.content)
48
+ else:
49
+ return None
50
+
51
+
52
+ def _build_response(
53
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
54
+ ) -> Response[Union[HTTPValidationError, PaginatedResponsePoolResponse]]:
55
+ return Response(
56
+ status_code=HTTPStatus(response.status_code),
57
+ content=response.content,
58
+ headers=response.headers,
59
+ parsed=_parse_response(client=client, response=response),
60
+ )
61
+
62
+
63
+ def sync_detailed(
64
+ *,
65
+ client: AuthenticatedClient,
66
+ skip: Union[Unset, int] = 0,
67
+ limit: Union[Unset, int] = 100,
68
+ ) -> Response[Union[HTTPValidationError, PaginatedResponsePoolResponse]]:
69
+ """List Pools
70
+
71
+ List all pools for the organization.
72
+
73
+ Args:
74
+ skip (Union[Unset, int]): Default: 0.
75
+ limit (Union[Unset, int]): Default: 100.
76
+
77
+ Raises:
78
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
79
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
80
+
81
+ Returns:
82
+ Response[Union[HTTPValidationError, PaginatedResponsePoolResponse]]
83
+ """
84
+
85
+ kwargs = _get_kwargs(
86
+ skip=skip,
87
+ limit=limit,
88
+ )
89
+
90
+ response = client.get_httpx_client().request(
91
+ **kwargs,
92
+ )
93
+
94
+ return _build_response(client=client, response=response)
95
+
96
+
97
+ def sync(
98
+ *,
99
+ client: AuthenticatedClient,
100
+ skip: Union[Unset, int] = 0,
101
+ limit: Union[Unset, int] = 100,
102
+ ) -> Optional[Union[HTTPValidationError, PaginatedResponsePoolResponse]]:
103
+ """List Pools
104
+
105
+ List all pools for the organization.
106
+
107
+ Args:
108
+ skip (Union[Unset, int]): Default: 0.
109
+ limit (Union[Unset, int]): Default: 100.
110
+
111
+ Raises:
112
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
113
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
114
+
115
+ Returns:
116
+ Union[HTTPValidationError, PaginatedResponsePoolResponse]
117
+ """
118
+
119
+ return sync_detailed(
120
+ client=client,
121
+ skip=skip,
122
+ limit=limit,
123
+ ).parsed
124
+
125
+
126
+ async def asyncio_detailed(
127
+ *,
128
+ client: AuthenticatedClient,
129
+ skip: Union[Unset, int] = 0,
130
+ limit: Union[Unset, int] = 100,
131
+ ) -> Response[Union[HTTPValidationError, PaginatedResponsePoolResponse]]:
132
+ """List Pools
133
+
134
+ List all pools for the organization.
135
+
136
+ Args:
137
+ skip (Union[Unset, int]): Default: 0.
138
+ limit (Union[Unset, int]): Default: 100.
139
+
140
+ Raises:
141
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
142
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
143
+
144
+ Returns:
145
+ Response[Union[HTTPValidationError, PaginatedResponsePoolResponse]]
146
+ """
147
+
148
+ kwargs = _get_kwargs(
149
+ skip=skip,
150
+ limit=limit,
151
+ )
152
+
153
+ response = await client.get_async_httpx_client().request(**kwargs)
154
+
155
+ return _build_response(client=client, response=response)
156
+
157
+
158
+ async def asyncio(
159
+ *,
160
+ client: AuthenticatedClient,
161
+ skip: Union[Unset, int] = 0,
162
+ limit: Union[Unset, int] = 100,
163
+ ) -> Optional[Union[HTTPValidationError, PaginatedResponsePoolResponse]]:
164
+ """List Pools
165
+
166
+ List all pools for the organization.
167
+
168
+ Args:
169
+ skip (Union[Unset, int]): Default: 0.
170
+ limit (Union[Unset, int]): Default: 100.
171
+
172
+ Raises:
173
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
174
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
175
+
176
+ Returns:
177
+ Union[HTTPValidationError, PaginatedResponsePoolResponse]
178
+ """
179
+
180
+ return (
181
+ await asyncio_detailed(
182
+ client=client,
183
+ skip=skip,
184
+ limit=limit,
185
+ )
186
+ ).parsed
@@ -0,0 +1,184 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...models.machine_pool_assignment import MachinePoolAssignment
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ pool_id: UUID,
16
+ *,
17
+ body: MachinePoolAssignment,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "delete",
23
+ "url": f"/v1/pools/{pool_id}/machines",
24
+ }
25
+
26
+ _kwargs["json"] = body.to_dict()
27
+
28
+ headers["Content-Type"] = "application/json"
29
+
30
+ _kwargs["headers"] = headers
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(
35
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
36
+ ) -> Optional[Union[Any, HTTPValidationError]]:
37
+ if response.status_code == 204:
38
+ response_204 = cast(Any, None)
39
+ return response_204
40
+ if response.status_code == 422:
41
+ response_422 = HTTPValidationError.from_dict(response.json())
42
+
43
+ return response_422
44
+ if client.raise_on_unexpected_status:
45
+ raise errors.UnexpectedStatus(response.status_code, response.content)
46
+ else:
47
+ return None
48
+
49
+
50
+ def _build_response(
51
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
52
+ ) -> Response[Union[Any, HTTPValidationError]]:
53
+ return Response(
54
+ status_code=HTTPStatus(response.status_code),
55
+ content=response.content,
56
+ headers=response.headers,
57
+ parsed=_parse_response(client=client, response=response),
58
+ )
59
+
60
+
61
+ def sync_detailed(
62
+ pool_id: UUID,
63
+ *,
64
+ client: AuthenticatedClient,
65
+ body: MachinePoolAssignment,
66
+ ) -> Response[Union[Any, HTTPValidationError]]:
67
+ """Remove Machines From Pool
68
+
69
+ Remove machines from a pool.
70
+
71
+ Args:
72
+ pool_id (UUID):
73
+ body (MachinePoolAssignment): Schema for assigning machines to pools
74
+
75
+ Raises:
76
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
77
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
78
+
79
+ Returns:
80
+ Response[Union[Any, HTTPValidationError]]
81
+ """
82
+
83
+ kwargs = _get_kwargs(
84
+ pool_id=pool_id,
85
+ body=body,
86
+ )
87
+
88
+ response = client.get_httpx_client().request(
89
+ **kwargs,
90
+ )
91
+
92
+ return _build_response(client=client, response=response)
93
+
94
+
95
+ def sync(
96
+ pool_id: UUID,
97
+ *,
98
+ client: AuthenticatedClient,
99
+ body: MachinePoolAssignment,
100
+ ) -> Optional[Union[Any, HTTPValidationError]]:
101
+ """Remove Machines From Pool
102
+
103
+ Remove machines from a pool.
104
+
105
+ Args:
106
+ pool_id (UUID):
107
+ body (MachinePoolAssignment): Schema for assigning machines to pools
108
+
109
+ Raises:
110
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
111
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
112
+
113
+ Returns:
114
+ Union[Any, HTTPValidationError]
115
+ """
116
+
117
+ return sync_detailed(
118
+ pool_id=pool_id,
119
+ client=client,
120
+ body=body,
121
+ ).parsed
122
+
123
+
124
+ async def asyncio_detailed(
125
+ pool_id: UUID,
126
+ *,
127
+ client: AuthenticatedClient,
128
+ body: MachinePoolAssignment,
129
+ ) -> Response[Union[Any, HTTPValidationError]]:
130
+ """Remove Machines From Pool
131
+
132
+ Remove machines from a pool.
133
+
134
+ Args:
135
+ pool_id (UUID):
136
+ body (MachinePoolAssignment): Schema for assigning machines to pools
137
+
138
+ Raises:
139
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
140
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
141
+
142
+ Returns:
143
+ Response[Union[Any, HTTPValidationError]]
144
+ """
145
+
146
+ kwargs = _get_kwargs(
147
+ pool_id=pool_id,
148
+ body=body,
149
+ )
150
+
151
+ response = await client.get_async_httpx_client().request(**kwargs)
152
+
153
+ return _build_response(client=client, response=response)
154
+
155
+
156
+ async def asyncio(
157
+ pool_id: UUID,
158
+ *,
159
+ client: AuthenticatedClient,
160
+ body: MachinePoolAssignment,
161
+ ) -> Optional[Union[Any, HTTPValidationError]]:
162
+ """Remove Machines From Pool
163
+
164
+ Remove machines from a pool.
165
+
166
+ Args:
167
+ pool_id (UUID):
168
+ body (MachinePoolAssignment): Schema for assigning machines to pools
169
+
170
+ Raises:
171
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
172
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
173
+
174
+ Returns:
175
+ Union[Any, HTTPValidationError]
176
+ """
177
+
178
+ return (
179
+ await asyncio_detailed(
180
+ pool_id=pool_id,
181
+ client=client,
182
+ body=body,
183
+ )
184
+ ).parsed