daytona_api_client 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 might be problematic. Click here for more details.
- daytona_api_client/__init__.py +129 -0
- daytona_api_client/api/__init__.py +15 -0
- daytona_api_client/api/api_keys_api.py +1234 -0
- daytona_api_client/api/docker_registry_api.py +1741 -0
- daytona_api_client/api/object_storage_api.py +268 -0
- daytona_api_client/api/organizations_api.py +5792 -0
- daytona_api_client/api/preview_api.py +715 -0
- daytona_api_client/api/runners_api.py +664 -0
- daytona_api_client/api/sandbox_api.py +3584 -0
- daytona_api_client/api/snapshots_api.py +1830 -0
- daytona_api_client/api/toolbox_api.py +10545 -0
- daytona_api_client/api/users_api.py +1733 -0
- daytona_api_client/api/volumes_api.py +1267 -0
- daytona_api_client/api/workspace_api.py +3626 -0
- daytona_api_client/api_client.py +696 -0
- daytona_api_client/api_response.py +20 -0
- daytona_api_client/configuration.py +586 -0
- daytona_api_client/exceptions.py +216 -0
- daytona_api_client/models/__init__.py +101 -0
- daytona_api_client/models/account_provider.py +101 -0
- daytona_api_client/models/account_provider_dto.py +101 -0
- daytona_api_client/models/api_key_list.py +149 -0
- daytona_api_client/models/api_key_response.py +142 -0
- daytona_api_client/models/build_info.py +115 -0
- daytona_api_client/models/build_snapshot.py +118 -0
- daytona_api_client/models/command.py +104 -0
- daytona_api_client/models/completion_context.py +103 -0
- daytona_api_client/models/completion_item.py +124 -0
- daytona_api_client/models/completion_list.py +116 -0
- daytona_api_client/models/create_api_key.py +134 -0
- daytona_api_client/models/create_build_info.py +107 -0
- daytona_api_client/models/create_docker_registry.py +123 -0
- daytona_api_client/models/create_linked_account.py +101 -0
- daytona_api_client/models/create_organization.py +100 -0
- daytona_api_client/models/create_organization_invitation.py +122 -0
- daytona_api_client/models/create_organization_quota.py +130 -0
- daytona_api_client/models/create_organization_role.py +126 -0
- daytona_api_client/models/create_runner.py +150 -0
- daytona_api_client/models/create_sandbox.py +198 -0
- daytona_api_client/models/create_session_request.py +100 -0
- daytona_api_client/models/create_snapshot.py +138 -0
- daytona_api_client/models/create_user.py +132 -0
- daytona_api_client/models/create_volume.py +100 -0
- daytona_api_client/models/create_workspace.py +196 -0
- daytona_api_client/models/docker_registry.py +135 -0
- daytona_api_client/models/execute_request.py +104 -0
- daytona_api_client/models/execute_response.py +101 -0
- daytona_api_client/models/file_info.py +118 -0
- daytona_api_client/models/file_status.py +110 -0
- daytona_api_client/models/get_build_logs400_response.py +101 -0
- daytona_api_client/models/git_add_request.py +101 -0
- daytona_api_client/models/git_branch_request.py +101 -0
- daytona_api_client/models/git_checkout_request.py +101 -0
- daytona_api_client/models/git_clone_request.py +114 -0
- daytona_api_client/models/git_commit_info.py +112 -0
- daytona_api_client/models/git_commit_request.py +110 -0
- daytona_api_client/models/git_commit_response.py +100 -0
- daytona_api_client/models/git_delete_branch_request.py +101 -0
- daytona_api_client/models/git_repo_request.py +104 -0
- daytona_api_client/models/git_status.py +122 -0
- daytona_api_client/models/list_branch_response.py +100 -0
- daytona_api_client/models/lsp_completion_params.py +120 -0
- daytona_api_client/models/lsp_document_request.py +104 -0
- daytona_api_client/models/lsp_location.py +107 -0
- daytona_api_client/models/lsp_server_request.py +101 -0
- daytona_api_client/models/lsp_symbol.py +112 -0
- daytona_api_client/models/match.py +102 -0
- daytona_api_client/models/organization.py +134 -0
- daytona_api_client/models/organization_invitation.py +161 -0
- daytona_api_client/models/organization_role.py +147 -0
- daytona_api_client/models/organization_suspension.py +102 -0
- daytona_api_client/models/organization_user.py +145 -0
- daytona_api_client/models/paginated_snapshots_dto.py +120 -0
- daytona_api_client/models/port_preview_url.py +101 -0
- daytona_api_client/models/position.py +101 -0
- daytona_api_client/models/project_dir_response.py +100 -0
- daytona_api_client/models/range.py +113 -0
- daytona_api_client/models/registry_push_access_dto.py +114 -0
- daytona_api_client/models/replace_request.py +104 -0
- daytona_api_client/models/replace_result.py +102 -0
- daytona_api_client/models/sandbox.py +226 -0
- daytona_api_client/models/sandbox_info.py +110 -0
- daytona_api_client/models/sandbox_labels.py +100 -0
- daytona_api_client/models/sandbox_state.py +50 -0
- daytona_api_client/models/sandbox_volume.py +101 -0
- daytona_api_client/models/search_files_response.py +100 -0
- daytona_api_client/models/session.py +121 -0
- daytona_api_client/models/session_execute_request.py +110 -0
- daytona_api_client/models/session_execute_response.py +106 -0
- daytona_api_client/models/set_snapshot_general_status_dto.py +100 -0
- daytona_api_client/models/snapshot_dto.py +185 -0
- daytona_api_client/models/snapshot_state.py +44 -0
- daytona_api_client/models/storage_access_dto.py +121 -0
- daytona_api_client/models/toggle_state.py +100 -0
- daytona_api_client/models/update_assigned_organization_roles.py +100 -0
- daytona_api_client/models/update_docker_registry.py +104 -0
- daytona_api_client/models/update_organization_invitation.py +114 -0
- daytona_api_client/models/update_organization_member_role.py +107 -0
- daytona_api_client/models/update_organization_quota.py +175 -0
- daytona_api_client/models/update_organization_role.py +126 -0
- daytona_api_client/models/upload_file.py +101 -0
- daytona_api_client/models/upload_file_dto.py +101 -0
- daytona_api_client/models/upload_file_request_file.py +159 -0
- daytona_api_client/models/upload_files_multi_request_files_inner.py +101 -0
- daytona_api_client/models/usage_overview.py +124 -0
- daytona_api_client/models/user.py +120 -0
- daytona_api_client/models/user_public_key.py +101 -0
- daytona_api_client/models/volume.py +133 -0
- daytona_api_client/models/volume_dto.py +138 -0
- daytona_api_client/models/volume_state.py +41 -0
- daytona_api_client/models/workspace.py +259 -0
- daytona_api_client/py.typed +0 -0
- daytona_api_client/rest.py +208 -0
- daytona_api_client-0.21.3a0.dist-info/METADATA +23 -0
- daytona_api_client-0.21.3a0.dist-info/RECORD +117 -0
- daytona_api_client-0.21.3a0.dist-info/WHEEL +5 -0
- daytona_api_client-0.21.3a0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,132 @@
|
|
|
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, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from daytona_api_client.models.create_organization_quota import CreateOrganizationQuota
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class CreateUser(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
CreateUser
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
id: StrictStr
|
|
34
|
+
name: StrictStr
|
|
35
|
+
email: Optional[StrictStr] = None
|
|
36
|
+
personal_organization_quota: Optional[CreateOrganizationQuota] = Field(
|
|
37
|
+
default=None, alias="personalOrganizationQuota"
|
|
38
|
+
)
|
|
39
|
+
role: Optional[StrictStr] = None
|
|
40
|
+
email_verified: Optional[StrictBool] = Field(default=None, alias="emailVerified")
|
|
41
|
+
additional_properties: Dict[str, Any] = {}
|
|
42
|
+
__properties: ClassVar[List[str]] = ["id", "name", "email", "personalOrganizationQuota", "role", "emailVerified"]
|
|
43
|
+
|
|
44
|
+
@field_validator("role")
|
|
45
|
+
def role_validate_enum(cls, value):
|
|
46
|
+
"""Validates the enum"""
|
|
47
|
+
if value is None:
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
if value not in set(["admin", "user"]):
|
|
51
|
+
raise ValueError("must be one of enum values ('admin', 'user')")
|
|
52
|
+
return value
|
|
53
|
+
|
|
54
|
+
model_config = ConfigDict(
|
|
55
|
+
populate_by_name=True,
|
|
56
|
+
validate_assignment=True,
|
|
57
|
+
protected_namespaces=(),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def to_str(self) -> str:
|
|
61
|
+
"""Returns the string representation of the model using alias"""
|
|
62
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
63
|
+
|
|
64
|
+
def to_json(self) -> str:
|
|
65
|
+
"""Returns the JSON representation of the model using alias"""
|
|
66
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
67
|
+
return json.dumps(self.to_dict())
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
71
|
+
"""Create an instance of CreateUser from a JSON string"""
|
|
72
|
+
return cls.from_dict(json.loads(json_str))
|
|
73
|
+
|
|
74
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
75
|
+
"""Return the dictionary representation of the model using alias.
|
|
76
|
+
|
|
77
|
+
This has the following differences from calling pydantic's
|
|
78
|
+
`self.model_dump(by_alias=True)`:
|
|
79
|
+
|
|
80
|
+
* `None` is only added to the output dict for nullable fields that
|
|
81
|
+
were set at model initialization. Other fields with value `None`
|
|
82
|
+
are ignored.
|
|
83
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
84
|
+
"""
|
|
85
|
+
excluded_fields: Set[str] = set(
|
|
86
|
+
[
|
|
87
|
+
"additional_properties",
|
|
88
|
+
]
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
_dict = self.model_dump(
|
|
92
|
+
by_alias=True,
|
|
93
|
+
exclude=excluded_fields,
|
|
94
|
+
exclude_none=True,
|
|
95
|
+
)
|
|
96
|
+
# override the default output from pydantic by calling `to_dict()` of personal_organization_quota
|
|
97
|
+
if self.personal_organization_quota:
|
|
98
|
+
_dict["personalOrganizationQuota"] = self.personal_organization_quota.to_dict()
|
|
99
|
+
# puts key-value pairs in additional_properties in the top level
|
|
100
|
+
if self.additional_properties is not None:
|
|
101
|
+
for _key, _value in self.additional_properties.items():
|
|
102
|
+
_dict[_key] = _value
|
|
103
|
+
|
|
104
|
+
return _dict
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
108
|
+
"""Create an instance of CreateUser from a dict"""
|
|
109
|
+
if obj is None:
|
|
110
|
+
return None
|
|
111
|
+
|
|
112
|
+
if not isinstance(obj, dict):
|
|
113
|
+
return cls.model_validate(obj)
|
|
114
|
+
|
|
115
|
+
_obj = cls.model_validate(
|
|
116
|
+
{
|
|
117
|
+
"id": obj.get("id"),
|
|
118
|
+
"name": obj.get("name"),
|
|
119
|
+
"email": obj.get("email"),
|
|
120
|
+
"personalOrganizationQuota": CreateOrganizationQuota.from_dict(obj["personalOrganizationQuota"])
|
|
121
|
+
if obj.get("personalOrganizationQuota") is not None
|
|
122
|
+
else None,
|
|
123
|
+
"role": obj.get("role"),
|
|
124
|
+
"emailVerified": obj.get("emailVerified"),
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
# store additional fields in additional_properties
|
|
128
|
+
for _key in obj.keys():
|
|
129
|
+
if _key not in cls.__properties:
|
|
130
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
131
|
+
|
|
132
|
+
return _obj
|
|
@@ -0,0 +1,100 @@
|
|
|
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, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CreateVolume(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CreateVolume
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
name: StrictStr
|
|
33
|
+
additional_properties: Dict[str, Any] = {}
|
|
34
|
+
__properties: ClassVar[List[str]] = ["name"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of CreateVolume from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set(
|
|
68
|
+
[
|
|
69
|
+
"additional_properties",
|
|
70
|
+
]
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
# puts key-value pairs in additional_properties in the top level
|
|
79
|
+
if self.additional_properties is not None:
|
|
80
|
+
for _key, _value in self.additional_properties.items():
|
|
81
|
+
_dict[_key] = _value
|
|
82
|
+
|
|
83
|
+
return _dict
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
+
"""Create an instance of CreateVolume from a dict"""
|
|
88
|
+
if obj is None:
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
if not isinstance(obj, dict):
|
|
92
|
+
return cls.model_validate(obj)
|
|
93
|
+
|
|
94
|
+
_obj = cls.model_validate({"name": obj.get("name")})
|
|
95
|
+
# store additional fields in additional_properties
|
|
96
|
+
for _key in obj.keys():
|
|
97
|
+
if _key not in cls.__properties:
|
|
98
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
99
|
+
|
|
100
|
+
return _obj
|
|
@@ -0,0 +1,196 @@
|
|
|
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, StrictInt, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from daytona_api_client.models.create_build_info import CreateBuildInfo
|
|
24
|
+
from daytona_api_client.models.sandbox_volume import SandboxVolume
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class CreateWorkspace(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
CreateWorkspace
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
|
|
34
|
+
image: Optional[StrictStr] = Field(default=None, description="The image used for the workspace")
|
|
35
|
+
user: Optional[StrictStr] = Field(default=None, description="The user associated with the project")
|
|
36
|
+
env: Optional[Dict[str, StrictStr]] = Field(default=None, description="Environment variables for the workspace")
|
|
37
|
+
labels: Optional[Dict[str, StrictStr]] = Field(default=None, description="Labels for the workspace")
|
|
38
|
+
public: Optional[StrictBool] = Field(
|
|
39
|
+
default=None, description="Whether the workspace http preview is publicly accessible"
|
|
40
|
+
)
|
|
41
|
+
var_class: Optional[StrictStr] = Field(default=None, description="The workspace class type", alias="class")
|
|
42
|
+
target: Optional[StrictStr] = Field(
|
|
43
|
+
default=None, description="The target (region) where the workspace will be created"
|
|
44
|
+
)
|
|
45
|
+
cpu: Optional[StrictInt] = Field(default=None, description="CPU cores allocated to the workspace")
|
|
46
|
+
gpu: Optional[StrictInt] = Field(default=None, description="GPU units allocated to the workspace")
|
|
47
|
+
memory: Optional[StrictInt] = Field(default=None, description="Memory allocated to the workspace in GB")
|
|
48
|
+
disk: Optional[StrictInt] = Field(default=None, description="Disk space allocated to the workspace in GB")
|
|
49
|
+
auto_stop_interval: Optional[StrictInt] = Field(
|
|
50
|
+
default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval"
|
|
51
|
+
)
|
|
52
|
+
auto_archive_interval: Optional[StrictInt] = Field(
|
|
53
|
+
default=None,
|
|
54
|
+
description="Auto-archive interval in minutes (0 means the maximum interval will be used)",
|
|
55
|
+
alias="autoArchiveInterval",
|
|
56
|
+
)
|
|
57
|
+
volumes: Optional[List[SandboxVolume]] = Field(
|
|
58
|
+
default=None, description="Array of volumes to attach to the workspace"
|
|
59
|
+
)
|
|
60
|
+
build_info: Optional[CreateBuildInfo] = Field(
|
|
61
|
+
default=None, description="Build information for the workspace", alias="buildInfo"
|
|
62
|
+
)
|
|
63
|
+
additional_properties: Dict[str, Any] = {}
|
|
64
|
+
__properties: ClassVar[List[str]] = [
|
|
65
|
+
"image",
|
|
66
|
+
"user",
|
|
67
|
+
"env",
|
|
68
|
+
"labels",
|
|
69
|
+
"public",
|
|
70
|
+
"class",
|
|
71
|
+
"target",
|
|
72
|
+
"cpu",
|
|
73
|
+
"gpu",
|
|
74
|
+
"memory",
|
|
75
|
+
"disk",
|
|
76
|
+
"autoStopInterval",
|
|
77
|
+
"autoArchiveInterval",
|
|
78
|
+
"volumes",
|
|
79
|
+
"buildInfo",
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
@field_validator("var_class")
|
|
83
|
+
def var_class_validate_enum(cls, value):
|
|
84
|
+
"""Validates the enum"""
|
|
85
|
+
if value is None:
|
|
86
|
+
return value
|
|
87
|
+
|
|
88
|
+
if value not in set(["small", "medium", "large"]):
|
|
89
|
+
raise ValueError("must be one of enum values ('small', 'medium', 'large')")
|
|
90
|
+
return value
|
|
91
|
+
|
|
92
|
+
@field_validator("target")
|
|
93
|
+
def target_validate_enum(cls, value):
|
|
94
|
+
"""Validates the enum"""
|
|
95
|
+
if value is None:
|
|
96
|
+
return value
|
|
97
|
+
|
|
98
|
+
if value not in set(["eu", "us", "asia"]):
|
|
99
|
+
raise ValueError("must be one of enum values ('eu', 'us', 'asia')")
|
|
100
|
+
return value
|
|
101
|
+
|
|
102
|
+
model_config = ConfigDict(
|
|
103
|
+
populate_by_name=True,
|
|
104
|
+
validate_assignment=True,
|
|
105
|
+
protected_namespaces=(),
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
def to_str(self) -> str:
|
|
109
|
+
"""Returns the string representation of the model using alias"""
|
|
110
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
111
|
+
|
|
112
|
+
def to_json(self) -> str:
|
|
113
|
+
"""Returns the JSON representation of the model using alias"""
|
|
114
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
115
|
+
return json.dumps(self.to_dict())
|
|
116
|
+
|
|
117
|
+
@classmethod
|
|
118
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
119
|
+
"""Create an instance of CreateWorkspace from a JSON string"""
|
|
120
|
+
return cls.from_dict(json.loads(json_str))
|
|
121
|
+
|
|
122
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
123
|
+
"""Return the dictionary representation of the model using alias.
|
|
124
|
+
|
|
125
|
+
This has the following differences from calling pydantic's
|
|
126
|
+
`self.model_dump(by_alias=True)`:
|
|
127
|
+
|
|
128
|
+
* `None` is only added to the output dict for nullable fields that
|
|
129
|
+
were set at model initialization. Other fields with value `None`
|
|
130
|
+
are ignored.
|
|
131
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
132
|
+
"""
|
|
133
|
+
excluded_fields: Set[str] = set(
|
|
134
|
+
[
|
|
135
|
+
"additional_properties",
|
|
136
|
+
]
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
_dict = self.model_dump(
|
|
140
|
+
by_alias=True,
|
|
141
|
+
exclude=excluded_fields,
|
|
142
|
+
exclude_none=True,
|
|
143
|
+
)
|
|
144
|
+
# override the default output from pydantic by calling `to_dict()` of each item in volumes (list)
|
|
145
|
+
_items = []
|
|
146
|
+
if self.volumes:
|
|
147
|
+
for _item_volumes in self.volumes:
|
|
148
|
+
if _item_volumes:
|
|
149
|
+
_items.append(_item_volumes.to_dict())
|
|
150
|
+
_dict["volumes"] = _items
|
|
151
|
+
# override the default output from pydantic by calling `to_dict()` of build_info
|
|
152
|
+
if self.build_info:
|
|
153
|
+
_dict["buildInfo"] = self.build_info.to_dict()
|
|
154
|
+
# puts key-value pairs in additional_properties in the top level
|
|
155
|
+
if self.additional_properties is not None:
|
|
156
|
+
for _key, _value in self.additional_properties.items():
|
|
157
|
+
_dict[_key] = _value
|
|
158
|
+
|
|
159
|
+
return _dict
|
|
160
|
+
|
|
161
|
+
@classmethod
|
|
162
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
163
|
+
"""Create an instance of CreateWorkspace from a dict"""
|
|
164
|
+
if obj is None:
|
|
165
|
+
return None
|
|
166
|
+
|
|
167
|
+
if not isinstance(obj, dict):
|
|
168
|
+
return cls.model_validate(obj)
|
|
169
|
+
|
|
170
|
+
_obj = cls.model_validate(
|
|
171
|
+
{
|
|
172
|
+
"image": obj.get("image"),
|
|
173
|
+
"user": obj.get("user"),
|
|
174
|
+
"env": obj.get("env"),
|
|
175
|
+
"labels": obj.get("labels"),
|
|
176
|
+
"public": obj.get("public"),
|
|
177
|
+
"class": obj.get("class"),
|
|
178
|
+
"target": obj.get("target"),
|
|
179
|
+
"cpu": obj.get("cpu"),
|
|
180
|
+
"gpu": obj.get("gpu"),
|
|
181
|
+
"memory": obj.get("memory"),
|
|
182
|
+
"disk": obj.get("disk"),
|
|
183
|
+
"autoStopInterval": obj.get("autoStopInterval"),
|
|
184
|
+
"autoArchiveInterval": obj.get("autoArchiveInterval"),
|
|
185
|
+
"volumes": [SandboxVolume.from_dict(_item) for _item in obj["volumes"]]
|
|
186
|
+
if obj.get("volumes") is not None
|
|
187
|
+
else None,
|
|
188
|
+
"buildInfo": CreateBuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None,
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
# store additional fields in additional_properties
|
|
192
|
+
for _key in obj.keys():
|
|
193
|
+
if _key not in cls.__properties:
|
|
194
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
195
|
+
|
|
196
|
+
return _obj
|
|
@@ -0,0 +1,135 @@
|
|
|
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 datetime import datetime
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
23
|
+
from typing import Any, ClassVar, Dict, List
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DockerRegistry(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
DockerRegistry
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
id: StrictStr = Field(description="Registry ID")
|
|
34
|
+
name: StrictStr = Field(description="Registry name")
|
|
35
|
+
url: StrictStr = Field(description="Registry URL")
|
|
36
|
+
username: StrictStr = Field(description="Registry username")
|
|
37
|
+
project: StrictStr = Field(description="Registry project")
|
|
38
|
+
registry_type: StrictStr = Field(description="Registry type", alias="registryType")
|
|
39
|
+
created_at: datetime = Field(description="Creation timestamp", alias="createdAt")
|
|
40
|
+
updated_at: datetime = Field(description="Last update timestamp", alias="updatedAt")
|
|
41
|
+
additional_properties: Dict[str, Any] = {}
|
|
42
|
+
__properties: ClassVar[List[str]] = [
|
|
43
|
+
"id",
|
|
44
|
+
"name",
|
|
45
|
+
"url",
|
|
46
|
+
"username",
|
|
47
|
+
"project",
|
|
48
|
+
"registryType",
|
|
49
|
+
"createdAt",
|
|
50
|
+
"updatedAt",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
@field_validator("registry_type")
|
|
54
|
+
def registry_type_validate_enum(cls, value):
|
|
55
|
+
"""Validates the enum"""
|
|
56
|
+
if value not in set(["internal", "organization", "public", "transient"]):
|
|
57
|
+
raise ValueError("must be one of enum values ('internal', 'organization', 'public', 'transient')")
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
model_config = ConfigDict(
|
|
61
|
+
populate_by_name=True,
|
|
62
|
+
validate_assignment=True,
|
|
63
|
+
protected_namespaces=(),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def to_str(self) -> str:
|
|
67
|
+
"""Returns the string representation of the model using alias"""
|
|
68
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
69
|
+
|
|
70
|
+
def to_json(self) -> str:
|
|
71
|
+
"""Returns the JSON representation of the model using alias"""
|
|
72
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
73
|
+
return json.dumps(self.to_dict())
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of DockerRegistry from a JSON string"""
|
|
78
|
+
return cls.from_dict(json.loads(json_str))
|
|
79
|
+
|
|
80
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
81
|
+
"""Return the dictionary representation of the model using alias.
|
|
82
|
+
|
|
83
|
+
This has the following differences from calling pydantic's
|
|
84
|
+
`self.model_dump(by_alias=True)`:
|
|
85
|
+
|
|
86
|
+
* `None` is only added to the output dict for nullable fields that
|
|
87
|
+
were set at model initialization. Other fields with value `None`
|
|
88
|
+
are ignored.
|
|
89
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
90
|
+
"""
|
|
91
|
+
excluded_fields: Set[str] = set(
|
|
92
|
+
[
|
|
93
|
+
"additional_properties",
|
|
94
|
+
]
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
_dict = self.model_dump(
|
|
98
|
+
by_alias=True,
|
|
99
|
+
exclude=excluded_fields,
|
|
100
|
+
exclude_none=True,
|
|
101
|
+
)
|
|
102
|
+
# puts key-value pairs in additional_properties in the top level
|
|
103
|
+
if self.additional_properties is not None:
|
|
104
|
+
for _key, _value in self.additional_properties.items():
|
|
105
|
+
_dict[_key] = _value
|
|
106
|
+
|
|
107
|
+
return _dict
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
111
|
+
"""Create an instance of DockerRegistry from a dict"""
|
|
112
|
+
if obj is None:
|
|
113
|
+
return None
|
|
114
|
+
|
|
115
|
+
if not isinstance(obj, dict):
|
|
116
|
+
return cls.model_validate(obj)
|
|
117
|
+
|
|
118
|
+
_obj = cls.model_validate(
|
|
119
|
+
{
|
|
120
|
+
"id": obj.get("id"),
|
|
121
|
+
"name": obj.get("name"),
|
|
122
|
+
"url": obj.get("url"),
|
|
123
|
+
"username": obj.get("username"),
|
|
124
|
+
"project": obj.get("project"),
|
|
125
|
+
"registryType": obj.get("registryType"),
|
|
126
|
+
"createdAt": obj.get("createdAt"),
|
|
127
|
+
"updatedAt": obj.get("updatedAt"),
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
# store additional fields in additional_properties
|
|
131
|
+
for _key in obj.keys():
|
|
132
|
+
if _key not in cls.__properties:
|
|
133
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
134
|
+
|
|
135
|
+
return _obj
|
|
@@ -0,0 +1,104 @@
|
|
|
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, StrictFloat, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ExecuteRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ExecuteRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
command: StrictStr
|
|
33
|
+
cwd: Optional[StrictStr] = Field(default=None, description="Current working directory")
|
|
34
|
+
timeout: Optional[Union[StrictFloat, StrictInt]] = Field(
|
|
35
|
+
default=None, description="Timeout in seconds, defaults to 10 seconds"
|
|
36
|
+
)
|
|
37
|
+
additional_properties: Dict[str, Any] = {}
|
|
38
|
+
__properties: ClassVar[List[str]] = ["command", "cwd", "timeout"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of ExecuteRequest from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set(
|
|
72
|
+
[
|
|
73
|
+
"additional_properties",
|
|
74
|
+
]
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
# puts key-value pairs in additional_properties in the top level
|
|
83
|
+
if self.additional_properties is not None:
|
|
84
|
+
for _key, _value in self.additional_properties.items():
|
|
85
|
+
_dict[_key] = _value
|
|
86
|
+
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of ExecuteRequest from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({"command": obj.get("command"), "cwd": obj.get("cwd"), "timeout": obj.get("timeout")})
|
|
99
|
+
# store additional fields in additional_properties
|
|
100
|
+
for _key in obj.keys():
|
|
101
|
+
if _key not in cls.__properties:
|
|
102
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
103
|
+
|
|
104
|
+
return _obj
|