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,170 @@
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
+ attachment_id: UUID,
15
+ ) -> dict[str, Any]:
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "delete",
18
+ "url": f"/v1/run-attachments/{attachment_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
+ attachment_id: UUID,
53
+ *,
54
+ client: AuthenticatedClient,
55
+ ) -> Response[Union[Any, HTTPValidationError]]:
56
+ """Delete Run Attachment
57
+
58
+ Delete a run attachment.
59
+
60
+ This will remove both the database record and the file from Supabase storage.
61
+
62
+ Args:
63
+ attachment_id (UUID):
64
+
65
+ Raises:
66
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
67
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
68
+
69
+ Returns:
70
+ Response[Union[Any, HTTPValidationError]]
71
+ """
72
+
73
+ kwargs = _get_kwargs(
74
+ attachment_id=attachment_id,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ def sync(
85
+ attachment_id: UUID,
86
+ *,
87
+ client: AuthenticatedClient,
88
+ ) -> Optional[Union[Any, HTTPValidationError]]:
89
+ """Delete Run Attachment
90
+
91
+ Delete a run attachment.
92
+
93
+ This will remove both the database record and the file from Supabase storage.
94
+
95
+ Args:
96
+ attachment_id (UUID):
97
+
98
+ Raises:
99
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
100
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
101
+
102
+ Returns:
103
+ Union[Any, HTTPValidationError]
104
+ """
105
+
106
+ return sync_detailed(
107
+ attachment_id=attachment_id,
108
+ client=client,
109
+ ).parsed
110
+
111
+
112
+ async def asyncio_detailed(
113
+ attachment_id: UUID,
114
+ *,
115
+ client: AuthenticatedClient,
116
+ ) -> Response[Union[Any, HTTPValidationError]]:
117
+ """Delete Run Attachment
118
+
119
+ Delete a run attachment.
120
+
121
+ This will remove both the database record and the file from Supabase storage.
122
+
123
+ Args:
124
+ attachment_id (UUID):
125
+
126
+ Raises:
127
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
128
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
129
+
130
+ Returns:
131
+ Response[Union[Any, HTTPValidationError]]
132
+ """
133
+
134
+ kwargs = _get_kwargs(
135
+ attachment_id=attachment_id,
136
+ )
137
+
138
+ response = await client.get_async_httpx_client().request(**kwargs)
139
+
140
+ return _build_response(client=client, response=response)
141
+
142
+
143
+ async def asyncio(
144
+ attachment_id: UUID,
145
+ *,
146
+ client: AuthenticatedClient,
147
+ ) -> Optional[Union[Any, HTTPValidationError]]:
148
+ """Delete Run Attachment
149
+
150
+ Delete a run attachment.
151
+
152
+ This will remove both the database record and the file from Supabase storage.
153
+
154
+ Args:
155
+ attachment_id (UUID):
156
+
157
+ Raises:
158
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
159
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
160
+
161
+ Returns:
162
+ Union[Any, HTTPValidationError]
163
+ """
164
+
165
+ return (
166
+ await asyncio_detailed(
167
+ attachment_id=attachment_id,
168
+ client=client,
169
+ )
170
+ ).parsed
@@ -0,0 +1,170 @@
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 ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ attachment_id: UUID,
15
+ ) -> dict[str, Any]:
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "get",
18
+ "url": f"/v1/run-attachments/{attachment_id}/download",
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 == 200:
28
+ response_200 = response.json()
29
+ return response_200
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
+ attachment_id: UUID,
53
+ *,
54
+ client: AuthenticatedClient,
55
+ ) -> Response[Union[Any, HTTPValidationError]]:
56
+ """Download Run Attachment
57
+
58
+ Download a run attachment file.
59
+
60
+ Returns the raw file content as a streaming response.
61
+
62
+ Args:
63
+ attachment_id (UUID):
64
+
65
+ Raises:
66
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
67
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
68
+
69
+ Returns:
70
+ Response[Union[Any, HTTPValidationError]]
71
+ """
72
+
73
+ kwargs = _get_kwargs(
74
+ attachment_id=attachment_id,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ def sync(
85
+ attachment_id: UUID,
86
+ *,
87
+ client: AuthenticatedClient,
88
+ ) -> Optional[Union[Any, HTTPValidationError]]:
89
+ """Download Run Attachment
90
+
91
+ Download a run attachment file.
92
+
93
+ Returns the raw file content as a streaming response.
94
+
95
+ Args:
96
+ attachment_id (UUID):
97
+
98
+ Raises:
99
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
100
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
101
+
102
+ Returns:
103
+ Union[Any, HTTPValidationError]
104
+ """
105
+
106
+ return sync_detailed(
107
+ attachment_id=attachment_id,
108
+ client=client,
109
+ ).parsed
110
+
111
+
112
+ async def asyncio_detailed(
113
+ attachment_id: UUID,
114
+ *,
115
+ client: AuthenticatedClient,
116
+ ) -> Response[Union[Any, HTTPValidationError]]:
117
+ """Download Run Attachment
118
+
119
+ Download a run attachment file.
120
+
121
+ Returns the raw file content as a streaming response.
122
+
123
+ Args:
124
+ attachment_id (UUID):
125
+
126
+ Raises:
127
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
128
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
129
+
130
+ Returns:
131
+ Response[Union[Any, HTTPValidationError]]
132
+ """
133
+
134
+ kwargs = _get_kwargs(
135
+ attachment_id=attachment_id,
136
+ )
137
+
138
+ response = await client.get_async_httpx_client().request(**kwargs)
139
+
140
+ return _build_response(client=client, response=response)
141
+
142
+
143
+ async def asyncio(
144
+ attachment_id: UUID,
145
+ *,
146
+ client: AuthenticatedClient,
147
+ ) -> Optional[Union[Any, HTTPValidationError]]:
148
+ """Download Run Attachment
149
+
150
+ Download a run attachment file.
151
+
152
+ Returns the raw file content as a streaming response.
153
+
154
+ Args:
155
+ attachment_id (UUID):
156
+
157
+ Raises:
158
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
159
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
160
+
161
+ Returns:
162
+ Union[Any, HTTPValidationError]
163
+ """
164
+
165
+ return (
166
+ await asyncio_detailed(
167
+ attachment_id=attachment_id,
168
+ client=client,
169
+ )
170
+ ).parsed
@@ -0,0 +1,209 @@
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.run_attachment_download_url_response import RunAttachmentDownloadUrlResponse
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ attachment_id: UUID,
16
+ *,
17
+ expires_in: Union[Unset, int] = 300,
18
+ ) -> dict[str, Any]:
19
+ params: dict[str, Any] = {}
20
+
21
+ params["expires_in"] = expires_in
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/run-attachments/{attachment_id}/download-url",
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, RunAttachmentDownloadUrlResponse]]:
37
+ if response.status_code == 200:
38
+ response_200 = RunAttachmentDownloadUrlResponse.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, RunAttachmentDownloadUrlResponse]]:
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
+ attachment_id: UUID,
64
+ *,
65
+ client: AuthenticatedClient,
66
+ expires_in: Union[Unset, int] = 300,
67
+ ) -> Response[Union[HTTPValidationError, RunAttachmentDownloadUrlResponse]]:
68
+ """Get Run Attachment Download Url
69
+
70
+ Get a signed download URL for a run attachment file.
71
+
72
+ Returns a signed URL that triggers automatic download when accessed.
73
+
74
+ Args:
75
+ attachment_id: The ID of the attachment to download
76
+ expires_in: URL expiration time in seconds (10-3600). Default: 300 (5 minutes)
77
+
78
+ Args:
79
+ attachment_id (UUID):
80
+ expires_in (Union[Unset, int]): URL expiration time in seconds (10-3600) Default: 300.
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
+ Response[Union[HTTPValidationError, RunAttachmentDownloadUrlResponse]]
88
+ """
89
+
90
+ kwargs = _get_kwargs(
91
+ attachment_id=attachment_id,
92
+ expires_in=expires_in,
93
+ )
94
+
95
+ response = client.get_httpx_client().request(
96
+ **kwargs,
97
+ )
98
+
99
+ return _build_response(client=client, response=response)
100
+
101
+
102
+ def sync(
103
+ attachment_id: UUID,
104
+ *,
105
+ client: AuthenticatedClient,
106
+ expires_in: Union[Unset, int] = 300,
107
+ ) -> Optional[Union[HTTPValidationError, RunAttachmentDownloadUrlResponse]]:
108
+ """Get Run Attachment Download Url
109
+
110
+ Get a signed download URL for a run attachment file.
111
+
112
+ Returns a signed URL that triggers automatic download when accessed.
113
+
114
+ Args:
115
+ attachment_id: The ID of the attachment to download
116
+ expires_in: URL expiration time in seconds (10-3600). Default: 300 (5 minutes)
117
+
118
+ Args:
119
+ attachment_id (UUID):
120
+ expires_in (Union[Unset, int]): URL expiration time in seconds (10-3600) Default: 300.
121
+
122
+ Raises:
123
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
124
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
125
+
126
+ Returns:
127
+ Union[HTTPValidationError, RunAttachmentDownloadUrlResponse]
128
+ """
129
+
130
+ return sync_detailed(
131
+ attachment_id=attachment_id,
132
+ client=client,
133
+ expires_in=expires_in,
134
+ ).parsed
135
+
136
+
137
+ async def asyncio_detailed(
138
+ attachment_id: UUID,
139
+ *,
140
+ client: AuthenticatedClient,
141
+ expires_in: Union[Unset, int] = 300,
142
+ ) -> Response[Union[HTTPValidationError, RunAttachmentDownloadUrlResponse]]:
143
+ """Get Run Attachment Download Url
144
+
145
+ Get a signed download URL for a run attachment file.
146
+
147
+ Returns a signed URL that triggers automatic download when accessed.
148
+
149
+ Args:
150
+ attachment_id: The ID of the attachment to download
151
+ expires_in: URL expiration time in seconds (10-3600). Default: 300 (5 minutes)
152
+
153
+ Args:
154
+ attachment_id (UUID):
155
+ expires_in (Union[Unset, int]): URL expiration time in seconds (10-3600) Default: 300.
156
+
157
+ Raises:
158
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
159
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
160
+
161
+ Returns:
162
+ Response[Union[HTTPValidationError, RunAttachmentDownloadUrlResponse]]
163
+ """
164
+
165
+ kwargs = _get_kwargs(
166
+ attachment_id=attachment_id,
167
+ expires_in=expires_in,
168
+ )
169
+
170
+ response = await client.get_async_httpx_client().request(**kwargs)
171
+
172
+ return _build_response(client=client, response=response)
173
+
174
+
175
+ async def asyncio(
176
+ attachment_id: UUID,
177
+ *,
178
+ client: AuthenticatedClient,
179
+ expires_in: Union[Unset, int] = 300,
180
+ ) -> Optional[Union[HTTPValidationError, RunAttachmentDownloadUrlResponse]]:
181
+ """Get Run Attachment Download Url
182
+
183
+ Get a signed download URL for a run attachment file.
184
+
185
+ Returns a signed URL that triggers automatic download when accessed.
186
+
187
+ Args:
188
+ attachment_id: The ID of the attachment to download
189
+ expires_in: URL expiration time in seconds (10-3600). Default: 300 (5 minutes)
190
+
191
+ Args:
192
+ attachment_id (UUID):
193
+ expires_in (Union[Unset, int]): URL expiration time in seconds (10-3600) Default: 300.
194
+
195
+ Raises:
196
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
197
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
198
+
199
+ Returns:
200
+ Union[HTTPValidationError, RunAttachmentDownloadUrlResponse]
201
+ """
202
+
203
+ return (
204
+ await asyncio_detailed(
205
+ attachment_id=attachment_id,
206
+ client=client,
207
+ expires_in=expires_in,
208
+ )
209
+ ).parsed
@@ -0,0 +1,172 @@
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.run_attachment_response import RunAttachmentResponse
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ attachment_id: UUID,
16
+ ) -> dict[str, Any]:
17
+ _kwargs: dict[str, Any] = {
18
+ "method": "get",
19
+ "url": f"/v1/run-attachments/{attachment_id}",
20
+ }
21
+
22
+ return _kwargs
23
+
24
+
25
+ def _parse_response(
26
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
27
+ ) -> Optional[Union[HTTPValidationError, RunAttachmentResponse]]:
28
+ if response.status_code == 200:
29
+ response_200 = RunAttachmentResponse.from_dict(response.json())
30
+
31
+ return response_200
32
+ if response.status_code == 422:
33
+ response_422 = HTTPValidationError.from_dict(response.json())
34
+
35
+ return response_422
36
+ if client.raise_on_unexpected_status:
37
+ raise errors.UnexpectedStatus(response.status_code, response.content)
38
+ else:
39
+ return None
40
+
41
+
42
+ def _build_response(
43
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
+ ) -> Response[Union[HTTPValidationError, RunAttachmentResponse]]:
45
+ return Response(
46
+ status_code=HTTPStatus(response.status_code),
47
+ content=response.content,
48
+ headers=response.headers,
49
+ parsed=_parse_response(client=client, response=response),
50
+ )
51
+
52
+
53
+ def sync_detailed(
54
+ attachment_id: UUID,
55
+ *,
56
+ client: AuthenticatedClient,
57
+ ) -> Response[Union[HTTPValidationError, RunAttachmentResponse]]:
58
+ """Get Run Attachment
59
+
60
+ Get a specific run attachment by ID.
61
+
62
+ Returns attachment metadata only. Use the download endpoint to get file content.
63
+
64
+ Args:
65
+ attachment_id (UUID):
66
+
67
+ Raises:
68
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
69
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
70
+
71
+ Returns:
72
+ Response[Union[HTTPValidationError, RunAttachmentResponse]]
73
+ """
74
+
75
+ kwargs = _get_kwargs(
76
+ attachment_id=attachment_id,
77
+ )
78
+
79
+ response = client.get_httpx_client().request(
80
+ **kwargs,
81
+ )
82
+
83
+ return _build_response(client=client, response=response)
84
+
85
+
86
+ def sync(
87
+ attachment_id: UUID,
88
+ *,
89
+ client: AuthenticatedClient,
90
+ ) -> Optional[Union[HTTPValidationError, RunAttachmentResponse]]:
91
+ """Get Run Attachment
92
+
93
+ Get a specific run attachment by ID.
94
+
95
+ Returns attachment metadata only. Use the download endpoint to get file content.
96
+
97
+ Args:
98
+ attachment_id (UUID):
99
+
100
+ Raises:
101
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
103
+
104
+ Returns:
105
+ Union[HTTPValidationError, RunAttachmentResponse]
106
+ """
107
+
108
+ return sync_detailed(
109
+ attachment_id=attachment_id,
110
+ client=client,
111
+ ).parsed
112
+
113
+
114
+ async def asyncio_detailed(
115
+ attachment_id: UUID,
116
+ *,
117
+ client: AuthenticatedClient,
118
+ ) -> Response[Union[HTTPValidationError, RunAttachmentResponse]]:
119
+ """Get Run Attachment
120
+
121
+ Get a specific run attachment by ID.
122
+
123
+ Returns attachment metadata only. Use the download endpoint to get file content.
124
+
125
+ Args:
126
+ attachment_id (UUID):
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
+ Response[Union[HTTPValidationError, RunAttachmentResponse]]
134
+ """
135
+
136
+ kwargs = _get_kwargs(
137
+ attachment_id=attachment_id,
138
+ )
139
+
140
+ response = await client.get_async_httpx_client().request(**kwargs)
141
+
142
+ return _build_response(client=client, response=response)
143
+
144
+
145
+ async def asyncio(
146
+ attachment_id: UUID,
147
+ *,
148
+ client: AuthenticatedClient,
149
+ ) -> Optional[Union[HTTPValidationError, RunAttachmentResponse]]:
150
+ """Get Run Attachment
151
+
152
+ Get a specific run attachment by ID.
153
+
154
+ Returns attachment metadata only. Use the download endpoint to get file content.
155
+
156
+ Args:
157
+ attachment_id (UUID):
158
+
159
+ Raises:
160
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
161
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
162
+
163
+ Returns:
164
+ Union[HTTPValidationError, RunAttachmentResponse]
165
+ """
166
+
167
+ return (
168
+ await asyncio_detailed(
169
+ attachment_id=attachment_id,
170
+ client=client,
171
+ )
172
+ ).parsed