cyberdesk 1.7.0__py3-none-any.whl → 1.9.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.
- cyberdesk/__init__.py +11 -1
- cyberdesk/client.py +188 -0
- {cyberdesk-1.7.0.dist-info → cyberdesk-1.9.0.dist-info}/METADATA +39 -17
- {cyberdesk-1.7.0.dist-info → cyberdesk-1.9.0.dist-info}/RECORD +43 -15
- openapi_client/cyberdesk_cloud_client/api/computer/fs_list_v1_computer_machine_id_fs_list_get.py +188 -0
- openapi_client/cyberdesk_cloud_client/api/computer/fs_read_v1_computer_machine_id_fs_read_get.py +188 -0
- openapi_client/cyberdesk_cloud_client/api/computer/fs_write_v1_computer_machine_id_fs_write_post.py +201 -0
- openapi_client/cyberdesk_cloud_client/api/computer/powershell_exec_v1_computer_machine_id_shell_powershell_exec_post.py +219 -0
- openapi_client/cyberdesk_cloud_client/api/computer/powershell_session_v1_computer_machine_id_shell_powershell_session_post.py +219 -0
- openapi_client/cyberdesk_cloud_client/api/run_attachments/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/run_attachments/create_run_attachment_v1_run_attachments_post.py +184 -0
- openapi_client/cyberdesk_cloud_client/api/run_attachments/delete_run_attachment_v1_run_attachments_attachment_id_delete.py +170 -0
- openapi_client/cyberdesk_cloud_client/api/run_attachments/download_run_attachment_v1_run_attachments_attachment_id_download_get.py +170 -0
- openapi_client/cyberdesk_cloud_client/api/run_attachments/get_run_attachment_v1_run_attachments_attachment_id_get.py +172 -0
- openapi_client/cyberdesk_cloud_client/api/run_attachments/list_run_attachments_v1_run_attachments_get.py +240 -0
- openapi_client/cyberdesk_cloud_client/api/run_attachments/update_run_attachment_v1_run_attachments_attachment_id_put.py +194 -0
- openapi_client/cyberdesk_cloud_client/models/__init__.py +42 -0
- openapi_client/cyberdesk_cloud_client/models/attachment_type.py +9 -0
- openapi_client/cyberdesk_cloud_client/models/file_input.py +99 -0
- openapi_client/cyberdesk_cloud_client/models/file_write_request.py +78 -0
- 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
- 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
- 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
- openapi_client/cyberdesk_cloud_client/models/paginated_response_run_attachment_response.py +97 -0
- openapi_client/cyberdesk_cloud_client/models/power_shell_exec_request.py +110 -0
- openapi_client/cyberdesk_cloud_client/models/power_shell_session_request.py +81 -0
- 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
- 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
- openapi_client/cyberdesk_cloud_client/models/run_attachment_create.py +157 -0
- openapi_client/cyberdesk_cloud_client/models/run_attachment_response.py +189 -0
- openapi_client/cyberdesk_cloud_client/models/run_attachment_update.py +84 -0
- openapi_client/cyberdesk_cloud_client/models/run_create.py +41 -0
- openapi_client/cyberdesk_cloud_client/models/run_response.py +26 -0
- openapi_client/cyberdesk_cloud_client/models/trajectory_create.py +40 -1
- openapi_client/cyberdesk_cloud_client/models/trajectory_create_original_input_values_type_0.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/trajectory_response.py +40 -1
- openapi_client/cyberdesk_cloud_client/models/trajectory_response_original_input_values_type_0.py +44 -0
- openapi_client/cyberdesk_cloud_client/models/workflow_create.py +9 -0
- openapi_client/cyberdesk_cloud_client/models/workflow_response.py +9 -0
- openapi_client/cyberdesk_cloud_client/models/workflow_update.py +20 -0
- {cyberdesk-1.7.0.dist-info → cyberdesk-1.9.0.dist-info}/WHEEL +0 -0
- {cyberdesk-1.7.0.dist-info → cyberdesk-1.9.0.dist-info}/licenses/LICENSE +0 -0
- {cyberdesk-1.7.0.dist-info → cyberdesk-1.9.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_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
|
|
@@ -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
|