cyberdesk 1.8.0__py3-none-any.whl → 1.10.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 (41) hide show
  1. cyberdesk/__init__.py +13 -1
  2. cyberdesk/client.py +357 -0
  3. {cyberdesk-1.8.0.dist-info → cyberdesk-1.10.0.dist-info}/METADATA +39 -17
  4. {cyberdesk-1.8.0.dist-info → cyberdesk-1.10.0.dist-info}/RECORD +41 -13
  5. openapi_client/cyberdesk_cloud_client/api/computer/fs_list_v1_computer_machine_id_fs_list_get.py +188 -0
  6. openapi_client/cyberdesk_cloud_client/api/computer/fs_read_v1_computer_machine_id_fs_read_get.py +188 -0
  7. openapi_client/cyberdesk_cloud_client/api/computer/fs_write_v1_computer_machine_id_fs_write_post.py +201 -0
  8. openapi_client/cyberdesk_cloud_client/api/computer/powershell_exec_v1_computer_machine_id_shell_powershell_exec_post.py +219 -0
  9. openapi_client/cyberdesk_cloud_client/api/computer/powershell_session_v1_computer_machine_id_shell_powershell_session_post.py +219 -0
  10. openapi_client/cyberdesk_cloud_client/api/run_attachments/__init__.py +1 -0
  11. openapi_client/cyberdesk_cloud_client/api/run_attachments/create_run_attachment_v1_run_attachments_post.py +184 -0
  12. openapi_client/cyberdesk_cloud_client/api/run_attachments/delete_run_attachment_v1_run_attachments_attachment_id_delete.py +170 -0
  13. openapi_client/cyberdesk_cloud_client/api/run_attachments/download_run_attachment_v1_run_attachments_attachment_id_download_get.py +170 -0
  14. openapi_client/cyberdesk_cloud_client/api/run_attachments/get_run_attachment_download_url_v1_run_attachments_attachment_id_download_url_get.py +209 -0
  15. openapi_client/cyberdesk_cloud_client/api/run_attachments/get_run_attachment_v1_run_attachments_attachment_id_get.py +172 -0
  16. openapi_client/cyberdesk_cloud_client/api/run_attachments/list_run_attachments_v1_run_attachments_get.py +240 -0
  17. openapi_client/cyberdesk_cloud_client/api/run_attachments/update_run_attachment_v1_run_attachments_attachment_id_put.py +194 -0
  18. openapi_client/cyberdesk_cloud_client/models/__init__.py +40 -0
  19. openapi_client/cyberdesk_cloud_client/models/attachment_type.py +9 -0
  20. openapi_client/cyberdesk_cloud_client/models/file_input.py +99 -0
  21. openapi_client/cyberdesk_cloud_client/models/file_write_request.py +78 -0
  22. openapi_client/cyberdesk_cloud_client/models/fs_list_v1_computer_machine_id_fs_list_get_response_fs_list_v1_computer_machine_id_fs_list_get.py +44 -0
  23. openapi_client/cyberdesk_cloud_client/models/fs_read_v1_computer_machine_id_fs_read_get_response_fs_read_v1_computer_machine_id_fs_read_get.py +44 -0
  24. openapi_client/cyberdesk_cloud_client/models/fs_write_v1_computer_machine_id_fs_write_post_response_fs_write_v1_computer_machine_id_fs_write_post.py +44 -0
  25. openapi_client/cyberdesk_cloud_client/models/paginated_response_run_attachment_response.py +97 -0
  26. openapi_client/cyberdesk_cloud_client/models/power_shell_exec_request.py +110 -0
  27. openapi_client/cyberdesk_cloud_client/models/power_shell_session_request.py +81 -0
  28. openapi_client/cyberdesk_cloud_client/models/powershell_exec_v1_computer_machine_id_shell_powershell_exec_post_response_powershell_exec_v1_computer_machine_id_shell_powershell_exec_post.py +47 -0
  29. openapi_client/cyberdesk_cloud_client/models/powershell_session_v1_computer_machine_id_shell_powershell_session_post_response_powershell_session_v1_computer_machine_id_shell_powershell_session_post.py +47 -0
  30. openapi_client/cyberdesk_cloud_client/models/run_attachment_create.py +157 -0
  31. openapi_client/cyberdesk_cloud_client/models/run_attachment_download_url_response.py +68 -0
  32. openapi_client/cyberdesk_cloud_client/models/run_attachment_response.py +189 -0
  33. openapi_client/cyberdesk_cloud_client/models/run_attachment_update.py +84 -0
  34. openapi_client/cyberdesk_cloud_client/models/run_create.py +41 -0
  35. openapi_client/cyberdesk_cloud_client/models/run_response.py +26 -0
  36. openapi_client/cyberdesk_cloud_client/models/workflow_create.py +9 -0
  37. openapi_client/cyberdesk_cloud_client/models/workflow_response.py +9 -0
  38. openapi_client/cyberdesk_cloud_client/models/workflow_update.py +20 -0
  39. {cyberdesk-1.8.0.dist-info → cyberdesk-1.10.0.dist-info}/WHEEL +0 -0
  40. {cyberdesk-1.8.0.dist-info → cyberdesk-1.10.0.dist-info}/licenses/LICENSE +0 -0
  41. {cyberdesk-1.8.0.dist-info → cyberdesk-1.10.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,219 @@
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.power_shell_exec_request import PowerShellExecRequest
10
+ from ...models.powershell_exec_v1_computer_machine_id_shell_powershell_exec_post_response_powershell_exec_v1_computer_machine_id_shell_powershell_exec_post import (
11
+ PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost,
12
+ )
13
+ from ...types import Response
14
+
15
+
16
+ def _get_kwargs(
17
+ machine_id: str,
18
+ *,
19
+ body: PowerShellExecRequest,
20
+ ) -> dict[str, Any]:
21
+ headers: dict[str, Any] = {}
22
+
23
+ _kwargs: dict[str, Any] = {
24
+ "method": "post",
25
+ "url": f"/v1/computer/{machine_id}/shell/powershell/exec",
26
+ }
27
+
28
+ _kwargs["json"] = body.to_dict()
29
+
30
+ headers["Content-Type"] = "application/json"
31
+
32
+ _kwargs["headers"] = headers
33
+ return _kwargs
34
+
35
+
36
+ def _parse_response(
37
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
38
+ ) -> Optional[
39
+ Union[
40
+ HTTPValidationError,
41
+ PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost,
42
+ ]
43
+ ]:
44
+ if response.status_code == 200:
45
+ response_200 = PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost.from_dict(
46
+ response.json()
47
+ )
48
+
49
+ return response_200
50
+ if response.status_code == 422:
51
+ response_422 = HTTPValidationError.from_dict(response.json())
52
+
53
+ return response_422
54
+ if client.raise_on_unexpected_status:
55
+ raise errors.UnexpectedStatus(response.status_code, response.content)
56
+ else:
57
+ return None
58
+
59
+
60
+ def _build_response(
61
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
62
+ ) -> Response[
63
+ Union[
64
+ HTTPValidationError,
65
+ PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost,
66
+ ]
67
+ ]:
68
+ return Response(
69
+ status_code=HTTPStatus(response.status_code),
70
+ content=response.content,
71
+ headers=response.headers,
72
+ parsed=_parse_response(client=client, response=response),
73
+ )
74
+
75
+
76
+ def sync_detailed(
77
+ machine_id: str,
78
+ *,
79
+ client: AuthenticatedClient,
80
+ body: PowerShellExecRequest,
81
+ ) -> Response[
82
+ Union[
83
+ HTTPValidationError,
84
+ PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost,
85
+ ]
86
+ ]:
87
+ """Execute PowerShell command
88
+
89
+ Execute PowerShell command on the machine.
90
+
91
+ Args:
92
+ machine_id (str):
93
+ body (PowerShellExecRequest):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ Response[Union[HTTPValidationError, PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost]]
101
+ """
102
+
103
+ kwargs = _get_kwargs(
104
+ machine_id=machine_id,
105
+ body=body,
106
+ )
107
+
108
+ response = client.get_httpx_client().request(
109
+ **kwargs,
110
+ )
111
+
112
+ return _build_response(client=client, response=response)
113
+
114
+
115
+ def sync(
116
+ machine_id: str,
117
+ *,
118
+ client: AuthenticatedClient,
119
+ body: PowerShellExecRequest,
120
+ ) -> Optional[
121
+ Union[
122
+ HTTPValidationError,
123
+ PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost,
124
+ ]
125
+ ]:
126
+ """Execute PowerShell command
127
+
128
+ Execute PowerShell command on the machine.
129
+
130
+ Args:
131
+ machine_id (str):
132
+ body (PowerShellExecRequest):
133
+
134
+ Raises:
135
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
136
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
137
+
138
+ Returns:
139
+ Union[HTTPValidationError, PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost]
140
+ """
141
+
142
+ return sync_detailed(
143
+ machine_id=machine_id,
144
+ client=client,
145
+ body=body,
146
+ ).parsed
147
+
148
+
149
+ async def asyncio_detailed(
150
+ machine_id: str,
151
+ *,
152
+ client: AuthenticatedClient,
153
+ body: PowerShellExecRequest,
154
+ ) -> Response[
155
+ Union[
156
+ HTTPValidationError,
157
+ PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost,
158
+ ]
159
+ ]:
160
+ """Execute PowerShell command
161
+
162
+ Execute PowerShell command on the machine.
163
+
164
+ Args:
165
+ machine_id (str):
166
+ body (PowerShellExecRequest):
167
+
168
+ Raises:
169
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
170
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
171
+
172
+ Returns:
173
+ Response[Union[HTTPValidationError, PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost]]
174
+ """
175
+
176
+ kwargs = _get_kwargs(
177
+ machine_id=machine_id,
178
+ body=body,
179
+ )
180
+
181
+ response = await client.get_async_httpx_client().request(**kwargs)
182
+
183
+ return _build_response(client=client, response=response)
184
+
185
+
186
+ async def asyncio(
187
+ machine_id: str,
188
+ *,
189
+ client: AuthenticatedClient,
190
+ body: PowerShellExecRequest,
191
+ ) -> Optional[
192
+ Union[
193
+ HTTPValidationError,
194
+ PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost,
195
+ ]
196
+ ]:
197
+ """Execute PowerShell command
198
+
199
+ Execute PowerShell command on the machine.
200
+
201
+ Args:
202
+ machine_id (str):
203
+ body (PowerShellExecRequest):
204
+
205
+ Raises:
206
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
207
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
208
+
209
+ Returns:
210
+ Union[HTTPValidationError, PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost]
211
+ """
212
+
213
+ return (
214
+ await asyncio_detailed(
215
+ machine_id=machine_id,
216
+ client=client,
217
+ body=body,
218
+ )
219
+ ).parsed
@@ -0,0 +1,219 @@
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.power_shell_session_request import PowerShellSessionRequest
10
+ from ...models.powershell_session_v1_computer_machine_id_shell_powershell_session_post_response_powershell_session_v1_computer_machine_id_shell_powershell_session_post import (
11
+ PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost,
12
+ )
13
+ from ...types import Response
14
+
15
+
16
+ def _get_kwargs(
17
+ machine_id: str,
18
+ *,
19
+ body: PowerShellSessionRequest,
20
+ ) -> dict[str, Any]:
21
+ headers: dict[str, Any] = {}
22
+
23
+ _kwargs: dict[str, Any] = {
24
+ "method": "post",
25
+ "url": f"/v1/computer/{machine_id}/shell/powershell/session",
26
+ }
27
+
28
+ _kwargs["json"] = body.to_dict()
29
+
30
+ headers["Content-Type"] = "application/json"
31
+
32
+ _kwargs["headers"] = headers
33
+ return _kwargs
34
+
35
+
36
+ def _parse_response(
37
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
38
+ ) -> Optional[
39
+ Union[
40
+ HTTPValidationError,
41
+ PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost,
42
+ ]
43
+ ]:
44
+ if response.status_code == 200:
45
+ response_200 = PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost.from_dict(
46
+ response.json()
47
+ )
48
+
49
+ return response_200
50
+ if response.status_code == 422:
51
+ response_422 = HTTPValidationError.from_dict(response.json())
52
+
53
+ return response_422
54
+ if client.raise_on_unexpected_status:
55
+ raise errors.UnexpectedStatus(response.status_code, response.content)
56
+ else:
57
+ return None
58
+
59
+
60
+ def _build_response(
61
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
62
+ ) -> Response[
63
+ Union[
64
+ HTTPValidationError,
65
+ PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost,
66
+ ]
67
+ ]:
68
+ return Response(
69
+ status_code=HTTPStatus(response.status_code),
70
+ content=response.content,
71
+ headers=response.headers,
72
+ parsed=_parse_response(client=client, response=response),
73
+ )
74
+
75
+
76
+ def sync_detailed(
77
+ machine_id: str,
78
+ *,
79
+ client: AuthenticatedClient,
80
+ body: PowerShellSessionRequest,
81
+ ) -> Response[
82
+ Union[
83
+ HTTPValidationError,
84
+ PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost,
85
+ ]
86
+ ]:
87
+ """Manage PowerShell session
88
+
89
+ Create or destroy PowerShell sessions on the machine.
90
+
91
+ Args:
92
+ machine_id (str):
93
+ body (PowerShellSessionRequest):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ Response[Union[HTTPValidationError, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost]]
101
+ """
102
+
103
+ kwargs = _get_kwargs(
104
+ machine_id=machine_id,
105
+ body=body,
106
+ )
107
+
108
+ response = client.get_httpx_client().request(
109
+ **kwargs,
110
+ )
111
+
112
+ return _build_response(client=client, response=response)
113
+
114
+
115
+ def sync(
116
+ machine_id: str,
117
+ *,
118
+ client: AuthenticatedClient,
119
+ body: PowerShellSessionRequest,
120
+ ) -> Optional[
121
+ Union[
122
+ HTTPValidationError,
123
+ PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost,
124
+ ]
125
+ ]:
126
+ """Manage PowerShell session
127
+
128
+ Create or destroy PowerShell sessions on the machine.
129
+
130
+ Args:
131
+ machine_id (str):
132
+ body (PowerShellSessionRequest):
133
+
134
+ Raises:
135
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
136
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
137
+
138
+ Returns:
139
+ Union[HTTPValidationError, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost]
140
+ """
141
+
142
+ return sync_detailed(
143
+ machine_id=machine_id,
144
+ client=client,
145
+ body=body,
146
+ ).parsed
147
+
148
+
149
+ async def asyncio_detailed(
150
+ machine_id: str,
151
+ *,
152
+ client: AuthenticatedClient,
153
+ body: PowerShellSessionRequest,
154
+ ) -> Response[
155
+ Union[
156
+ HTTPValidationError,
157
+ PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost,
158
+ ]
159
+ ]:
160
+ """Manage PowerShell session
161
+
162
+ Create or destroy PowerShell sessions on the machine.
163
+
164
+ Args:
165
+ machine_id (str):
166
+ body (PowerShellSessionRequest):
167
+
168
+ Raises:
169
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
170
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
171
+
172
+ Returns:
173
+ Response[Union[HTTPValidationError, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost]]
174
+ """
175
+
176
+ kwargs = _get_kwargs(
177
+ machine_id=machine_id,
178
+ body=body,
179
+ )
180
+
181
+ response = await client.get_async_httpx_client().request(**kwargs)
182
+
183
+ return _build_response(client=client, response=response)
184
+
185
+
186
+ async def asyncio(
187
+ machine_id: str,
188
+ *,
189
+ client: AuthenticatedClient,
190
+ body: PowerShellSessionRequest,
191
+ ) -> Optional[
192
+ Union[
193
+ HTTPValidationError,
194
+ PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost,
195
+ ]
196
+ ]:
197
+ """Manage PowerShell session
198
+
199
+ Create or destroy PowerShell sessions on the machine.
200
+
201
+ Args:
202
+ machine_id (str):
203
+ body (PowerShellSessionRequest):
204
+
205
+ Raises:
206
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
207
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
208
+
209
+ Returns:
210
+ Union[HTTPValidationError, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost]
211
+ """
212
+
213
+ return (
214
+ await asyncio_detailed(
215
+ machine_id=machine_id,
216
+ client=client,
217
+ body=body,
218
+ )
219
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,184 @@
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.run_attachment_create import RunAttachmentCreate
10
+ from ...models.run_attachment_response import RunAttachmentResponse
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ body: RunAttachmentCreate,
17
+ ) -> dict[str, Any]:
18
+ headers: dict[str, Any] = {}
19
+
20
+ _kwargs: dict[str, Any] = {
21
+ "method": "post",
22
+ "url": "/v1/run-attachments",
23
+ }
24
+
25
+ _kwargs["json"] = body.to_dict()
26
+
27
+ headers["Content-Type"] = "application/json"
28
+
29
+ _kwargs["headers"] = headers
30
+ return _kwargs
31
+
32
+
33
+ def _parse_response(
34
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
35
+ ) -> Optional[Union[HTTPValidationError, RunAttachmentResponse]]:
36
+ if response.status_code == 201:
37
+ response_201 = RunAttachmentResponse.from_dict(response.json())
38
+
39
+ return response_201
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[HTTPValidationError, RunAttachmentResponse]]:
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
+ *,
63
+ client: AuthenticatedClient,
64
+ body: RunAttachmentCreate,
65
+ ) -> Response[Union[HTTPValidationError, RunAttachmentResponse]]:
66
+ """Create Run Attachment
67
+
68
+ Create a new run attachment.
69
+
70
+ This endpoint is primarily for internal use. File uploads typically happen
71
+ through the run creation endpoint.
72
+
73
+ Args:
74
+ body (RunAttachmentCreate): Schema for creating a run attachment
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, RunAttachmentResponse]]
82
+ """
83
+
84
+ kwargs = _get_kwargs(
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
+ *,
97
+ client: AuthenticatedClient,
98
+ body: RunAttachmentCreate,
99
+ ) -> Optional[Union[HTTPValidationError, RunAttachmentResponse]]:
100
+ """Create Run Attachment
101
+
102
+ Create a new run attachment.
103
+
104
+ This endpoint is primarily for internal use. File uploads typically happen
105
+ through the run creation endpoint.
106
+
107
+ Args:
108
+ body (RunAttachmentCreate): Schema for creating a run attachment
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, RunAttachmentResponse]
116
+ """
117
+
118
+ return sync_detailed(
119
+ client=client,
120
+ body=body,
121
+ ).parsed
122
+
123
+
124
+ async def asyncio_detailed(
125
+ *,
126
+ client: AuthenticatedClient,
127
+ body: RunAttachmentCreate,
128
+ ) -> Response[Union[HTTPValidationError, RunAttachmentResponse]]:
129
+ """Create Run Attachment
130
+
131
+ Create a new run attachment.
132
+
133
+ This endpoint is primarily for internal use. File uploads typically happen
134
+ through the run creation endpoint.
135
+
136
+ Args:
137
+ body (RunAttachmentCreate): Schema for creating a run attachment
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, RunAttachmentResponse]]
145
+ """
146
+
147
+ kwargs = _get_kwargs(
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
+ *,
158
+ client: AuthenticatedClient,
159
+ body: RunAttachmentCreate,
160
+ ) -> Optional[Union[HTTPValidationError, RunAttachmentResponse]]:
161
+ """Create Run Attachment
162
+
163
+ Create a new run attachment.
164
+
165
+ This endpoint is primarily for internal use. File uploads typically happen
166
+ through the run creation endpoint.
167
+
168
+ Args:
169
+ body (RunAttachmentCreate): Schema for creating a run attachment
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, RunAttachmentResponse]
177
+ """
178
+
179
+ return (
180
+ await asyncio_detailed(
181
+ client=client,
182
+ body=body,
183
+ )
184
+ ).parsed