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.
- cyberdesk/__init__.py +13 -1
- cyberdesk/client.py +357 -0
- {cyberdesk-1.8.0.dist-info → cyberdesk-1.10.0.dist-info}/METADATA +39 -17
- {cyberdesk-1.8.0.dist-info → cyberdesk-1.10.0.dist-info}/RECORD +41 -13
- 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_download_url_v1_run_attachments_attachment_id_download_url_get.py +209 -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 +40 -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_download_url_response.py +68 -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/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.8.0.dist-info → cyberdesk-1.10.0.dist-info}/WHEEL +0 -0
- {cyberdesk-1.8.0.dist-info → cyberdesk-1.10.0.dist-info}/licenses/LICENSE +0 -0
- {cyberdesk-1.8.0.dist-info → cyberdesk-1.10.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any, TypeVar, Union, cast
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
from dateutil.parser import isoparse
|
|
9
|
+
|
|
10
|
+
from ..models.attachment_type import AttachmentType
|
|
11
|
+
from ..types import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="RunAttachmentCreate")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class RunAttachmentCreate:
|
|
18
|
+
"""Schema for creating a run attachment
|
|
19
|
+
|
|
20
|
+
Attributes:
|
|
21
|
+
run_id (UUID):
|
|
22
|
+
filename (str):
|
|
23
|
+
content (str): Base64 encoded file content
|
|
24
|
+
content_type (str):
|
|
25
|
+
attachment_type (AttachmentType):
|
|
26
|
+
target_path (Union[None, Unset, str]):
|
|
27
|
+
cleanup_imports_after_run (Union[Unset, bool]): Default: False.
|
|
28
|
+
expires_at (Union[None, Unset, datetime.datetime]):
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
run_id: UUID
|
|
32
|
+
filename: str
|
|
33
|
+
content: str
|
|
34
|
+
content_type: str
|
|
35
|
+
attachment_type: AttachmentType
|
|
36
|
+
target_path: Union[None, Unset, str] = UNSET
|
|
37
|
+
cleanup_imports_after_run: Union[Unset, bool] = False
|
|
38
|
+
expires_at: Union[None, Unset, datetime.datetime] = UNSET
|
|
39
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
40
|
+
|
|
41
|
+
def to_dict(self) -> dict[str, Any]:
|
|
42
|
+
run_id = str(self.run_id)
|
|
43
|
+
|
|
44
|
+
filename = self.filename
|
|
45
|
+
|
|
46
|
+
content = self.content
|
|
47
|
+
|
|
48
|
+
content_type = self.content_type
|
|
49
|
+
|
|
50
|
+
attachment_type = self.attachment_type.value
|
|
51
|
+
|
|
52
|
+
target_path: Union[None, Unset, str]
|
|
53
|
+
if isinstance(self.target_path, Unset):
|
|
54
|
+
target_path = UNSET
|
|
55
|
+
else:
|
|
56
|
+
target_path = self.target_path
|
|
57
|
+
|
|
58
|
+
cleanup_imports_after_run = self.cleanup_imports_after_run
|
|
59
|
+
|
|
60
|
+
expires_at: Union[None, Unset, str]
|
|
61
|
+
if isinstance(self.expires_at, Unset):
|
|
62
|
+
expires_at = UNSET
|
|
63
|
+
elif isinstance(self.expires_at, datetime.datetime):
|
|
64
|
+
expires_at = self.expires_at.isoformat()
|
|
65
|
+
else:
|
|
66
|
+
expires_at = self.expires_at
|
|
67
|
+
|
|
68
|
+
field_dict: dict[str, Any] = {}
|
|
69
|
+
field_dict.update(self.additional_properties)
|
|
70
|
+
field_dict.update(
|
|
71
|
+
{
|
|
72
|
+
"run_id": run_id,
|
|
73
|
+
"filename": filename,
|
|
74
|
+
"content": content,
|
|
75
|
+
"content_type": content_type,
|
|
76
|
+
"attachment_type": attachment_type,
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
if target_path is not UNSET:
|
|
80
|
+
field_dict["target_path"] = target_path
|
|
81
|
+
if cleanup_imports_after_run is not UNSET:
|
|
82
|
+
field_dict["cleanup_imports_after_run"] = cleanup_imports_after_run
|
|
83
|
+
if expires_at is not UNSET:
|
|
84
|
+
field_dict["expires_at"] = expires_at
|
|
85
|
+
|
|
86
|
+
return field_dict
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
90
|
+
d = dict(src_dict)
|
|
91
|
+
run_id = UUID(d.pop("run_id"))
|
|
92
|
+
|
|
93
|
+
filename = d.pop("filename")
|
|
94
|
+
|
|
95
|
+
content = d.pop("content")
|
|
96
|
+
|
|
97
|
+
content_type = d.pop("content_type")
|
|
98
|
+
|
|
99
|
+
attachment_type = AttachmentType(d.pop("attachment_type"))
|
|
100
|
+
|
|
101
|
+
def _parse_target_path(data: object) -> Union[None, Unset, str]:
|
|
102
|
+
if data is None:
|
|
103
|
+
return data
|
|
104
|
+
if isinstance(data, Unset):
|
|
105
|
+
return data
|
|
106
|
+
return cast(Union[None, Unset, str], data)
|
|
107
|
+
|
|
108
|
+
target_path = _parse_target_path(d.pop("target_path", UNSET))
|
|
109
|
+
|
|
110
|
+
cleanup_imports_after_run = d.pop("cleanup_imports_after_run", UNSET)
|
|
111
|
+
|
|
112
|
+
def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
113
|
+
if data is None:
|
|
114
|
+
return data
|
|
115
|
+
if isinstance(data, Unset):
|
|
116
|
+
return data
|
|
117
|
+
try:
|
|
118
|
+
if not isinstance(data, str):
|
|
119
|
+
raise TypeError()
|
|
120
|
+
expires_at_type_0 = isoparse(data)
|
|
121
|
+
|
|
122
|
+
return expires_at_type_0
|
|
123
|
+
except: # noqa: E722
|
|
124
|
+
pass
|
|
125
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
126
|
+
|
|
127
|
+
expires_at = _parse_expires_at(d.pop("expires_at", UNSET))
|
|
128
|
+
|
|
129
|
+
run_attachment_create = cls(
|
|
130
|
+
run_id=run_id,
|
|
131
|
+
filename=filename,
|
|
132
|
+
content=content,
|
|
133
|
+
content_type=content_type,
|
|
134
|
+
attachment_type=attachment_type,
|
|
135
|
+
target_path=target_path,
|
|
136
|
+
cleanup_imports_after_run=cleanup_imports_after_run,
|
|
137
|
+
expires_at=expires_at,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
run_attachment_create.additional_properties = d
|
|
141
|
+
return run_attachment_create
|
|
142
|
+
|
|
143
|
+
@property
|
|
144
|
+
def additional_keys(self) -> list[str]:
|
|
145
|
+
return list(self.additional_properties.keys())
|
|
146
|
+
|
|
147
|
+
def __getitem__(self, key: str) -> Any:
|
|
148
|
+
return self.additional_properties[key]
|
|
149
|
+
|
|
150
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
151
|
+
self.additional_properties[key] = value
|
|
152
|
+
|
|
153
|
+
def __delitem__(self, key: str) -> None:
|
|
154
|
+
del self.additional_properties[key]
|
|
155
|
+
|
|
156
|
+
def __contains__(self, key: str) -> bool:
|
|
157
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="RunAttachmentDownloadUrlResponse")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class RunAttachmentDownloadUrlResponse:
|
|
12
|
+
"""Response schema for run attachment download URL
|
|
13
|
+
|
|
14
|
+
Attributes:
|
|
15
|
+
url (str): Signed URL for downloading the attachment
|
|
16
|
+
expires_in (int): Seconds until the URL expires
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
url: str
|
|
20
|
+
expires_in: int
|
|
21
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
22
|
+
|
|
23
|
+
def to_dict(self) -> dict[str, Any]:
|
|
24
|
+
url = self.url
|
|
25
|
+
|
|
26
|
+
expires_in = self.expires_in
|
|
27
|
+
|
|
28
|
+
field_dict: dict[str, Any] = {}
|
|
29
|
+
field_dict.update(self.additional_properties)
|
|
30
|
+
field_dict.update(
|
|
31
|
+
{
|
|
32
|
+
"url": url,
|
|
33
|
+
"expires_in": expires_in,
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
return field_dict
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
url = d.pop("url")
|
|
43
|
+
|
|
44
|
+
expires_in = d.pop("expires_in")
|
|
45
|
+
|
|
46
|
+
run_attachment_download_url_response = cls(
|
|
47
|
+
url=url,
|
|
48
|
+
expires_in=expires_in,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
run_attachment_download_url_response.additional_properties = d
|
|
52
|
+
return run_attachment_download_url_response
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def additional_keys(self) -> list[str]:
|
|
56
|
+
return list(self.additional_properties.keys())
|
|
57
|
+
|
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
|
59
|
+
return self.additional_properties[key]
|
|
60
|
+
|
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
62
|
+
self.additional_properties[key] = value
|
|
63
|
+
|
|
64
|
+
def __delitem__(self, key: str) -> None:
|
|
65
|
+
del self.additional_properties[key]
|
|
66
|
+
|
|
67
|
+
def __contains__(self, key: str) -> bool:
|
|
68
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any, TypeVar, Union, cast
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
from dateutil.parser import isoparse
|
|
9
|
+
|
|
10
|
+
from ..models.attachment_type import AttachmentType
|
|
11
|
+
from ..types import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="RunAttachmentResponse")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class RunAttachmentResponse:
|
|
18
|
+
"""Run attachment response schema
|
|
19
|
+
|
|
20
|
+
Attributes:
|
|
21
|
+
filename (str):
|
|
22
|
+
content_type (str):
|
|
23
|
+
attachment_type (AttachmentType):
|
|
24
|
+
id (UUID):
|
|
25
|
+
user_id (UUID):
|
|
26
|
+
run_id (UUID):
|
|
27
|
+
size_bytes (int):
|
|
28
|
+
storage_path (str):
|
|
29
|
+
created_at (datetime.datetime):
|
|
30
|
+
target_path (Union[None, Unset, str]):
|
|
31
|
+
cleanup_imports_after_run (Union[Unset, bool]): Default: False.
|
|
32
|
+
expires_at (Union[None, Unset, datetime.datetime]):
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
filename: str
|
|
36
|
+
content_type: str
|
|
37
|
+
attachment_type: AttachmentType
|
|
38
|
+
id: UUID
|
|
39
|
+
user_id: UUID
|
|
40
|
+
run_id: UUID
|
|
41
|
+
size_bytes: int
|
|
42
|
+
storage_path: str
|
|
43
|
+
created_at: datetime.datetime
|
|
44
|
+
target_path: Union[None, Unset, str] = UNSET
|
|
45
|
+
cleanup_imports_after_run: Union[Unset, bool] = False
|
|
46
|
+
expires_at: Union[None, Unset, datetime.datetime] = UNSET
|
|
47
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
48
|
+
|
|
49
|
+
def to_dict(self) -> dict[str, Any]:
|
|
50
|
+
filename = self.filename
|
|
51
|
+
|
|
52
|
+
content_type = self.content_type
|
|
53
|
+
|
|
54
|
+
attachment_type = self.attachment_type.value
|
|
55
|
+
|
|
56
|
+
id = str(self.id)
|
|
57
|
+
|
|
58
|
+
user_id = str(self.user_id)
|
|
59
|
+
|
|
60
|
+
run_id = str(self.run_id)
|
|
61
|
+
|
|
62
|
+
size_bytes = self.size_bytes
|
|
63
|
+
|
|
64
|
+
storage_path = self.storage_path
|
|
65
|
+
|
|
66
|
+
created_at = self.created_at.isoformat()
|
|
67
|
+
|
|
68
|
+
target_path: Union[None, Unset, str]
|
|
69
|
+
if isinstance(self.target_path, Unset):
|
|
70
|
+
target_path = UNSET
|
|
71
|
+
else:
|
|
72
|
+
target_path = self.target_path
|
|
73
|
+
|
|
74
|
+
cleanup_imports_after_run = self.cleanup_imports_after_run
|
|
75
|
+
|
|
76
|
+
expires_at: Union[None, Unset, str]
|
|
77
|
+
if isinstance(self.expires_at, Unset):
|
|
78
|
+
expires_at = UNSET
|
|
79
|
+
elif isinstance(self.expires_at, datetime.datetime):
|
|
80
|
+
expires_at = self.expires_at.isoformat()
|
|
81
|
+
else:
|
|
82
|
+
expires_at = self.expires_at
|
|
83
|
+
|
|
84
|
+
field_dict: dict[str, Any] = {}
|
|
85
|
+
field_dict.update(self.additional_properties)
|
|
86
|
+
field_dict.update(
|
|
87
|
+
{
|
|
88
|
+
"filename": filename,
|
|
89
|
+
"content_type": content_type,
|
|
90
|
+
"attachment_type": attachment_type,
|
|
91
|
+
"id": id,
|
|
92
|
+
"user_id": user_id,
|
|
93
|
+
"run_id": run_id,
|
|
94
|
+
"size_bytes": size_bytes,
|
|
95
|
+
"storage_path": storage_path,
|
|
96
|
+
"created_at": created_at,
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
if target_path is not UNSET:
|
|
100
|
+
field_dict["target_path"] = target_path
|
|
101
|
+
if cleanup_imports_after_run is not UNSET:
|
|
102
|
+
field_dict["cleanup_imports_after_run"] = cleanup_imports_after_run
|
|
103
|
+
if expires_at is not UNSET:
|
|
104
|
+
field_dict["expires_at"] = expires_at
|
|
105
|
+
|
|
106
|
+
return field_dict
|
|
107
|
+
|
|
108
|
+
@classmethod
|
|
109
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
110
|
+
d = dict(src_dict)
|
|
111
|
+
filename = d.pop("filename")
|
|
112
|
+
|
|
113
|
+
content_type = d.pop("content_type")
|
|
114
|
+
|
|
115
|
+
attachment_type = AttachmentType(d.pop("attachment_type"))
|
|
116
|
+
|
|
117
|
+
id = UUID(d.pop("id"))
|
|
118
|
+
|
|
119
|
+
user_id = UUID(d.pop("user_id"))
|
|
120
|
+
|
|
121
|
+
run_id = UUID(d.pop("run_id"))
|
|
122
|
+
|
|
123
|
+
size_bytes = d.pop("size_bytes")
|
|
124
|
+
|
|
125
|
+
storage_path = d.pop("storage_path")
|
|
126
|
+
|
|
127
|
+
created_at = isoparse(d.pop("created_at"))
|
|
128
|
+
|
|
129
|
+
def _parse_target_path(data: object) -> Union[None, Unset, str]:
|
|
130
|
+
if data is None:
|
|
131
|
+
return data
|
|
132
|
+
if isinstance(data, Unset):
|
|
133
|
+
return data
|
|
134
|
+
return cast(Union[None, Unset, str], data)
|
|
135
|
+
|
|
136
|
+
target_path = _parse_target_path(d.pop("target_path", UNSET))
|
|
137
|
+
|
|
138
|
+
cleanup_imports_after_run = d.pop("cleanup_imports_after_run", UNSET)
|
|
139
|
+
|
|
140
|
+
def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
141
|
+
if data is None:
|
|
142
|
+
return data
|
|
143
|
+
if isinstance(data, Unset):
|
|
144
|
+
return data
|
|
145
|
+
try:
|
|
146
|
+
if not isinstance(data, str):
|
|
147
|
+
raise TypeError()
|
|
148
|
+
expires_at_type_0 = isoparse(data)
|
|
149
|
+
|
|
150
|
+
return expires_at_type_0
|
|
151
|
+
except: # noqa: E722
|
|
152
|
+
pass
|
|
153
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
154
|
+
|
|
155
|
+
expires_at = _parse_expires_at(d.pop("expires_at", UNSET))
|
|
156
|
+
|
|
157
|
+
run_attachment_response = cls(
|
|
158
|
+
filename=filename,
|
|
159
|
+
content_type=content_type,
|
|
160
|
+
attachment_type=attachment_type,
|
|
161
|
+
id=id,
|
|
162
|
+
user_id=user_id,
|
|
163
|
+
run_id=run_id,
|
|
164
|
+
size_bytes=size_bytes,
|
|
165
|
+
storage_path=storage_path,
|
|
166
|
+
created_at=created_at,
|
|
167
|
+
target_path=target_path,
|
|
168
|
+
cleanup_imports_after_run=cleanup_imports_after_run,
|
|
169
|
+
expires_at=expires_at,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
run_attachment_response.additional_properties = d
|
|
173
|
+
return run_attachment_response
|
|
174
|
+
|
|
175
|
+
@property
|
|
176
|
+
def additional_keys(self) -> list[str]:
|
|
177
|
+
return list(self.additional_properties.keys())
|
|
178
|
+
|
|
179
|
+
def __getitem__(self, key: str) -> Any:
|
|
180
|
+
return self.additional_properties[key]
|
|
181
|
+
|
|
182
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
183
|
+
self.additional_properties[key] = value
|
|
184
|
+
|
|
185
|
+
def __delitem__(self, key: str) -> None:
|
|
186
|
+
del self.additional_properties[key]
|
|
187
|
+
|
|
188
|
+
def __contains__(self, key: str) -> bool:
|
|
189
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any, TypeVar, Union, cast
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
from dateutil.parser import isoparse
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="RunAttachmentUpdate")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class RunAttachmentUpdate:
|
|
16
|
+
"""Schema for updating a run attachment
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
expires_at (Union[None, Unset, datetime.datetime]):
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
expires_at: Union[None, Unset, datetime.datetime] = UNSET
|
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
|
+
|
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
|
26
|
+
expires_at: Union[None, Unset, str]
|
|
27
|
+
if isinstance(self.expires_at, Unset):
|
|
28
|
+
expires_at = UNSET
|
|
29
|
+
elif isinstance(self.expires_at, datetime.datetime):
|
|
30
|
+
expires_at = self.expires_at.isoformat()
|
|
31
|
+
else:
|
|
32
|
+
expires_at = self.expires_at
|
|
33
|
+
|
|
34
|
+
field_dict: dict[str, Any] = {}
|
|
35
|
+
field_dict.update(self.additional_properties)
|
|
36
|
+
field_dict.update({})
|
|
37
|
+
if expires_at is not UNSET:
|
|
38
|
+
field_dict["expires_at"] = expires_at
|
|
39
|
+
|
|
40
|
+
return field_dict
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
44
|
+
d = dict(src_dict)
|
|
45
|
+
|
|
46
|
+
def _parse_expires_at(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
47
|
+
if data is None:
|
|
48
|
+
return data
|
|
49
|
+
if isinstance(data, Unset):
|
|
50
|
+
return data
|
|
51
|
+
try:
|
|
52
|
+
if not isinstance(data, str):
|
|
53
|
+
raise TypeError()
|
|
54
|
+
expires_at_type_0 = isoparse(data)
|
|
55
|
+
|
|
56
|
+
return expires_at_type_0
|
|
57
|
+
except: # noqa: E722
|
|
58
|
+
pass
|
|
59
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
60
|
+
|
|
61
|
+
expires_at = _parse_expires_at(d.pop("expires_at", UNSET))
|
|
62
|
+
|
|
63
|
+
run_attachment_update = cls(
|
|
64
|
+
expires_at=expires_at,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
run_attachment_update.additional_properties = d
|
|
68
|
+
return run_attachment_update
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def additional_keys(self) -> list[str]:
|
|
72
|
+
return list(self.additional_properties.keys())
|
|
73
|
+
|
|
74
|
+
def __getitem__(self, key: str) -> Any:
|
|
75
|
+
return self.additional_properties[key]
|
|
76
|
+
|
|
77
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
78
|
+
self.additional_properties[key] = value
|
|
79
|
+
|
|
80
|
+
def __delitem__(self, key: str) -> None:
|
|
81
|
+
del self.additional_properties[key]
|
|
82
|
+
|
|
83
|
+
def __contains__(self, key: str) -> bool:
|
|
84
|
+
return key in self.additional_properties
|
|
@@ -8,6 +8,7 @@ from attrs import field as _attrs_field
|
|
|
8
8
|
from ..types import UNSET, Unset
|
|
9
9
|
|
|
10
10
|
if TYPE_CHECKING:
|
|
11
|
+
from ..models.file_input import FileInput
|
|
11
12
|
from ..models.run_create_input_values_type_0 import RunCreateInputValuesType0
|
|
12
13
|
|
|
13
14
|
|
|
@@ -23,11 +24,13 @@ class RunCreate:
|
|
|
23
24
|
machine_id (Union[None, UUID, Unset]): Machine ID. If not provided, an available machine will be automatically
|
|
24
25
|
selected.
|
|
25
26
|
input_values (Union['RunCreateInputValuesType0', None, Unset]): Input values for workflow variables
|
|
27
|
+
file_inputs (Union[None, Unset, list['FileInput']]): Files to upload to the machine
|
|
26
28
|
"""
|
|
27
29
|
|
|
28
30
|
workflow_id: UUID
|
|
29
31
|
machine_id: Union[None, UUID, Unset] = UNSET
|
|
30
32
|
input_values: Union["RunCreateInputValuesType0", None, Unset] = UNSET
|
|
33
|
+
file_inputs: Union[None, Unset, list["FileInput"]] = UNSET
|
|
31
34
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
32
35
|
|
|
33
36
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -51,6 +54,18 @@ class RunCreate:
|
|
|
51
54
|
else:
|
|
52
55
|
input_values = self.input_values
|
|
53
56
|
|
|
57
|
+
file_inputs: Union[None, Unset, list[dict[str, Any]]]
|
|
58
|
+
if isinstance(self.file_inputs, Unset):
|
|
59
|
+
file_inputs = UNSET
|
|
60
|
+
elif isinstance(self.file_inputs, list):
|
|
61
|
+
file_inputs = []
|
|
62
|
+
for file_inputs_type_0_item_data in self.file_inputs:
|
|
63
|
+
file_inputs_type_0_item = file_inputs_type_0_item_data.to_dict()
|
|
64
|
+
file_inputs.append(file_inputs_type_0_item)
|
|
65
|
+
|
|
66
|
+
else:
|
|
67
|
+
file_inputs = self.file_inputs
|
|
68
|
+
|
|
54
69
|
field_dict: dict[str, Any] = {}
|
|
55
70
|
field_dict.update(self.additional_properties)
|
|
56
71
|
field_dict.update(
|
|
@@ -62,11 +77,14 @@ class RunCreate:
|
|
|
62
77
|
field_dict["machine_id"] = machine_id
|
|
63
78
|
if input_values is not UNSET:
|
|
64
79
|
field_dict["input_values"] = input_values
|
|
80
|
+
if file_inputs is not UNSET:
|
|
81
|
+
field_dict["file_inputs"] = file_inputs
|
|
65
82
|
|
|
66
83
|
return field_dict
|
|
67
84
|
|
|
68
85
|
@classmethod
|
|
69
86
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
87
|
+
from ..models.file_input import FileInput
|
|
70
88
|
from ..models.run_create_input_values_type_0 import RunCreateInputValuesType0
|
|
71
89
|
|
|
72
90
|
d = dict(src_dict)
|
|
@@ -106,10 +124,33 @@ class RunCreate:
|
|
|
106
124
|
|
|
107
125
|
input_values = _parse_input_values(d.pop("input_values", UNSET))
|
|
108
126
|
|
|
127
|
+
def _parse_file_inputs(data: object) -> Union[None, Unset, list["FileInput"]]:
|
|
128
|
+
if data is None:
|
|
129
|
+
return data
|
|
130
|
+
if isinstance(data, Unset):
|
|
131
|
+
return data
|
|
132
|
+
try:
|
|
133
|
+
if not isinstance(data, list):
|
|
134
|
+
raise TypeError()
|
|
135
|
+
file_inputs_type_0 = []
|
|
136
|
+
_file_inputs_type_0 = data
|
|
137
|
+
for file_inputs_type_0_item_data in _file_inputs_type_0:
|
|
138
|
+
file_inputs_type_0_item = FileInput.from_dict(file_inputs_type_0_item_data)
|
|
139
|
+
|
|
140
|
+
file_inputs_type_0.append(file_inputs_type_0_item)
|
|
141
|
+
|
|
142
|
+
return file_inputs_type_0
|
|
143
|
+
except: # noqa: E722
|
|
144
|
+
pass
|
|
145
|
+
return cast(Union[None, Unset, list["FileInput"]], data)
|
|
146
|
+
|
|
147
|
+
file_inputs = _parse_file_inputs(d.pop("file_inputs", UNSET))
|
|
148
|
+
|
|
109
149
|
run_create = cls(
|
|
110
150
|
workflow_id=workflow_id,
|
|
111
151
|
machine_id=machine_id,
|
|
112
152
|
input_values=input_values,
|
|
153
|
+
file_inputs=file_inputs,
|
|
113
154
|
)
|
|
114
155
|
|
|
115
156
|
run_create.additional_properties = d
|
|
@@ -30,6 +30,7 @@ class RunResponse:
|
|
|
30
30
|
status (RunStatus):
|
|
31
31
|
error (Union[None, list[str]]):
|
|
32
32
|
output_data (Union['RunResponseOutputDataType0', None]):
|
|
33
|
+
input_attachment_ids (Union[None, list[str]]):
|
|
33
34
|
output_attachment_ids (Union[None, list[str]]):
|
|
34
35
|
run_message_history (Union[None, list['RunResponseRunMessageHistoryType0Item']]):
|
|
35
36
|
input_values (Union['RunResponseInputValuesType0', None]):
|
|
@@ -43,6 +44,7 @@ class RunResponse:
|
|
|
43
44
|
status: RunStatus
|
|
44
45
|
error: Union[None, list[str]]
|
|
45
46
|
output_data: Union["RunResponseOutputDataType0", None]
|
|
47
|
+
input_attachment_ids: Union[None, list[str]]
|
|
46
48
|
output_attachment_ids: Union[None, list[str]]
|
|
47
49
|
run_message_history: Union[None, list["RunResponseRunMessageHistoryType0Item"]]
|
|
48
50
|
input_values: Union["RunResponseInputValuesType0", None]
|
|
@@ -80,6 +82,13 @@ class RunResponse:
|
|
|
80
82
|
else:
|
|
81
83
|
output_data = self.output_data
|
|
82
84
|
|
|
85
|
+
input_attachment_ids: Union[None, list[str]]
|
|
86
|
+
if isinstance(self.input_attachment_ids, list):
|
|
87
|
+
input_attachment_ids = self.input_attachment_ids
|
|
88
|
+
|
|
89
|
+
else:
|
|
90
|
+
input_attachment_ids = self.input_attachment_ids
|
|
91
|
+
|
|
83
92
|
output_attachment_ids: Union[None, list[str]]
|
|
84
93
|
if isinstance(self.output_attachment_ids, list):
|
|
85
94
|
output_attachment_ids = self.output_attachment_ids
|
|
@@ -116,6 +125,7 @@ class RunResponse:
|
|
|
116
125
|
"status": status,
|
|
117
126
|
"error": error,
|
|
118
127
|
"output_data": output_data,
|
|
128
|
+
"input_attachment_ids": input_attachment_ids,
|
|
119
129
|
"output_attachment_ids": output_attachment_ids,
|
|
120
130
|
"run_message_history": run_message_history,
|
|
121
131
|
"input_values": input_values,
|
|
@@ -185,6 +195,21 @@ class RunResponse:
|
|
|
185
195
|
|
|
186
196
|
output_data = _parse_output_data(d.pop("output_data"))
|
|
187
197
|
|
|
198
|
+
def _parse_input_attachment_ids(data: object) -> Union[None, list[str]]:
|
|
199
|
+
if data is None:
|
|
200
|
+
return data
|
|
201
|
+
try:
|
|
202
|
+
if not isinstance(data, list):
|
|
203
|
+
raise TypeError()
|
|
204
|
+
input_attachment_ids_type_0 = cast(list[str], data)
|
|
205
|
+
|
|
206
|
+
return input_attachment_ids_type_0
|
|
207
|
+
except: # noqa: E722
|
|
208
|
+
pass
|
|
209
|
+
return cast(Union[None, list[str]], data)
|
|
210
|
+
|
|
211
|
+
input_attachment_ids = _parse_input_attachment_ids(d.pop("input_attachment_ids"))
|
|
212
|
+
|
|
188
213
|
def _parse_output_attachment_ids(data: object) -> Union[None, list[str]]:
|
|
189
214
|
if data is None:
|
|
190
215
|
return data
|
|
@@ -247,6 +272,7 @@ class RunResponse:
|
|
|
247
272
|
status=status,
|
|
248
273
|
error=error,
|
|
249
274
|
output_data=output_data,
|
|
275
|
+
input_attachment_ids=input_attachment_ids,
|
|
250
276
|
output_attachment_ids=output_attachment_ids,
|
|
251
277
|
run_message_history=run_message_history,
|
|
252
278
|
input_values=input_values,
|
|
@@ -17,11 +17,13 @@ class WorkflowCreate:
|
|
|
17
17
|
main_prompt (str):
|
|
18
18
|
name (Union[None, Unset, str]):
|
|
19
19
|
output_schema (Union[None, Unset, str]): JSON schema for output data transformation
|
|
20
|
+
includes_file_exports (Union[Unset, bool]): Enable AI-based file export detection Default: False.
|
|
20
21
|
"""
|
|
21
22
|
|
|
22
23
|
main_prompt: str
|
|
23
24
|
name: Union[None, Unset, str] = UNSET
|
|
24
25
|
output_schema: Union[None, Unset, str] = UNSET
|
|
26
|
+
includes_file_exports: Union[Unset, bool] = False
|
|
25
27
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
28
|
|
|
27
29
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -39,6 +41,8 @@ class WorkflowCreate:
|
|
|
39
41
|
else:
|
|
40
42
|
output_schema = self.output_schema
|
|
41
43
|
|
|
44
|
+
includes_file_exports = self.includes_file_exports
|
|
45
|
+
|
|
42
46
|
field_dict: dict[str, Any] = {}
|
|
43
47
|
field_dict.update(self.additional_properties)
|
|
44
48
|
field_dict.update(
|
|
@@ -50,6 +54,8 @@ class WorkflowCreate:
|
|
|
50
54
|
field_dict["name"] = name
|
|
51
55
|
if output_schema is not UNSET:
|
|
52
56
|
field_dict["output_schema"] = output_schema
|
|
57
|
+
if includes_file_exports is not UNSET:
|
|
58
|
+
field_dict["includes_file_exports"] = includes_file_exports
|
|
53
59
|
|
|
54
60
|
return field_dict
|
|
55
61
|
|
|
@@ -76,10 +82,13 @@ class WorkflowCreate:
|
|
|
76
82
|
|
|
77
83
|
output_schema = _parse_output_schema(d.pop("output_schema", UNSET))
|
|
78
84
|
|
|
85
|
+
includes_file_exports = d.pop("includes_file_exports", UNSET)
|
|
86
|
+
|
|
79
87
|
workflow_create = cls(
|
|
80
88
|
main_prompt=main_prompt,
|
|
81
89
|
name=name,
|
|
82
90
|
output_schema=output_schema,
|
|
91
|
+
includes_file_exports=includes_file_exports,
|
|
83
92
|
)
|
|
84
93
|
|
|
85
94
|
workflow_create.additional_properties = d
|