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,121 @@
|
|
|
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.models.command import Command
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Session(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Session
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
session_id: StrictStr = Field(description="The ID of the session", alias="sessionId")
|
|
34
|
+
commands: Optional[List[Command]] = Field(description="The list of commands executed in this session")
|
|
35
|
+
additional_properties: Dict[str, Any] = {}
|
|
36
|
+
__properties: ClassVar[List[str]] = ["sessionId", "commands"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of Session from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set(
|
|
70
|
+
[
|
|
71
|
+
"additional_properties",
|
|
72
|
+
]
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of each item in commands (list)
|
|
81
|
+
_items = []
|
|
82
|
+
if self.commands:
|
|
83
|
+
for _item_commands in self.commands:
|
|
84
|
+
if _item_commands:
|
|
85
|
+
_items.append(_item_commands.to_dict())
|
|
86
|
+
_dict["commands"] = _items
|
|
87
|
+
# puts key-value pairs in additional_properties in the top level
|
|
88
|
+
if self.additional_properties is not None:
|
|
89
|
+
for _key, _value in self.additional_properties.items():
|
|
90
|
+
_dict[_key] = _value
|
|
91
|
+
|
|
92
|
+
# set to None if commands (nullable) is None
|
|
93
|
+
# and model_fields_set contains the field
|
|
94
|
+
if self.commands is None and "commands" in self.model_fields_set:
|
|
95
|
+
_dict["commands"] = None
|
|
96
|
+
|
|
97
|
+
return _dict
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
101
|
+
"""Create an instance of Session from a dict"""
|
|
102
|
+
if obj is None:
|
|
103
|
+
return None
|
|
104
|
+
|
|
105
|
+
if not isinstance(obj, dict):
|
|
106
|
+
return cls.model_validate(obj)
|
|
107
|
+
|
|
108
|
+
_obj = cls.model_validate(
|
|
109
|
+
{
|
|
110
|
+
"sessionId": obj.get("sessionId"),
|
|
111
|
+
"commands": [Command.from_dict(_item) for _item in obj["commands"]]
|
|
112
|
+
if obj.get("commands") is not None
|
|
113
|
+
else None,
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
# store additional fields in additional_properties
|
|
117
|
+
for _key in obj.keys():
|
|
118
|
+
if _key not in cls.__properties:
|
|
119
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
120
|
+
|
|
121
|
+
return _obj
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class SessionExecuteRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SessionExecuteRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
command: StrictStr = Field(description="The command to execute")
|
|
33
|
+
run_async: Optional[StrictBool] = Field(
|
|
34
|
+
default=None, description="Whether to execute the command asynchronously", alias="runAsync"
|
|
35
|
+
)
|
|
36
|
+
var_async: Optional[StrictBool] = Field(
|
|
37
|
+
default=None,
|
|
38
|
+
description="Deprecated: Use runAsync instead. Whether to execute the command asynchronously",
|
|
39
|
+
alias="async",
|
|
40
|
+
)
|
|
41
|
+
additional_properties: Dict[str, Any] = {}
|
|
42
|
+
__properties: ClassVar[List[str]] = ["command", "runAsync", "async"]
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(
|
|
45
|
+
populate_by_name=True,
|
|
46
|
+
validate_assignment=True,
|
|
47
|
+
protected_namespaces=(),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of SessionExecuteRequest from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
74
|
+
"""
|
|
75
|
+
excluded_fields: Set[str] = set(
|
|
76
|
+
[
|
|
77
|
+
"additional_properties",
|
|
78
|
+
]
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
_dict = self.model_dump(
|
|
82
|
+
by_alias=True,
|
|
83
|
+
exclude=excluded_fields,
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
# puts key-value pairs in additional_properties in the top level
|
|
87
|
+
if self.additional_properties is not None:
|
|
88
|
+
for _key, _value in self.additional_properties.items():
|
|
89
|
+
_dict[_key] = _value
|
|
90
|
+
|
|
91
|
+
return _dict
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
95
|
+
"""Create an instance of SessionExecuteRequest from a dict"""
|
|
96
|
+
if obj is None:
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
if not isinstance(obj, dict):
|
|
100
|
+
return cls.model_validate(obj)
|
|
101
|
+
|
|
102
|
+
_obj = cls.model_validate(
|
|
103
|
+
{"command": obj.get("command"), "runAsync": obj.get("runAsync"), "async": obj.get("async")}
|
|
104
|
+
)
|
|
105
|
+
# store additional fields in additional_properties
|
|
106
|
+
for _key in obj.keys():
|
|
107
|
+
if _key not in cls.__properties:
|
|
108
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
109
|
+
|
|
110
|
+
return _obj
|
|
@@ -0,0 +1,106 @@
|
|
|
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 SessionExecuteResponse(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SessionExecuteResponse
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
cmd_id: Optional[StrictStr] = Field(default=None, description="The ID of the executed command", alias="cmdId")
|
|
33
|
+
output: Optional[StrictStr] = Field(default=None, description="The output of the executed command")
|
|
34
|
+
exit_code: Optional[Union[StrictFloat, StrictInt]] = Field(
|
|
35
|
+
default=None, description="The exit code of the executed command", alias="exitCode"
|
|
36
|
+
)
|
|
37
|
+
additional_properties: Dict[str, Any] = {}
|
|
38
|
+
__properties: ClassVar[List[str]] = ["cmdId", "output", "exitCode"]
|
|
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 SessionExecuteResponse 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 SessionExecuteResponse 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(
|
|
99
|
+
{"cmdId": obj.get("cmdId"), "output": obj.get("output"), "exitCode": obj.get("exitCode")}
|
|
100
|
+
)
|
|
101
|
+
# store additional fields in additional_properties
|
|
102
|
+
for _key in obj.keys():
|
|
103
|
+
if _key not in cls.__properties:
|
|
104
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
105
|
+
|
|
106
|
+
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, Field, StrictBool
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class SetSnapshotGeneralStatusDto(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SetSnapshotGeneralStatusDto
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
general: StrictBool = Field(description="Whether the snapshot is general")
|
|
33
|
+
additional_properties: Dict[str, Any] = {}
|
|
34
|
+
__properties: ClassVar[List[str]] = ["general"]
|
|
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 SetSnapshotGeneralStatusDto 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 SetSnapshotGeneralStatusDto 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({"general": obj.get("general")})
|
|
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,185 @@
|
|
|
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, StrictBool, StrictFloat, StrictInt, StrictStr
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
24
|
+
from daytona_api_client.models.build_info import BuildInfo
|
|
25
|
+
from daytona_api_client.models.snapshot_state import SnapshotState
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SnapshotDto(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
SnapshotDto
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
|
|
35
|
+
id: StrictStr
|
|
36
|
+
organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId")
|
|
37
|
+
general: StrictBool
|
|
38
|
+
name: StrictStr
|
|
39
|
+
image_name: Optional[StrictStr] = Field(default=None, alias="imageName")
|
|
40
|
+
enabled: StrictBool
|
|
41
|
+
state: SnapshotState
|
|
42
|
+
size: Optional[Union[StrictFloat, StrictInt]]
|
|
43
|
+
entrypoint: Optional[List[StrictStr]]
|
|
44
|
+
cpu: Union[StrictFloat, StrictInt]
|
|
45
|
+
gpu: Union[StrictFloat, StrictInt]
|
|
46
|
+
mem: Union[StrictFloat, StrictInt]
|
|
47
|
+
disk: Union[StrictFloat, StrictInt]
|
|
48
|
+
error_reason: Optional[StrictStr] = Field(alias="errorReason")
|
|
49
|
+
created_at: datetime = Field(alias="createdAt")
|
|
50
|
+
updated_at: datetime = Field(alias="updatedAt")
|
|
51
|
+
last_used_at: Optional[datetime] = Field(alias="lastUsedAt")
|
|
52
|
+
build_info: Optional[BuildInfo] = Field(
|
|
53
|
+
default=None, description="Build information for the snapshot", alias="buildInfo"
|
|
54
|
+
)
|
|
55
|
+
additional_properties: Dict[str, Any] = {}
|
|
56
|
+
__properties: ClassVar[List[str]] = [
|
|
57
|
+
"id",
|
|
58
|
+
"organizationId",
|
|
59
|
+
"general",
|
|
60
|
+
"name",
|
|
61
|
+
"imageName",
|
|
62
|
+
"enabled",
|
|
63
|
+
"state",
|
|
64
|
+
"size",
|
|
65
|
+
"entrypoint",
|
|
66
|
+
"cpu",
|
|
67
|
+
"gpu",
|
|
68
|
+
"mem",
|
|
69
|
+
"disk",
|
|
70
|
+
"errorReason",
|
|
71
|
+
"createdAt",
|
|
72
|
+
"updatedAt",
|
|
73
|
+
"lastUsedAt",
|
|
74
|
+
"buildInfo",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
model_config = ConfigDict(
|
|
78
|
+
populate_by_name=True,
|
|
79
|
+
validate_assignment=True,
|
|
80
|
+
protected_namespaces=(),
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
def to_str(self) -> str:
|
|
84
|
+
"""Returns the string representation of the model using alias"""
|
|
85
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
86
|
+
|
|
87
|
+
def to_json(self) -> str:
|
|
88
|
+
"""Returns the JSON representation of the model using alias"""
|
|
89
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
90
|
+
return json.dumps(self.to_dict())
|
|
91
|
+
|
|
92
|
+
@classmethod
|
|
93
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
94
|
+
"""Create an instance of SnapshotDto from a JSON string"""
|
|
95
|
+
return cls.from_dict(json.loads(json_str))
|
|
96
|
+
|
|
97
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
98
|
+
"""Return the dictionary representation of the model using alias.
|
|
99
|
+
|
|
100
|
+
This has the following differences from calling pydantic's
|
|
101
|
+
`self.model_dump(by_alias=True)`:
|
|
102
|
+
|
|
103
|
+
* `None` is only added to the output dict for nullable fields that
|
|
104
|
+
were set at model initialization. Other fields with value `None`
|
|
105
|
+
are ignored.
|
|
106
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
107
|
+
"""
|
|
108
|
+
excluded_fields: Set[str] = set(
|
|
109
|
+
[
|
|
110
|
+
"additional_properties",
|
|
111
|
+
]
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
_dict = self.model_dump(
|
|
115
|
+
by_alias=True,
|
|
116
|
+
exclude=excluded_fields,
|
|
117
|
+
exclude_none=True,
|
|
118
|
+
)
|
|
119
|
+
# override the default output from pydantic by calling `to_dict()` of build_info
|
|
120
|
+
if self.build_info:
|
|
121
|
+
_dict["buildInfo"] = self.build_info.to_dict()
|
|
122
|
+
# puts key-value pairs in additional_properties in the top level
|
|
123
|
+
if self.additional_properties is not None:
|
|
124
|
+
for _key, _value in self.additional_properties.items():
|
|
125
|
+
_dict[_key] = _value
|
|
126
|
+
|
|
127
|
+
# set to None if size (nullable) is None
|
|
128
|
+
# and model_fields_set contains the field
|
|
129
|
+
if self.size is None and "size" in self.model_fields_set:
|
|
130
|
+
_dict["size"] = None
|
|
131
|
+
|
|
132
|
+
# set to None if entrypoint (nullable) is None
|
|
133
|
+
# and model_fields_set contains the field
|
|
134
|
+
if self.entrypoint is None and "entrypoint" in self.model_fields_set:
|
|
135
|
+
_dict["entrypoint"] = None
|
|
136
|
+
|
|
137
|
+
# set to None if error_reason (nullable) is None
|
|
138
|
+
# and model_fields_set contains the field
|
|
139
|
+
if self.error_reason is None and "error_reason" in self.model_fields_set:
|
|
140
|
+
_dict["errorReason"] = None
|
|
141
|
+
|
|
142
|
+
# set to None if last_used_at (nullable) is None
|
|
143
|
+
# and model_fields_set contains the field
|
|
144
|
+
if self.last_used_at is None and "last_used_at" in self.model_fields_set:
|
|
145
|
+
_dict["lastUsedAt"] = None
|
|
146
|
+
|
|
147
|
+
return _dict
|
|
148
|
+
|
|
149
|
+
@classmethod
|
|
150
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
151
|
+
"""Create an instance of SnapshotDto from a dict"""
|
|
152
|
+
if obj is None:
|
|
153
|
+
return None
|
|
154
|
+
|
|
155
|
+
if not isinstance(obj, dict):
|
|
156
|
+
return cls.model_validate(obj)
|
|
157
|
+
|
|
158
|
+
_obj = cls.model_validate(
|
|
159
|
+
{
|
|
160
|
+
"id": obj.get("id"),
|
|
161
|
+
"organizationId": obj.get("organizationId"),
|
|
162
|
+
"general": obj.get("general"),
|
|
163
|
+
"name": obj.get("name"),
|
|
164
|
+
"imageName": obj.get("imageName"),
|
|
165
|
+
"enabled": obj.get("enabled"),
|
|
166
|
+
"state": obj.get("state"),
|
|
167
|
+
"size": obj.get("size"),
|
|
168
|
+
"entrypoint": obj.get("entrypoint"),
|
|
169
|
+
"cpu": obj.get("cpu"),
|
|
170
|
+
"gpu": obj.get("gpu"),
|
|
171
|
+
"mem": obj.get("mem"),
|
|
172
|
+
"disk": obj.get("disk"),
|
|
173
|
+
"errorReason": obj.get("errorReason"),
|
|
174
|
+
"createdAt": obj.get("createdAt"),
|
|
175
|
+
"updatedAt": obj.get("updatedAt"),
|
|
176
|
+
"lastUsedAt": obj.get("lastUsedAt"),
|
|
177
|
+
"buildInfo": BuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None,
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
# store additional fields in additional_properties
|
|
181
|
+
for _key in obj.keys():
|
|
182
|
+
if _key not in cls.__properties:
|
|
183
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
184
|
+
|
|
185
|
+
return _obj
|
|
@@ -0,0 +1,44 @@
|
|
|
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 SnapshotState(str, Enum):
|
|
23
|
+
"""
|
|
24
|
+
SnapshotState
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
allowed enum values
|
|
29
|
+
"""
|
|
30
|
+
BUILD_PENDING = "build_pending"
|
|
31
|
+
BUILDING = "building"
|
|
32
|
+
PENDING = "pending"
|
|
33
|
+
PULLING = "pulling"
|
|
34
|
+
PENDING_VALIDATION = "pending_validation"
|
|
35
|
+
VALIDATING = "validating"
|
|
36
|
+
ACTIVE = "active"
|
|
37
|
+
ERROR = "error"
|
|
38
|
+
BUILD_FAILED = "build_failed"
|
|
39
|
+
REMOVING = "removing"
|
|
40
|
+
|
|
41
|
+
@classmethod
|
|
42
|
+
def from_json(cls, json_str: str) -> Self:
|
|
43
|
+
"""Create an instance of SnapshotState from a JSON string"""
|
|
44
|
+
return cls(json.loads(json_str))
|