daytona_api_client_async 0.21.3a0__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 daytona_api_client_async might be problematic. Click here for more details.
- daytona_api_client_async/__init__.py +129 -0
- daytona_api_client_async/api/__init__.py +16 -0
- daytona_api_client_async/api/api_keys_api.py +1391 -0
- daytona_api_client_async/api/docker_registry_api.py +1965 -0
- daytona_api_client_async/api/images_api.py +2350 -0
- daytona_api_client_async/api/nodes_api.py +792 -0
- daytona_api_client_async/api/object_storage_api.py +298 -0
- daytona_api_client_async/api/organizations_api.py +6762 -0
- daytona_api_client_async/api/preview_api.py +819 -0
- daytona_api_client_async/api/runners_api.py +792 -0
- daytona_api_client_async/api/sandbox_api.py +3994 -0
- daytona_api_client_async/api/snapshots_api.py +2059 -0
- daytona_api_client_async/api/toolbox_api.py +11819 -0
- daytona_api_client_async/api/users_api.py +2075 -0
- daytona_api_client_async/api/volumes_api.py +1419 -0
- daytona_api_client_async/api/workspace_api.py +4036 -0
- daytona_api_client_async/api_client.py +801 -0
- daytona_api_client_async/api_response.py +21 -0
- daytona_api_client_async/configuration.py +579 -0
- daytona_api_client_async/exceptions.py +217 -0
- daytona_api_client_async/models/__init__.py +101 -0
- daytona_api_client_async/models/account_provider.py +103 -0
- daytona_api_client_async/models/api_key_list.py +130 -0
- daytona_api_client_async/models/api_key_response.py +123 -0
- daytona_api_client_async/models/build_image.py +107 -0
- daytona_api_client_async/models/build_info.py +108 -0
- daytona_api_client_async/models/build_snapshot.py +115 -0
- daytona_api_client_async/models/command.py +105 -0
- daytona_api_client_async/models/completion_context.py +103 -0
- daytona_api_client_async/models/completion_item.py +113 -0
- daytona_api_client_async/models/completion_list.py +111 -0
- daytona_api_client_async/models/create_api_key.py +119 -0
- daytona_api_client_async/models/create_build_info.py +103 -0
- daytona_api_client_async/models/create_docker_registry.py +120 -0
- daytona_api_client_async/models/create_image.py +105 -0
- daytona_api_client_async/models/create_linked_account.py +103 -0
- daytona_api_client_async/models/create_node.py +135 -0
- daytona_api_client_async/models/create_organization.py +101 -0
- daytona_api_client_async/models/create_organization_invitation.py +115 -0
- daytona_api_client_async/models/create_organization_quota.py +117 -0
- daytona_api_client_async/models/create_organization_role.py +113 -0
- daytona_api_client_async/models/create_runner.py +135 -0
- daytona_api_client_async/models/create_sandbox.py +161 -0
- daytona_api_client_async/models/create_session_request.py +101 -0
- daytona_api_client_async/models/create_snapshot.py +121 -0
- daytona_api_client_async/models/create_user.py +125 -0
- daytona_api_client_async/models/create_volume.py +101 -0
- daytona_api_client_async/models/create_workspace.py +161 -0
- daytona_api_client_async/models/docker_registry.py +123 -0
- daytona_api_client_async/models/execute_request.py +105 -0
- daytona_api_client_async/models/execute_response.py +103 -0
- daytona_api_client_async/models/file_info.py +115 -0
- daytona_api_client_async/models/file_status.py +107 -0
- daytona_api_client_async/models/git_add_request.py +103 -0
- daytona_api_client_async/models/git_branch_request.py +103 -0
- daytona_api_client_async/models/git_checkout_request.py +103 -0
- daytona_api_client_async/models/git_clone_request.py +111 -0
- daytona_api_client_async/models/git_commit_info.py +109 -0
- daytona_api_client_async/models/git_commit_request.py +107 -0
- daytona_api_client_async/models/git_commit_response.py +101 -0
- daytona_api_client_async/models/git_delete_branch_request.py +103 -0
- daytona_api_client_async/models/git_repo_request.py +105 -0
- daytona_api_client_async/models/git_status.py +117 -0
- daytona_api_client_async/models/image_dto.py +145 -0
- daytona_api_client_async/models/image_state.py +45 -0
- daytona_api_client_async/models/list_branch_response.py +101 -0
- daytona_api_client_async/models/lsp_completion_params.py +117 -0
- daytona_api_client_async/models/lsp_document_request.py +105 -0
- daytona_api_client_async/models/lsp_location.py +107 -0
- daytona_api_client_async/models/lsp_server_request.py +103 -0
- daytona_api_client_async/models/lsp_symbol.py +109 -0
- daytona_api_client_async/models/match.py +105 -0
- daytona_api_client_async/models/organization.py +120 -0
- daytona_api_client_async/models/organization_invitation.py +144 -0
- daytona_api_client_async/models/organization_role.py +122 -0
- daytona_api_client_async/models/organization_suspension.py +104 -0
- daytona_api_client_async/models/organization_user.py +131 -0
- daytona_api_client_async/models/paginated_images_dto.py +115 -0
- daytona_api_client_async/models/paginated_snapshots_dto.py +115 -0
- daytona_api_client_async/models/port_preview_url.py +103 -0
- daytona_api_client_async/models/position.py +103 -0
- daytona_api_client_async/models/project_dir_response.py +101 -0
- daytona_api_client_async/models/range.py +110 -0
- daytona_api_client_async/models/registry_push_access_dto.py +111 -0
- daytona_api_client_async/models/replace_request.py +105 -0
- daytona_api_client_async/models/replace_result.py +105 -0
- daytona_api_client_async/models/sandbox.py +180 -0
- daytona_api_client_async/models/sandbox_info.py +105 -0
- daytona_api_client_async/models/sandbox_labels.py +101 -0
- daytona_api_client_async/models/sandbox_state.py +52 -0
- daytona_api_client_async/models/sandbox_volume.py +103 -0
- daytona_api_client_async/models/search_files_response.py +101 -0
- daytona_api_client_async/models/session.py +116 -0
- daytona_api_client_async/models/session_execute_request.py +105 -0
- daytona_api_client_async/models/session_execute_response.py +105 -0
- daytona_api_client_async/models/set_image_general_status.py +101 -0
- daytona_api_client_async/models/set_snapshot_general_status_dto.py +101 -0
- daytona_api_client_async/models/snapshot_dto.py +161 -0
- daytona_api_client_async/models/snapshot_state.py +46 -0
- daytona_api_client_async/models/storage_access_dto.py +111 -0
- daytona_api_client_async/models/toggle_state.py +101 -0
- daytona_api_client_async/models/update_assigned_organization_roles.py +101 -0
- daytona_api_client_async/models/update_docker_registry.py +105 -0
- daytona_api_client_async/models/update_organization_invitation.py +113 -0
- daytona_api_client_async/models/update_organization_member_role.py +108 -0
- daytona_api_client_async/models/update_organization_quota.py +162 -0
- daytona_api_client_async/models/update_organization_role.py +113 -0
- daytona_api_client_async/models/usage_overview.py +113 -0
- daytona_api_client_async/models/user.py +115 -0
- daytona_api_client_async/models/user_public_key.py +103 -0
- daytona_api_client_async/models/volume_dto.py +126 -0
- daytona_api_client_async/models/volume_state.py +43 -0
- daytona_api_client_async/models/workspace.py +204 -0
- daytona_api_client_async/models/workspace_info.py +105 -0
- daytona_api_client_async/models/workspace_labels.py +101 -0
- daytona_api_client_async/models/workspace_state.py +51 -0
- daytona_api_client_async/models/workspace_volume.py +103 -0
- daytona_api_client_async/py.typed +0 -0
- daytona_api_client_async/rest.py +214 -0
- daytona_api_client_async-0.21.3a0.dist-info/METADATA +25 -0
- daytona_api_client_async-0.21.3a0.dist-info/RECORD +123 -0
- daytona_api_client_async-0.21.3a0.dist-info/WHEEL +5 -0
- daytona_api_client_async-0.21.3a0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Daytona
|
|
5
|
+
|
|
6
|
+
Daytona AI platform API Docs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@daytona.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from daytona_api_client_async.models.volume_state import VolumeState
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class VolumeDto(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
VolumeDto
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
id: StrictStr = Field(description="Volume ID")
|
|
32
|
+
name: StrictStr = Field(description="Volume name")
|
|
33
|
+
organization_id: StrictStr = Field(description="Organization ID", alias="organizationId")
|
|
34
|
+
state: VolumeState = Field(description="Volume state")
|
|
35
|
+
created_at: StrictStr = Field(description="Creation timestamp", alias="createdAt")
|
|
36
|
+
updated_at: StrictStr = Field(description="Last update timestamp", alias="updatedAt")
|
|
37
|
+
last_used_at: Optional[StrictStr] = Field(default=None, description="Last used timestamp", alias="lastUsedAt")
|
|
38
|
+
error_reason: Optional[StrictStr] = Field(description="The error reason of the volume", alias="errorReason")
|
|
39
|
+
additional_properties: Dict[str, Any] = {}
|
|
40
|
+
__properties: ClassVar[List[str]] = ["id", "name", "organizationId", "state", "createdAt", "updatedAt", "lastUsedAt", "errorReason"]
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of VolumeDto from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
"additional_properties",
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
_dict = self.model_dump(
|
|
79
|
+
by_alias=True,
|
|
80
|
+
exclude=excluded_fields,
|
|
81
|
+
exclude_none=True,
|
|
82
|
+
)
|
|
83
|
+
# puts key-value pairs in additional_properties in the top level
|
|
84
|
+
if self.additional_properties is not None:
|
|
85
|
+
for _key, _value in self.additional_properties.items():
|
|
86
|
+
_dict[_key] = _value
|
|
87
|
+
|
|
88
|
+
# set to None if last_used_at (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.last_used_at is None and "last_used_at" in self.model_fields_set:
|
|
91
|
+
_dict['lastUsedAt'] = None
|
|
92
|
+
|
|
93
|
+
# set to None if error_reason (nullable) is None
|
|
94
|
+
# and model_fields_set contains the field
|
|
95
|
+
if self.error_reason is None and "error_reason" in self.model_fields_set:
|
|
96
|
+
_dict['errorReason'] = None
|
|
97
|
+
|
|
98
|
+
return _dict
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
102
|
+
"""Create an instance of VolumeDto from a dict"""
|
|
103
|
+
if obj is None:
|
|
104
|
+
return None
|
|
105
|
+
|
|
106
|
+
if not isinstance(obj, dict):
|
|
107
|
+
return cls.model_validate(obj)
|
|
108
|
+
|
|
109
|
+
_obj = cls.model_validate({
|
|
110
|
+
"id": obj.get("id"),
|
|
111
|
+
"name": obj.get("name"),
|
|
112
|
+
"organizationId": obj.get("organizationId"),
|
|
113
|
+
"state": obj.get("state"),
|
|
114
|
+
"createdAt": obj.get("createdAt"),
|
|
115
|
+
"updatedAt": obj.get("updatedAt"),
|
|
116
|
+
"lastUsedAt": obj.get("lastUsedAt"),
|
|
117
|
+
"errorReason": obj.get("errorReason")
|
|
118
|
+
})
|
|
119
|
+
# store additional fields in additional_properties
|
|
120
|
+
for _key in obj.keys():
|
|
121
|
+
if _key not in cls.__properties:
|
|
122
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
123
|
+
|
|
124
|
+
return _obj
|
|
125
|
+
|
|
126
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Daytona
|
|
5
|
+
|
|
6
|
+
Daytona AI platform API Docs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@daytona.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
from typing_extensions import Self
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class VolumeState(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
Volume state
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
CREATING = 'creating'
|
|
31
|
+
READY = 'ready'
|
|
32
|
+
PENDING_CREATE = 'pending_create'
|
|
33
|
+
PENDING_DELETE = 'pending_delete'
|
|
34
|
+
DELETING = 'deleting'
|
|
35
|
+
DELETED = 'deleted'
|
|
36
|
+
ERROR = 'error'
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_json(cls, json_str: str) -> Self:
|
|
40
|
+
"""Create an instance of VolumeState from a JSON string"""
|
|
41
|
+
return cls(json.loads(json_str))
|
|
42
|
+
|
|
43
|
+
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Daytona
|
|
5
|
+
|
|
6
|
+
Daytona AI platform API Docs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@daytona.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from daytona_api_client_async.models.build_info import BuildInfo
|
|
24
|
+
from daytona_api_client_async.models.sandbox_info import SandboxInfo
|
|
25
|
+
from daytona_api_client_async.models.sandbox_state import SandboxState
|
|
26
|
+
from daytona_api_client_async.models.sandbox_volume import SandboxVolume
|
|
27
|
+
from typing import Optional, Set
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
|
|
30
|
+
class Workspace(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
Workspace
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
id: StrictStr = Field(description="The ID of the sandbox")
|
|
35
|
+
organization_id: StrictStr = Field(description="The organization ID of the sandbox", alias="organizationId")
|
|
36
|
+
snapshot: Optional[StrictStr] = Field(default=None, description="The snapshot used for the sandbox")
|
|
37
|
+
user: StrictStr = Field(description="The user associated with the project")
|
|
38
|
+
env: Dict[str, StrictStr] = Field(description="Environment variables for the sandbox")
|
|
39
|
+
labels: Dict[str, StrictStr] = Field(description="Labels for the sandbox")
|
|
40
|
+
public: StrictBool = Field(description="Whether the sandbox http preview is public")
|
|
41
|
+
target: StrictStr = Field(description="The target environment for the sandbox")
|
|
42
|
+
cpu: Union[StrictFloat, StrictInt] = Field(description="The CPU quota for the sandbox")
|
|
43
|
+
gpu: Union[StrictFloat, StrictInt] = Field(description="The GPU quota for the sandbox")
|
|
44
|
+
memory: Union[StrictFloat, StrictInt] = Field(description="The memory quota for the sandbox")
|
|
45
|
+
disk: Union[StrictFloat, StrictInt] = Field(description="The disk quota for the sandbox")
|
|
46
|
+
state: Optional[SandboxState] = Field(default=None, description="The state of the sandbox")
|
|
47
|
+
error_reason: Optional[StrictStr] = Field(default=None, description="The error reason of the sandbox", alias="errorReason")
|
|
48
|
+
backup_state: Optional[StrictStr] = Field(default=None, description="The state of the backup", alias="backupState")
|
|
49
|
+
backup_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last backup", alias="backupCreatedAt")
|
|
50
|
+
auto_stop_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval")
|
|
51
|
+
auto_archive_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-archive interval in minutes", alias="autoArchiveInterval")
|
|
52
|
+
runner_domain: Optional[StrictStr] = Field(default=None, description="The domain name of the runner", alias="runnerDomain")
|
|
53
|
+
volumes: Optional[List[SandboxVolume]] = Field(default=None, description="Array of volumes attached to the sandbox")
|
|
54
|
+
build_info: Optional[BuildInfo] = Field(default=None, description="Build information for the sandbox", alias="buildInfo")
|
|
55
|
+
created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the sandbox", alias="createdAt")
|
|
56
|
+
updated_at: Optional[StrictStr] = Field(default=None, description="The last update timestamp of the sandbox", alias="updatedAt")
|
|
57
|
+
var_class: Optional[StrictStr] = Field(default=None, description="The class of the sandbox", alias="class")
|
|
58
|
+
name: StrictStr = Field(description="The name of the workspace")
|
|
59
|
+
image: Optional[StrictStr] = Field(default=None, description="The image used for the workspace")
|
|
60
|
+
snapshot_state: Optional[StrictStr] = Field(default=None, description="The state of the snapshot", alias="snapshotState")
|
|
61
|
+
snapshot_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last snapshot", alias="snapshotCreatedAt")
|
|
62
|
+
info: Optional[SandboxInfo] = Field(default=None, description="Additional information about the sandbox")
|
|
63
|
+
additional_properties: Dict[str, Any] = {}
|
|
64
|
+
__properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "name", "image", "snapshotState", "snapshotCreatedAt", "info"]
|
|
65
|
+
|
|
66
|
+
@field_validator('backup_state')
|
|
67
|
+
def backup_state_validate_enum(cls, value):
|
|
68
|
+
"""Validates the enum"""
|
|
69
|
+
if value is None:
|
|
70
|
+
return value
|
|
71
|
+
|
|
72
|
+
if value not in set(['None', 'Pending', 'InProgress', 'Completed', 'Error']):
|
|
73
|
+
raise ValueError("must be one of enum values ('None', 'Pending', 'InProgress', 'Completed', 'Error')")
|
|
74
|
+
return value
|
|
75
|
+
|
|
76
|
+
@field_validator('var_class')
|
|
77
|
+
def var_class_validate_enum(cls, value):
|
|
78
|
+
"""Validates the enum"""
|
|
79
|
+
if value is None:
|
|
80
|
+
return value
|
|
81
|
+
|
|
82
|
+
if value not in set(['small', 'medium', 'large']):
|
|
83
|
+
raise ValueError("must be one of enum values ('small', 'medium', 'large')")
|
|
84
|
+
return value
|
|
85
|
+
|
|
86
|
+
@field_validator('snapshot_state')
|
|
87
|
+
def snapshot_state_validate_enum(cls, value):
|
|
88
|
+
"""Validates the enum"""
|
|
89
|
+
if value is None:
|
|
90
|
+
return value
|
|
91
|
+
|
|
92
|
+
if value not in set(['None', 'Pending', 'InProgress', 'Completed', 'Error']):
|
|
93
|
+
raise ValueError("must be one of enum values ('None', 'Pending', 'InProgress', 'Completed', 'Error')")
|
|
94
|
+
return value
|
|
95
|
+
|
|
96
|
+
model_config = ConfigDict(
|
|
97
|
+
populate_by_name=True,
|
|
98
|
+
validate_assignment=True,
|
|
99
|
+
protected_namespaces=(),
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def to_str(self) -> str:
|
|
104
|
+
"""Returns the string representation of the model using alias"""
|
|
105
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
106
|
+
|
|
107
|
+
def to_json(self) -> str:
|
|
108
|
+
"""Returns the JSON representation of the model using alias"""
|
|
109
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
110
|
+
return json.dumps(self.to_dict())
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
114
|
+
"""Create an instance of Workspace from a JSON string"""
|
|
115
|
+
return cls.from_dict(json.loads(json_str))
|
|
116
|
+
|
|
117
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
118
|
+
"""Return the dictionary representation of the model using alias.
|
|
119
|
+
|
|
120
|
+
This has the following differences from calling pydantic's
|
|
121
|
+
`self.model_dump(by_alias=True)`:
|
|
122
|
+
|
|
123
|
+
* `None` is only added to the output dict for nullable fields that
|
|
124
|
+
were set at model initialization. Other fields with value `None`
|
|
125
|
+
are ignored.
|
|
126
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
127
|
+
"""
|
|
128
|
+
excluded_fields: Set[str] = set([
|
|
129
|
+
"additional_properties",
|
|
130
|
+
])
|
|
131
|
+
|
|
132
|
+
_dict = self.model_dump(
|
|
133
|
+
by_alias=True,
|
|
134
|
+
exclude=excluded_fields,
|
|
135
|
+
exclude_none=True,
|
|
136
|
+
)
|
|
137
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volumes (list)
|
|
138
|
+
_items = []
|
|
139
|
+
if self.volumes:
|
|
140
|
+
for _item_volumes in self.volumes:
|
|
141
|
+
if _item_volumes:
|
|
142
|
+
_items.append(_item_volumes.to_dict())
|
|
143
|
+
_dict['volumes'] = _items
|
|
144
|
+
# override the default output from pydantic by calling `to_dict()` of build_info
|
|
145
|
+
if self.build_info:
|
|
146
|
+
_dict['buildInfo'] = self.build_info.to_dict()
|
|
147
|
+
# override the default output from pydantic by calling `to_dict()` of info
|
|
148
|
+
if self.info:
|
|
149
|
+
_dict['info'] = self.info.to_dict()
|
|
150
|
+
# puts key-value pairs in additional_properties in the top level
|
|
151
|
+
if self.additional_properties is not None:
|
|
152
|
+
for _key, _value in self.additional_properties.items():
|
|
153
|
+
_dict[_key] = _value
|
|
154
|
+
|
|
155
|
+
return _dict
|
|
156
|
+
|
|
157
|
+
@classmethod
|
|
158
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
159
|
+
"""Create an instance of Workspace from a dict"""
|
|
160
|
+
if obj is None:
|
|
161
|
+
return None
|
|
162
|
+
|
|
163
|
+
if not isinstance(obj, dict):
|
|
164
|
+
return cls.model_validate(obj)
|
|
165
|
+
|
|
166
|
+
_obj = cls.model_validate({
|
|
167
|
+
"id": obj.get("id"),
|
|
168
|
+
"organizationId": obj.get("organizationId"),
|
|
169
|
+
"snapshot": obj.get("snapshot"),
|
|
170
|
+
"user": obj.get("user"),
|
|
171
|
+
"env": obj.get("env"),
|
|
172
|
+
"labels": obj.get("labels"),
|
|
173
|
+
"public": obj.get("public"),
|
|
174
|
+
"target": obj.get("target"),
|
|
175
|
+
"cpu": obj.get("cpu"),
|
|
176
|
+
"gpu": obj.get("gpu"),
|
|
177
|
+
"memory": obj.get("memory"),
|
|
178
|
+
"disk": obj.get("disk"),
|
|
179
|
+
"state": obj.get("state"),
|
|
180
|
+
"errorReason": obj.get("errorReason"),
|
|
181
|
+
"backupState": obj.get("backupState"),
|
|
182
|
+
"backupCreatedAt": obj.get("backupCreatedAt"),
|
|
183
|
+
"autoStopInterval": obj.get("autoStopInterval"),
|
|
184
|
+
"autoArchiveInterval": obj.get("autoArchiveInterval"),
|
|
185
|
+
"runnerDomain": obj.get("runnerDomain"),
|
|
186
|
+
"volumes": [SandboxVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None,
|
|
187
|
+
"buildInfo": BuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None,
|
|
188
|
+
"createdAt": obj.get("createdAt"),
|
|
189
|
+
"updatedAt": obj.get("updatedAt"),
|
|
190
|
+
"class": obj.get("class"),
|
|
191
|
+
"name": obj.get("name") if obj.get("name") is not None else '',
|
|
192
|
+
"image": obj.get("image"),
|
|
193
|
+
"snapshotState": obj.get("snapshotState"),
|
|
194
|
+
"snapshotCreatedAt": obj.get("snapshotCreatedAt"),
|
|
195
|
+
"info": SandboxInfo.from_dict(obj["info"]) if obj.get("info") is not None else None
|
|
196
|
+
})
|
|
197
|
+
# store additional fields in additional_properties
|
|
198
|
+
for _key in obj.keys():
|
|
199
|
+
if _key not in cls.__properties:
|
|
200
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
201
|
+
|
|
202
|
+
return _obj
|
|
203
|
+
|
|
204
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Daytona
|
|
5
|
+
|
|
6
|
+
Daytona AI platform API Docs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@daytona.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class WorkspaceInfo(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
WorkspaceInfo
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
created: StrictStr = Field(description="The creation timestamp of the project")
|
|
31
|
+
name: StrictStr = Field(description="Deprecated: The name of the workspace")
|
|
32
|
+
provider_metadata: Optional[StrictStr] = Field(default=None, description="Additional metadata provided by the provider", alias="providerMetadata")
|
|
33
|
+
additional_properties: Dict[str, Any] = {}
|
|
34
|
+
__properties: ClassVar[List[str]] = ["created", "name", "providerMetadata"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of WorkspaceInfo from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
"additional_properties",
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# puts key-value pairs in additional_properties in the top level
|
|
78
|
+
if self.additional_properties is not None:
|
|
79
|
+
for _key, _value in self.additional_properties.items():
|
|
80
|
+
_dict[_key] = _value
|
|
81
|
+
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of WorkspaceInfo from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"created": obj.get("created"),
|
|
95
|
+
"name": obj.get("name") if obj.get("name") is not None else '',
|
|
96
|
+
"providerMetadata": obj.get("providerMetadata")
|
|
97
|
+
})
|
|
98
|
+
# store additional fields in additional_properties
|
|
99
|
+
for _key in obj.keys():
|
|
100
|
+
if _key not in cls.__properties:
|
|
101
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
102
|
+
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Daytona
|
|
5
|
+
|
|
6
|
+
Daytona AI platform API Docs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@daytona.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class WorkspaceLabels(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
WorkspaceLabels
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
labels: Dict[str, StrictStr] = Field(description="Key-value pairs of labels")
|
|
31
|
+
additional_properties: Dict[str, Any] = {}
|
|
32
|
+
__properties: ClassVar[List[str]] = ["labels"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of WorkspaceLabels from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
"additional_properties",
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# puts key-value pairs in additional_properties in the top level
|
|
76
|
+
if self.additional_properties is not None:
|
|
77
|
+
for _key, _value in self.additional_properties.items():
|
|
78
|
+
_dict[_key] = _value
|
|
79
|
+
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of WorkspaceLabels from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"labels": obj.get("labels")
|
|
93
|
+
})
|
|
94
|
+
# store additional fields in additional_properties
|
|
95
|
+
for _key in obj.keys():
|
|
96
|
+
if _key not in cls.__properties:
|
|
97
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
98
|
+
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Daytona
|
|
5
|
+
|
|
6
|
+
Daytona AI platform API Docs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@daytona.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import json
|
|
18
|
+
from enum import Enum
|
|
19
|
+
from typing_extensions import Self
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class WorkspaceState(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
The state of the workspace
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
CREATING = 'creating'
|
|
31
|
+
RESTORING = 'restoring'
|
|
32
|
+
DESTROYED = 'destroyed'
|
|
33
|
+
DESTROYING = 'destroying'
|
|
34
|
+
STARTED = 'started'
|
|
35
|
+
STOPPED = 'stopped'
|
|
36
|
+
STARTING = 'starting'
|
|
37
|
+
STOPPING = 'stopping'
|
|
38
|
+
ERROR = 'error'
|
|
39
|
+
PENDING_BUILD = 'pending_build'
|
|
40
|
+
BUILDING_SNAPSHOT = 'building_snapshot'
|
|
41
|
+
UNKNOWN = 'unknown'
|
|
42
|
+
PULLING_SNAPSHOT = 'pulling_snapshot'
|
|
43
|
+
ARCHIVING = 'archiving'
|
|
44
|
+
ARCHIVED = 'archived'
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_json(cls, json_str: str) -> Self:
|
|
48
|
+
"""Create an instance of WorkspaceState from a JSON string"""
|
|
49
|
+
return cls(json.loads(json_str))
|
|
50
|
+
|
|
51
|
+
|