cyberdesk 1.8.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.

Files changed (39) hide show
  1. cyberdesk/__init__.py +11 -1
  2. cyberdesk/client.py +188 -0
  3. {cyberdesk-1.8.0.dist-info → cyberdesk-1.9.0.dist-info}/METADATA +39 -17
  4. {cyberdesk-1.8.0.dist-info → cyberdesk-1.9.0.dist-info}/RECORD +39 -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_v1_run_attachments_attachment_id_get.py +172 -0
  15. openapi_client/cyberdesk_cloud_client/api/run_attachments/list_run_attachments_v1_run_attachments_get.py +240 -0
  16. openapi_client/cyberdesk_cloud_client/api/run_attachments/update_run_attachment_v1_run_attachments_attachment_id_put.py +194 -0
  17. openapi_client/cyberdesk_cloud_client/models/__init__.py +38 -0
  18. openapi_client/cyberdesk_cloud_client/models/attachment_type.py +9 -0
  19. openapi_client/cyberdesk_cloud_client/models/file_input.py +99 -0
  20. openapi_client/cyberdesk_cloud_client/models/file_write_request.py +78 -0
  21. 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
  22. 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
  23. 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
  24. openapi_client/cyberdesk_cloud_client/models/paginated_response_run_attachment_response.py +97 -0
  25. openapi_client/cyberdesk_cloud_client/models/power_shell_exec_request.py +110 -0
  26. openapi_client/cyberdesk_cloud_client/models/power_shell_session_request.py +81 -0
  27. 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
  28. 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
  29. openapi_client/cyberdesk_cloud_client/models/run_attachment_create.py +157 -0
  30. openapi_client/cyberdesk_cloud_client/models/run_attachment_response.py +189 -0
  31. openapi_client/cyberdesk_cloud_client/models/run_attachment_update.py +84 -0
  32. openapi_client/cyberdesk_cloud_client/models/run_create.py +41 -0
  33. openapi_client/cyberdesk_cloud_client/models/run_response.py +26 -0
  34. openapi_client/cyberdesk_cloud_client/models/workflow_create.py +9 -0
  35. openapi_client/cyberdesk_cloud_client/models/workflow_response.py +9 -0
  36. openapi_client/cyberdesk_cloud_client/models/workflow_update.py +20 -0
  37. {cyberdesk-1.8.0.dist-info → cyberdesk-1.9.0.dist-info}/WHEEL +0 -0
  38. {cyberdesk-1.8.0.dist-info → cyberdesk-1.9.0.dist-info}/licenses/LICENSE +0 -0
  39. {cyberdesk-1.8.0.dist-info → cyberdesk-1.9.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,97 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ if TYPE_CHECKING:
8
+ from ..models.run_attachment_response import RunAttachmentResponse
9
+
10
+
11
+ T = TypeVar("T", bound="PaginatedResponseRunAttachmentResponse")
12
+
13
+
14
+ @_attrs_define
15
+ class PaginatedResponseRunAttachmentResponse:
16
+ """
17
+ Attributes:
18
+ items (list['RunAttachmentResponse']):
19
+ total (int):
20
+ skip (int):
21
+ limit (int):
22
+ """
23
+
24
+ items: list["RunAttachmentResponse"]
25
+ total: int
26
+ skip: int
27
+ limit: int
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ items = []
32
+ for items_item_data in self.items:
33
+ items_item = items_item_data.to_dict()
34
+ items.append(items_item)
35
+
36
+ total = self.total
37
+
38
+ skip = self.skip
39
+
40
+ limit = self.limit
41
+
42
+ field_dict: dict[str, Any] = {}
43
+ field_dict.update(self.additional_properties)
44
+ field_dict.update(
45
+ {
46
+ "items": items,
47
+ "total": total,
48
+ "skip": skip,
49
+ "limit": limit,
50
+ }
51
+ )
52
+
53
+ return field_dict
54
+
55
+ @classmethod
56
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
57
+ from ..models.run_attachment_response import RunAttachmentResponse
58
+
59
+ d = dict(src_dict)
60
+ items = []
61
+ _items = d.pop("items")
62
+ for items_item_data in _items:
63
+ items_item = RunAttachmentResponse.from_dict(items_item_data)
64
+
65
+ items.append(items_item)
66
+
67
+ total = d.pop("total")
68
+
69
+ skip = d.pop("skip")
70
+
71
+ limit = d.pop("limit")
72
+
73
+ paginated_response_run_attachment_response = cls(
74
+ items=items,
75
+ total=total,
76
+ skip=skip,
77
+ limit=limit,
78
+ )
79
+
80
+ paginated_response_run_attachment_response.additional_properties = d
81
+ return paginated_response_run_attachment_response
82
+
83
+ @property
84
+ def additional_keys(self) -> list[str]:
85
+ return list(self.additional_properties.keys())
86
+
87
+ def __getitem__(self, key: str) -> Any:
88
+ return self.additional_properties[key]
89
+
90
+ def __setitem__(self, key: str, value: Any) -> None:
91
+ self.additional_properties[key] = value
92
+
93
+ def __delitem__(self, key: str) -> None:
94
+ del self.additional_properties[key]
95
+
96
+ def __contains__(self, key: str) -> bool:
97
+ return key in self.additional_properties
@@ -0,0 +1,110 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ T = TypeVar("T", bound="PowerShellExecRequest")
10
+
11
+
12
+ @_attrs_define
13
+ class PowerShellExecRequest:
14
+ """
15
+ Attributes:
16
+ command (str): PowerShell command to execute
17
+ same_session (Union[Unset, bool]): Use persistent session Default: True.
18
+ working_directory (Union[None, Unset, str]): Working directory for new session
19
+ session_id (Union[None, Unset, str]): Session ID to use
20
+ """
21
+
22
+ command: str
23
+ same_session: Union[Unset, bool] = True
24
+ working_directory: Union[None, Unset, str] = UNSET
25
+ session_id: Union[None, Unset, str] = UNSET
26
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
27
+
28
+ def to_dict(self) -> dict[str, Any]:
29
+ command = self.command
30
+
31
+ same_session = self.same_session
32
+
33
+ working_directory: Union[None, Unset, str]
34
+ if isinstance(self.working_directory, Unset):
35
+ working_directory = UNSET
36
+ else:
37
+ working_directory = self.working_directory
38
+
39
+ session_id: Union[None, Unset, str]
40
+ if isinstance(self.session_id, Unset):
41
+ session_id = UNSET
42
+ else:
43
+ session_id = self.session_id
44
+
45
+ field_dict: dict[str, Any] = {}
46
+ field_dict.update(self.additional_properties)
47
+ field_dict.update(
48
+ {
49
+ "command": command,
50
+ }
51
+ )
52
+ if same_session is not UNSET:
53
+ field_dict["same_session"] = same_session
54
+ if working_directory is not UNSET:
55
+ field_dict["working_directory"] = working_directory
56
+ if session_id is not UNSET:
57
+ field_dict["session_id"] = session_id
58
+
59
+ return field_dict
60
+
61
+ @classmethod
62
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
63
+ d = dict(src_dict)
64
+ command = d.pop("command")
65
+
66
+ same_session = d.pop("same_session", UNSET)
67
+
68
+ def _parse_working_directory(data: object) -> Union[None, Unset, str]:
69
+ if data is None:
70
+ return data
71
+ if isinstance(data, Unset):
72
+ return data
73
+ return cast(Union[None, Unset, str], data)
74
+
75
+ working_directory = _parse_working_directory(d.pop("working_directory", UNSET))
76
+
77
+ def _parse_session_id(data: object) -> Union[None, Unset, str]:
78
+ if data is None:
79
+ return data
80
+ if isinstance(data, Unset):
81
+ return data
82
+ return cast(Union[None, Unset, str], data)
83
+
84
+ session_id = _parse_session_id(d.pop("session_id", UNSET))
85
+
86
+ power_shell_exec_request = cls(
87
+ command=command,
88
+ same_session=same_session,
89
+ working_directory=working_directory,
90
+ session_id=session_id,
91
+ )
92
+
93
+ power_shell_exec_request.additional_properties = d
94
+ return power_shell_exec_request
95
+
96
+ @property
97
+ def additional_keys(self) -> list[str]:
98
+ return list(self.additional_properties.keys())
99
+
100
+ def __getitem__(self, key: str) -> Any:
101
+ return self.additional_properties[key]
102
+
103
+ def __setitem__(self, key: str, value: Any) -> None:
104
+ self.additional_properties[key] = value
105
+
106
+ def __delitem__(self, key: str) -> None:
107
+ del self.additional_properties[key]
108
+
109
+ def __contains__(self, key: str) -> bool:
110
+ return key in self.additional_properties
@@ -0,0 +1,81 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ T = TypeVar("T", bound="PowerShellSessionRequest")
10
+
11
+
12
+ @_attrs_define
13
+ class PowerShellSessionRequest:
14
+ """
15
+ Attributes:
16
+ action (str): Action to perform - 'create' or 'destroy'
17
+ session_id (Union[None, Unset, str]): Session ID for destroy action
18
+ """
19
+
20
+ action: str
21
+ session_id: Union[None, Unset, str] = UNSET
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ action = self.action
26
+
27
+ session_id: Union[None, Unset, str]
28
+ if isinstance(self.session_id, Unset):
29
+ session_id = UNSET
30
+ else:
31
+ session_id = self.session_id
32
+
33
+ field_dict: dict[str, Any] = {}
34
+ field_dict.update(self.additional_properties)
35
+ field_dict.update(
36
+ {
37
+ "action": action,
38
+ }
39
+ )
40
+ if session_id is not UNSET:
41
+ field_dict["session_id"] = session_id
42
+
43
+ return field_dict
44
+
45
+ @classmethod
46
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
47
+ d = dict(src_dict)
48
+ action = d.pop("action")
49
+
50
+ def _parse_session_id(data: object) -> Union[None, Unset, str]:
51
+ if data is None:
52
+ return data
53
+ if isinstance(data, Unset):
54
+ return data
55
+ return cast(Union[None, Unset, str], data)
56
+
57
+ session_id = _parse_session_id(d.pop("session_id", UNSET))
58
+
59
+ power_shell_session_request = cls(
60
+ action=action,
61
+ session_id=session_id,
62
+ )
63
+
64
+ power_shell_session_request.additional_properties = d
65
+ return power_shell_session_request
66
+
67
+ @property
68
+ def additional_keys(self) -> list[str]:
69
+ return list(self.additional_properties.keys())
70
+
71
+ def __getitem__(self, key: str) -> Any:
72
+ return self.additional_properties[key]
73
+
74
+ def __setitem__(self, key: str, value: Any) -> None:
75
+ self.additional_properties[key] = value
76
+
77
+ def __delitem__(self, key: str) -> None:
78
+ del self.additional_properties[key]
79
+
80
+ def __contains__(self, key: str) -> bool:
81
+ return key in self.additional_properties
@@ -0,0 +1,47 @@
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(
8
+ "T",
9
+ bound="PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost",
10
+ )
11
+
12
+
13
+ @_attrs_define
14
+ class PowershellExecV1ComputerMachineIdShellPowershellExecPostResponsePowershellExecV1ComputerMachineIdShellPowershellExecPost:
15
+ """ """
16
+
17
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
18
+
19
+ def to_dict(self) -> dict[str, Any]:
20
+ field_dict: dict[str, Any] = {}
21
+ field_dict.update(self.additional_properties)
22
+
23
+ return field_dict
24
+
25
+ @classmethod
26
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
27
+ d = dict(src_dict)
28
+ powershell_exec_v1_computer_machine_id_shell_powershell_exec_post_response_powershell_exec_v1_computer_machine_id_shell_powershell_exec_post = cls()
29
+
30
+ powershell_exec_v1_computer_machine_id_shell_powershell_exec_post_response_powershell_exec_v1_computer_machine_id_shell_powershell_exec_post.additional_properties = d
31
+ return powershell_exec_v1_computer_machine_id_shell_powershell_exec_post_response_powershell_exec_v1_computer_machine_id_shell_powershell_exec_post
32
+
33
+ @property
34
+ def additional_keys(self) -> list[str]:
35
+ return list(self.additional_properties.keys())
36
+
37
+ def __getitem__(self, key: str) -> Any:
38
+ return self.additional_properties[key]
39
+
40
+ def __setitem__(self, key: str, value: Any) -> None:
41
+ self.additional_properties[key] = value
42
+
43
+ def __delitem__(self, key: str) -> None:
44
+ del self.additional_properties[key]
45
+
46
+ def __contains__(self, key: str) -> bool:
47
+ return key in self.additional_properties
@@ -0,0 +1,47 @@
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(
8
+ "T",
9
+ bound="PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost",
10
+ )
11
+
12
+
13
+ @_attrs_define
14
+ class PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponsePowershellSessionV1ComputerMachineIdShellPowershellSessionPost:
15
+ """ """
16
+
17
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
18
+
19
+ def to_dict(self) -> dict[str, Any]:
20
+ field_dict: dict[str, Any] = {}
21
+ field_dict.update(self.additional_properties)
22
+
23
+ return field_dict
24
+
25
+ @classmethod
26
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
27
+ d = dict(src_dict)
28
+ powershell_session_v1_computer_machine_id_shell_powershell_session_post_response_powershell_session_v1_computer_machine_id_shell_powershell_session_post = cls()
29
+
30
+ powershell_session_v1_computer_machine_id_shell_powershell_session_post_response_powershell_session_v1_computer_machine_id_shell_powershell_session_post.additional_properties = d
31
+ return powershell_session_v1_computer_machine_id_shell_powershell_session_post_response_powershell_session_v1_computer_machine_id_shell_powershell_session_post
32
+
33
+ @property
34
+ def additional_keys(self) -> list[str]:
35
+ return list(self.additional_properties.keys())
36
+
37
+ def __getitem__(self, key: str) -> Any:
38
+ return self.additional_properties[key]
39
+
40
+ def __setitem__(self, key: str, value: Any) -> None:
41
+ self.additional_properties[key] = value
42
+
43
+ def __delitem__(self, key: str) -> None:
44
+ del self.additional_properties[key]
45
+
46
+ def __contains__(self, key: str) -> bool:
47
+ return key in self.additional_properties
@@ -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