daytona_api_client 0.21.3a0__py3-none-any.whl → 0.21.5a0__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/api/__init__.py +1 -0
- daytona_api_client/api/api_keys_api.py +328 -171
- daytona_api_client/api/docker_registry_api.py +463 -239
- daytona_api_client/api/object_storage_api.py +63 -33
- daytona_api_client/api/organizations_api.py +1582 -612
- daytona_api_client/api/preview_api.py +175 -71
- daytona_api_client/api/runners_api.py +195 -67
- daytona_api_client/api/sandbox_api.py +909 -499
- daytona_api_client/api/snapshots_api.py +482 -253
- daytona_api_client/api/toolbox_api.py +2684 -1410
- daytona_api_client/api/users_api.py +526 -184
- daytona_api_client/api/volumes_api.py +332 -180
- daytona_api_client/api/workspace_api.py +909 -499
- daytona_api_client/api_client.py +192 -90
- daytona_api_client/api_response.py +3 -2
- daytona_api_client/configuration.py +52 -55
- daytona_api_client/exceptions.py +16 -15
- daytona_api_client/models/account_provider.py +11 -9
- daytona_api_client/models/api_key_list.py +21 -40
- daytona_api_client/models/api_key_response.py +19 -38
- daytona_api_client/models/build_info.py +15 -22
- daytona_api_client/models/command.py +13 -12
- daytona_api_client/models/completion_context.py +11 -11
- daytona_api_client/models/completion_item.py +17 -28
- daytona_api_client/models/completion_list.py +12 -17
- daytona_api_client/models/create_api_key.py +17 -32
- daytona_api_client/models/create_build_info.py +13 -17
- daytona_api_client/models/create_docker_registry.py +18 -21
- daytona_api_client/models/create_linked_account.py +11 -9
- daytona_api_client/models/create_organization.py +10 -9
- daytona_api_client/models/create_organization_invitation.py +17 -24
- daytona_api_client/models/create_organization_quota.py +19 -32
- daytona_api_client/models/create_organization_role.py +15 -28
- daytona_api_client/models/create_runner.py +26 -41
- daytona_api_client/models/create_sandbox.py +39 -76
- daytona_api_client/models/create_session_request.py +10 -9
- daytona_api_client/models/create_snapshot.py +22 -39
- daytona_api_client/models/create_user.py +19 -26
- daytona_api_client/models/create_volume.py +10 -9
- daytona_api_client/models/create_workspace.py +38 -73
- daytona_api_client/models/docker_registry.py +21 -33
- daytona_api_client/models/execute_request.py +13 -12
- daytona_api_client/models/execute_response.py +11 -9
- daytona_api_client/models/file_info.py +17 -20
- daytona_api_client/models/file_status.py +13 -16
- daytona_api_client/models/git_add_request.py +11 -9
- daytona_api_client/models/git_branch_request.py +11 -9
- daytona_api_client/models/git_checkout_request.py +11 -9
- daytona_api_client/models/git_clone_request.py +15 -18
- daytona_api_client/models/git_commit_info.py +14 -17
- daytona_api_client/models/git_commit_request.py +13 -16
- daytona_api_client/models/git_commit_response.py +10 -9
- daytona_api_client/models/git_delete_branch_request.py +11 -9
- daytona_api_client/models/git_repo_request.py +12 -11
- daytona_api_client/models/git_status.py +15 -20
- daytona_api_client/models/list_branch_response.py +10 -9
- daytona_api_client/models/lsp_completion_params.py +16 -19
- daytona_api_client/models/lsp_document_request.py +12 -11
- daytona_api_client/models/lsp_location.py +12 -12
- daytona_api_client/models/lsp_server_request.py +11 -9
- daytona_api_client/models/lsp_symbol.py +13 -16
- daytona_api_client/models/match.py +12 -9
- daytona_api_client/models/organization.py +20 -34
- daytona_api_client/models/organization_invitation.py +27 -44
- daytona_api_client/models/organization_role.py +21 -46
- daytona_api_client/models/organization_suspension.py +11 -9
- daytona_api_client/models/organization_user.py +22 -36
- daytona_api_client/models/paginated_snapshots_dto.py +14 -19
- daytona_api_client/models/port_preview_url.py +11 -9
- daytona_api_client/models/position.py +11 -9
- daytona_api_client/models/project_dir_response.py +10 -9
- daytona_api_client/models/range.py +13 -16
- daytona_api_client/models/registry_push_access_dto.py +15 -18
- daytona_api_client/models/replace_request.py +12 -11
- daytona_api_client/models/replace_result.py +12 -9
- daytona_api_client/models/sandbox.py +49 -95
- daytona_api_client/models/sandbox_info.py +13 -18
- daytona_api_client/models/sandbox_labels.py +10 -9
- daytona_api_client/models/sandbox_state.py +18 -16
- daytona_api_client/models/sandbox_volume.py +11 -9
- daytona_api_client/models/search_files_response.py +10 -9
- daytona_api_client/models/session.py +13 -18
- daytona_api_client/models/session_execute_request.py +14 -19
- daytona_api_client/models/session_execute_response.py +13 -14
- daytona_api_client/models/set_snapshot_general_status_dto.py +10 -9
- daytona_api_client/models/snapshot_dto.py +34 -58
- daytona_api_client/models/snapshot_state.py +12 -10
- daytona_api_client/models/storage_access_dto.py +16 -26
- daytona_api_client/models/toggle_state.py +10 -9
- daytona_api_client/models/update_assigned_organization_roles.py +10 -9
- daytona_api_client/models/update_docker_registry.py +12 -11
- daytona_api_client/models/update_organization_invitation.py +15 -16
- daytona_api_client/models/update_organization_member_role.py +12 -11
- daytona_api_client/models/update_organization_quota.py +28 -41
- daytona_api_client/models/update_organization_role.py +15 -28
- daytona_api_client/models/usage_overview.py +17 -28
- daytona_api_client/models/user.py +14 -19
- daytona_api_client/models/user_public_key.py +11 -9
- daytona_api_client/models/volume_dto.py +20 -32
- daytona_api_client/models/volume_state.py +9 -7
- daytona_api_client/models/workspace.py +58 -113
- daytona_api_client/rest.py +77 -26
- {daytona_api_client-0.21.3a0.dist-info → daytona_api_client-0.21.5a0.dist-info}/METADATA +1 -1
- daytona_api_client-0.21.5a0.dist-info/RECORD +117 -0
- daytona_api_client-0.21.3a0.dist-info/RECORD +0 -117
- {daytona_api_client-0.21.3a0.dist-info → daytona_api_client-0.21.5a0.dist-info}/WHEEL +0 -0
- {daytona_api_client-0.21.3a0.dist-info → daytona_api_client-0.21.5a0.dist-info}/top_level.txt +0 -0
|
@@ -24,12 +24,10 @@ from daytona_api_client.models.position import Position
|
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
26
|
|
|
27
|
-
|
|
28
27
|
class Range(BaseModel):
|
|
29
28
|
"""
|
|
30
29
|
Range
|
|
31
|
-
"""
|
|
32
|
-
|
|
30
|
+
""" # noqa: E501
|
|
33
31
|
start: Position
|
|
34
32
|
end: Position
|
|
35
33
|
additional_properties: Dict[str, Any] = {}
|
|
@@ -41,6 +39,7 @@ class Range(BaseModel):
|
|
|
41
39
|
protected_namespaces=(),
|
|
42
40
|
)
|
|
43
41
|
|
|
42
|
+
|
|
44
43
|
def to_str(self) -> str:
|
|
45
44
|
"""Returns the string representation of the model using alias"""
|
|
46
45
|
return pprint.pformat(self.model_dump(by_alias=True))
|
|
@@ -66,11 +65,9 @@ class Range(BaseModel):
|
|
|
66
65
|
are ignored.
|
|
67
66
|
* Fields in `self.additional_properties` are added to the output dict.
|
|
68
67
|
"""
|
|
69
|
-
excluded_fields: Set[str] = set(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
]
|
|
73
|
-
)
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
"additional_properties",
|
|
70
|
+
])
|
|
74
71
|
|
|
75
72
|
_dict = self.model_dump(
|
|
76
73
|
by_alias=True,
|
|
@@ -79,10 +76,10 @@ class Range(BaseModel):
|
|
|
79
76
|
)
|
|
80
77
|
# override the default output from pydantic by calling `to_dict()` of start
|
|
81
78
|
if self.start:
|
|
82
|
-
_dict[
|
|
79
|
+
_dict['start'] = self.start.to_dict()
|
|
83
80
|
# override the default output from pydantic by calling `to_dict()` of end
|
|
84
81
|
if self.end:
|
|
85
|
-
_dict[
|
|
82
|
+
_dict['end'] = self.end.to_dict()
|
|
86
83
|
# puts key-value pairs in additional_properties in the top level
|
|
87
84
|
if self.additional_properties is not None:
|
|
88
85
|
for _key, _value in self.additional_properties.items():
|
|
@@ -99,15 +96,15 @@ class Range(BaseModel):
|
|
|
99
96
|
if not isinstance(obj, dict):
|
|
100
97
|
return cls.model_validate(obj)
|
|
101
98
|
|
|
102
|
-
_obj = cls.model_validate(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
)
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"start": Position.from_dict(obj["start"]) if obj.get("start") is not None else None,
|
|
101
|
+
"end": Position.from_dict(obj["end"]) if obj.get("end") is not None else None
|
|
102
|
+
})
|
|
108
103
|
# store additional fields in additional_properties
|
|
109
104
|
for _key in obj.keys():
|
|
110
105
|
if _key not in cls.__properties:
|
|
111
106
|
_obj.additional_properties[_key] = obj.get(_key)
|
|
112
107
|
|
|
113
108
|
return _obj
|
|
109
|
+
|
|
110
|
+
|
|
@@ -23,12 +23,10 @@ from typing import Any, ClassVar, Dict, List
|
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
class RegistryPushAccessDto(BaseModel):
|
|
28
27
|
"""
|
|
29
28
|
RegistryPushAccessDto
|
|
30
|
-
"""
|
|
31
|
-
|
|
29
|
+
""" # noqa: E501
|
|
32
30
|
username: StrictStr = Field(description="Temporary username for registry authentication")
|
|
33
31
|
secret: StrictStr = Field(description="Temporary secret for registry authentication")
|
|
34
32
|
registry_url: StrictStr = Field(description="Registry URL", alias="registryUrl")
|
|
@@ -44,6 +42,7 @@ class RegistryPushAccessDto(BaseModel):
|
|
|
44
42
|
protected_namespaces=(),
|
|
45
43
|
)
|
|
46
44
|
|
|
45
|
+
|
|
47
46
|
def to_str(self) -> str:
|
|
48
47
|
"""Returns the string representation of the model using alias"""
|
|
49
48
|
return pprint.pformat(self.model_dump(by_alias=True))
|
|
@@ -69,11 +68,9 @@ class RegistryPushAccessDto(BaseModel):
|
|
|
69
68
|
are ignored.
|
|
70
69
|
* Fields in `self.additional_properties` are added to the output dict.
|
|
71
70
|
"""
|
|
72
|
-
excluded_fields: Set[str] = set(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]
|
|
76
|
-
)
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
"additional_properties",
|
|
73
|
+
])
|
|
77
74
|
|
|
78
75
|
_dict = self.model_dump(
|
|
79
76
|
by_alias=True,
|
|
@@ -96,19 +93,19 @@ class RegistryPushAccessDto(BaseModel):
|
|
|
96
93
|
if not isinstance(obj, dict):
|
|
97
94
|
return cls.model_validate(obj)
|
|
98
95
|
|
|
99
|
-
_obj = cls.model_validate(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
)
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"username": obj.get("username"),
|
|
98
|
+
"secret": obj.get("secret"),
|
|
99
|
+
"registryUrl": obj.get("registryUrl"),
|
|
100
|
+
"registryId": obj.get("registryId"),
|
|
101
|
+
"project": obj.get("project"),
|
|
102
|
+
"expiresAt": obj.get("expiresAt")
|
|
103
|
+
})
|
|
109
104
|
# store additional fields in additional_properties
|
|
110
105
|
for _key in obj.keys():
|
|
111
106
|
if _key not in cls.__properties:
|
|
112
107
|
_obj.additional_properties[_key] = obj.get(_key)
|
|
113
108
|
|
|
114
109
|
return _obj
|
|
110
|
+
|
|
111
|
+
|
|
@@ -23,12 +23,10 @@ from typing import Any, ClassVar, Dict, List
|
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
class ReplaceRequest(BaseModel):
|
|
28
27
|
"""
|
|
29
28
|
ReplaceRequest
|
|
30
|
-
"""
|
|
31
|
-
|
|
29
|
+
""" # noqa: E501
|
|
32
30
|
files: List[StrictStr]
|
|
33
31
|
pattern: StrictStr
|
|
34
32
|
new_value: StrictStr = Field(alias="newValue")
|
|
@@ -41,6 +39,7 @@ class ReplaceRequest(BaseModel):
|
|
|
41
39
|
protected_namespaces=(),
|
|
42
40
|
)
|
|
43
41
|
|
|
42
|
+
|
|
44
43
|
def to_str(self) -> str:
|
|
45
44
|
"""Returns the string representation of the model using alias"""
|
|
46
45
|
return pprint.pformat(self.model_dump(by_alias=True))
|
|
@@ -66,11 +65,9 @@ class ReplaceRequest(BaseModel):
|
|
|
66
65
|
are ignored.
|
|
67
66
|
* Fields in `self.additional_properties` are added to the output dict.
|
|
68
67
|
"""
|
|
69
|
-
excluded_fields: Set[str] = set(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
]
|
|
73
|
-
)
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
"additional_properties",
|
|
70
|
+
])
|
|
74
71
|
|
|
75
72
|
_dict = self.model_dump(
|
|
76
73
|
by_alias=True,
|
|
@@ -93,12 +90,16 @@ class ReplaceRequest(BaseModel):
|
|
|
93
90
|
if not isinstance(obj, dict):
|
|
94
91
|
return cls.model_validate(obj)
|
|
95
92
|
|
|
96
|
-
_obj = cls.model_validate(
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"files": obj.get("files"),
|
|
95
|
+
"pattern": obj.get("pattern"),
|
|
96
|
+
"newValue": obj.get("newValue")
|
|
97
|
+
})
|
|
99
98
|
# store additional fields in additional_properties
|
|
100
99
|
for _key in obj.keys():
|
|
101
100
|
if _key not in cls.__properties:
|
|
102
101
|
_obj.additional_properties[_key] = obj.get(_key)
|
|
103
102
|
|
|
104
103
|
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -23,12 +23,10 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
class ReplaceResult(BaseModel):
|
|
28
27
|
"""
|
|
29
28
|
ReplaceResult
|
|
30
|
-
"""
|
|
31
|
-
|
|
29
|
+
""" # noqa: E501
|
|
32
30
|
file: Optional[StrictStr] = None
|
|
33
31
|
success: Optional[StrictBool] = None
|
|
34
32
|
error: Optional[StrictStr] = None
|
|
@@ -41,6 +39,7 @@ class ReplaceResult(BaseModel):
|
|
|
41
39
|
protected_namespaces=(),
|
|
42
40
|
)
|
|
43
41
|
|
|
42
|
+
|
|
44
43
|
def to_str(self) -> str:
|
|
45
44
|
"""Returns the string representation of the model using alias"""
|
|
46
45
|
return pprint.pformat(self.model_dump(by_alias=True))
|
|
@@ -66,11 +65,9 @@ class ReplaceResult(BaseModel):
|
|
|
66
65
|
are ignored.
|
|
67
66
|
* Fields in `self.additional_properties` are added to the output dict.
|
|
68
67
|
"""
|
|
69
|
-
excluded_fields: Set[str] = set(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
]
|
|
73
|
-
)
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
"additional_properties",
|
|
70
|
+
])
|
|
74
71
|
|
|
75
72
|
_dict = self.model_dump(
|
|
76
73
|
by_alias=True,
|
|
@@ -93,10 +90,16 @@ class ReplaceResult(BaseModel):
|
|
|
93
90
|
if not isinstance(obj, dict):
|
|
94
91
|
return cls.model_validate(obj)
|
|
95
92
|
|
|
96
|
-
_obj = cls.model_validate({
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"file": obj.get("file"),
|
|
95
|
+
"success": obj.get("success"),
|
|
96
|
+
"error": obj.get("error")
|
|
97
|
+
})
|
|
97
98
|
# store additional fields in additional_properties
|
|
98
99
|
for _key in obj.keys():
|
|
99
100
|
if _key not in cls.__properties:
|
|
100
101
|
_obj.additional_properties[_key] = obj.get(_key)
|
|
101
102
|
|
|
102
103
|
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -26,12 +26,10 @@ from daytona_api_client.models.sandbox_volume import SandboxVolume
|
|
|
26
26
|
from typing import Optional, Set
|
|
27
27
|
from typing_extensions import Self
|
|
28
28
|
|
|
29
|
-
|
|
30
29
|
class Sandbox(BaseModel):
|
|
31
30
|
"""
|
|
32
31
|
Sandbox
|
|
33
|
-
"""
|
|
34
|
-
|
|
32
|
+
""" # noqa: E501
|
|
35
33
|
id: StrictStr = Field(description="The ID of the sandbox")
|
|
36
34
|
organization_id: StrictStr = Field(description="The organization ID of the sandbox", alias="organizationId")
|
|
37
35
|
snapshot: Optional[StrictStr] = Field(default=None, description="The snapshot used for the sandbox")
|
|
@@ -45,78 +43,37 @@ class Sandbox(BaseModel):
|
|
|
45
43
|
memory: Union[StrictFloat, StrictInt] = Field(description="The memory quota for the sandbox")
|
|
46
44
|
disk: Union[StrictFloat, StrictInt] = Field(description="The disk quota for the sandbox")
|
|
47
45
|
state: Optional[SandboxState] = Field(default=None, description="The state of the sandbox")
|
|
48
|
-
error_reason: Optional[StrictStr] = Field(
|
|
49
|
-
default=None, description="The error reason of the sandbox", alias="errorReason"
|
|
50
|
-
)
|
|
46
|
+
error_reason: Optional[StrictStr] = Field(default=None, description="The error reason of the sandbox", alias="errorReason")
|
|
51
47
|
backup_state: Optional[StrictStr] = Field(default=None, description="The state of the backup", alias="backupState")
|
|
52
|
-
backup_created_at: Optional[StrictStr] = Field(
|
|
53
|
-
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval"
|
|
57
|
-
)
|
|
58
|
-
auto_archive_interval: Optional[Union[StrictFloat, StrictInt]] = Field(
|
|
59
|
-
default=None, description="Auto-archive interval in minutes", alias="autoArchiveInterval"
|
|
60
|
-
)
|
|
61
|
-
runner_domain: Optional[StrictStr] = Field(
|
|
62
|
-
default=None, description="The domain name of the runner", alias="runnerDomain"
|
|
63
|
-
)
|
|
48
|
+
backup_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last backup", alias="backupCreatedAt")
|
|
49
|
+
auto_stop_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-stop interval in minutes (0 means disabled)", alias="autoStopInterval")
|
|
50
|
+
auto_archive_interval: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Auto-archive interval in minutes", alias="autoArchiveInterval")
|
|
51
|
+
runner_domain: Optional[StrictStr] = Field(default=None, description="The domain name of the runner", alias="runnerDomain")
|
|
64
52
|
volumes: Optional[List[SandboxVolume]] = Field(default=None, description="Array of volumes attached to the sandbox")
|
|
65
|
-
build_info: Optional[BuildInfo] = Field(
|
|
66
|
-
|
|
67
|
-
)
|
|
68
|
-
created_at: Optional[StrictStr] = Field(
|
|
69
|
-
default=None, description="The creation timestamp of the sandbox", alias="createdAt"
|
|
70
|
-
)
|
|
71
|
-
updated_at: Optional[StrictStr] = Field(
|
|
72
|
-
default=None, description="The last update timestamp of the sandbox", alias="updatedAt"
|
|
73
|
-
)
|
|
53
|
+
build_info: Optional[BuildInfo] = Field(default=None, description="Build information for the sandbox", alias="buildInfo")
|
|
54
|
+
created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the sandbox", alias="createdAt")
|
|
55
|
+
updated_at: Optional[StrictStr] = Field(default=None, description="The last update timestamp of the sandbox", alias="updatedAt")
|
|
74
56
|
var_class: Optional[StrictStr] = Field(default=None, description="The class of the sandbox", alias="class")
|
|
75
57
|
additional_properties: Dict[str, Any] = {}
|
|
76
|
-
__properties: ClassVar[List[str]] = [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"snapshot",
|
|
80
|
-
"user",
|
|
81
|
-
"env",
|
|
82
|
-
"labels",
|
|
83
|
-
"public",
|
|
84
|
-
"target",
|
|
85
|
-
"cpu",
|
|
86
|
-
"gpu",
|
|
87
|
-
"memory",
|
|
88
|
-
"disk",
|
|
89
|
-
"state",
|
|
90
|
-
"errorReason",
|
|
91
|
-
"backupState",
|
|
92
|
-
"backupCreatedAt",
|
|
93
|
-
"autoStopInterval",
|
|
94
|
-
"autoArchiveInterval",
|
|
95
|
-
"runnerDomain",
|
|
96
|
-
"volumes",
|
|
97
|
-
"buildInfo",
|
|
98
|
-
"createdAt",
|
|
99
|
-
"updatedAt",
|
|
100
|
-
"class",
|
|
101
|
-
]
|
|
102
|
-
|
|
103
|
-
@field_validator("backup_state")
|
|
58
|
+
__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"]
|
|
59
|
+
|
|
60
|
+
@field_validator('backup_state')
|
|
104
61
|
def backup_state_validate_enum(cls, value):
|
|
105
62
|
"""Validates the enum"""
|
|
106
63
|
if value is None:
|
|
107
64
|
return value
|
|
108
65
|
|
|
109
|
-
if value not in set([
|
|
66
|
+
if value not in set(['None', 'Pending', 'InProgress', 'Completed', 'Error']):
|
|
110
67
|
raise ValueError("must be one of enum values ('None', 'Pending', 'InProgress', 'Completed', 'Error')")
|
|
111
68
|
return value
|
|
112
69
|
|
|
113
|
-
@field_validator(
|
|
70
|
+
@field_validator('var_class')
|
|
114
71
|
def var_class_validate_enum(cls, value):
|
|
115
72
|
"""Validates the enum"""
|
|
116
73
|
if value is None:
|
|
117
74
|
return value
|
|
118
75
|
|
|
119
|
-
if value not in set([
|
|
76
|
+
if value not in set(['small', 'medium', 'large']):
|
|
120
77
|
raise ValueError("must be one of enum values ('small', 'medium', 'large')")
|
|
121
78
|
return value
|
|
122
79
|
|
|
@@ -126,6 +83,7 @@ class Sandbox(BaseModel):
|
|
|
126
83
|
protected_namespaces=(),
|
|
127
84
|
)
|
|
128
85
|
|
|
86
|
+
|
|
129
87
|
def to_str(self) -> str:
|
|
130
88
|
"""Returns the string representation of the model using alias"""
|
|
131
89
|
return pprint.pformat(self.model_dump(by_alias=True))
|
|
@@ -151,11 +109,9 @@ class Sandbox(BaseModel):
|
|
|
151
109
|
are ignored.
|
|
152
110
|
* Fields in `self.additional_properties` are added to the output dict.
|
|
153
111
|
"""
|
|
154
|
-
excluded_fields: Set[str] = set(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
]
|
|
158
|
-
)
|
|
112
|
+
excluded_fields: Set[str] = set([
|
|
113
|
+
"additional_properties",
|
|
114
|
+
])
|
|
159
115
|
|
|
160
116
|
_dict = self.model_dump(
|
|
161
117
|
by_alias=True,
|
|
@@ -168,10 +124,10 @@ class Sandbox(BaseModel):
|
|
|
168
124
|
for _item_volumes in self.volumes:
|
|
169
125
|
if _item_volumes:
|
|
170
126
|
_items.append(_item_volumes.to_dict())
|
|
171
|
-
_dict[
|
|
127
|
+
_dict['volumes'] = _items
|
|
172
128
|
# override the default output from pydantic by calling `to_dict()` of build_info
|
|
173
129
|
if self.build_info:
|
|
174
|
-
_dict[
|
|
130
|
+
_dict['buildInfo'] = self.build_info.to_dict()
|
|
175
131
|
# puts key-value pairs in additional_properties in the top level
|
|
176
132
|
if self.additional_properties is not None:
|
|
177
133
|
for _key, _value in self.additional_properties.items():
|
|
@@ -188,39 +144,37 @@ class Sandbox(BaseModel):
|
|
|
188
144
|
if not isinstance(obj, dict):
|
|
189
145
|
return cls.model_validate(obj)
|
|
190
146
|
|
|
191
|
-
_obj = cls.model_validate(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
"updatedAt": obj.get("updatedAt"),
|
|
218
|
-
"class": obj.get("class"),
|
|
219
|
-
}
|
|
220
|
-
)
|
|
147
|
+
_obj = cls.model_validate({
|
|
148
|
+
"id": obj.get("id"),
|
|
149
|
+
"organizationId": obj.get("organizationId"),
|
|
150
|
+
"snapshot": obj.get("snapshot"),
|
|
151
|
+
"user": obj.get("user"),
|
|
152
|
+
"env": obj.get("env"),
|
|
153
|
+
"labels": obj.get("labels"),
|
|
154
|
+
"public": obj.get("public"),
|
|
155
|
+
"target": obj.get("target"),
|
|
156
|
+
"cpu": obj.get("cpu"),
|
|
157
|
+
"gpu": obj.get("gpu"),
|
|
158
|
+
"memory": obj.get("memory"),
|
|
159
|
+
"disk": obj.get("disk"),
|
|
160
|
+
"state": obj.get("state"),
|
|
161
|
+
"errorReason": obj.get("errorReason"),
|
|
162
|
+
"backupState": obj.get("backupState"),
|
|
163
|
+
"backupCreatedAt": obj.get("backupCreatedAt"),
|
|
164
|
+
"autoStopInterval": obj.get("autoStopInterval"),
|
|
165
|
+
"autoArchiveInterval": obj.get("autoArchiveInterval"),
|
|
166
|
+
"runnerDomain": obj.get("runnerDomain"),
|
|
167
|
+
"volumes": [SandboxVolume.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None,
|
|
168
|
+
"buildInfo": BuildInfo.from_dict(obj["buildInfo"]) if obj.get("buildInfo") is not None else None,
|
|
169
|
+
"createdAt": obj.get("createdAt"),
|
|
170
|
+
"updatedAt": obj.get("updatedAt"),
|
|
171
|
+
"class": obj.get("class")
|
|
172
|
+
})
|
|
221
173
|
# store additional fields in additional_properties
|
|
222
174
|
for _key in obj.keys():
|
|
223
175
|
if _key not in cls.__properties:
|
|
224
176
|
_obj.additional_properties[_key] = obj.get(_key)
|
|
225
177
|
|
|
226
178
|
return _obj
|
|
179
|
+
|
|
180
|
+
|
|
@@ -23,17 +23,13 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
class SandboxInfo(BaseModel):
|
|
28
27
|
"""
|
|
29
28
|
SandboxInfo
|
|
30
|
-
"""
|
|
31
|
-
|
|
29
|
+
""" # noqa: E501
|
|
32
30
|
created: StrictStr = Field(description="The creation timestamp of the project")
|
|
33
31
|
name: StrictStr = Field(description="Deprecated: The name of the sandbox")
|
|
34
|
-
provider_metadata: Optional[StrictStr] = Field(
|
|
35
|
-
default=None, description="Additional metadata provided by the provider", alias="providerMetadata"
|
|
36
|
-
)
|
|
32
|
+
provider_metadata: Optional[StrictStr] = Field(default=None, description="Additional metadata provided by the provider", alias="providerMetadata")
|
|
37
33
|
additional_properties: Dict[str, Any] = {}
|
|
38
34
|
__properties: ClassVar[List[str]] = ["created", "name", "providerMetadata"]
|
|
39
35
|
|
|
@@ -43,6 +39,7 @@ class SandboxInfo(BaseModel):
|
|
|
43
39
|
protected_namespaces=(),
|
|
44
40
|
)
|
|
45
41
|
|
|
42
|
+
|
|
46
43
|
def to_str(self) -> str:
|
|
47
44
|
"""Returns the string representation of the model using alias"""
|
|
48
45
|
return pprint.pformat(self.model_dump(by_alias=True))
|
|
@@ -68,11 +65,9 @@ class SandboxInfo(BaseModel):
|
|
|
68
65
|
are ignored.
|
|
69
66
|
* Fields in `self.additional_properties` are added to the output dict.
|
|
70
67
|
"""
|
|
71
|
-
excluded_fields: Set[str] = set(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
]
|
|
75
|
-
)
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
"additional_properties",
|
|
70
|
+
])
|
|
76
71
|
|
|
77
72
|
_dict = self.model_dump(
|
|
78
73
|
by_alias=True,
|
|
@@ -95,16 +90,16 @@ class SandboxInfo(BaseModel):
|
|
|
95
90
|
if not isinstance(obj, dict):
|
|
96
91
|
return cls.model_validate(obj)
|
|
97
92
|
|
|
98
|
-
_obj = cls.model_validate(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
)
|
|
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
|
+
})
|
|
105
98
|
# store additional fields in additional_properties
|
|
106
99
|
for _key in obj.keys():
|
|
107
100
|
if _key not in cls.__properties:
|
|
108
101
|
_obj.additional_properties[_key] = obj.get(_key)
|
|
109
102
|
|
|
110
103
|
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -23,12 +23,10 @@ from typing import Any, ClassVar, Dict, List
|
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
class SandboxLabels(BaseModel):
|
|
28
27
|
"""
|
|
29
28
|
SandboxLabels
|
|
30
|
-
"""
|
|
31
|
-
|
|
29
|
+
""" # noqa: E501
|
|
32
30
|
labels: Dict[str, StrictStr] = Field(description="Key-value pairs of labels")
|
|
33
31
|
additional_properties: Dict[str, Any] = {}
|
|
34
32
|
__properties: ClassVar[List[str]] = ["labels"]
|
|
@@ -39,6 +37,7 @@ class SandboxLabels(BaseModel):
|
|
|
39
37
|
protected_namespaces=(),
|
|
40
38
|
)
|
|
41
39
|
|
|
40
|
+
|
|
42
41
|
def to_str(self) -> str:
|
|
43
42
|
"""Returns the string representation of the model using alias"""
|
|
44
43
|
return pprint.pformat(self.model_dump(by_alias=True))
|
|
@@ -64,11 +63,9 @@ class SandboxLabels(BaseModel):
|
|
|
64
63
|
are ignored.
|
|
65
64
|
* Fields in `self.additional_properties` are added to the output dict.
|
|
66
65
|
"""
|
|
67
|
-
excluded_fields: Set[str] = set(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
]
|
|
71
|
-
)
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
"additional_properties",
|
|
68
|
+
])
|
|
72
69
|
|
|
73
70
|
_dict = self.model_dump(
|
|
74
71
|
by_alias=True,
|
|
@@ -91,10 +88,14 @@ class SandboxLabels(BaseModel):
|
|
|
91
88
|
if not isinstance(obj, dict):
|
|
92
89
|
return cls.model_validate(obj)
|
|
93
90
|
|
|
94
|
-
_obj = cls.model_validate({
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"labels": obj.get("labels")
|
|
93
|
+
})
|
|
95
94
|
# store additional fields in additional_properties
|
|
96
95
|
for _key in obj.keys():
|
|
97
96
|
if _key not in cls.__properties:
|
|
98
97
|
_obj.additional_properties[_key] = obj.get(_key)
|
|
99
98
|
|
|
100
99
|
return _obj
|
|
100
|
+
|
|
101
|
+
|
|
@@ -27,24 +27,26 @@ class SandboxState(str, Enum):
|
|
|
27
27
|
"""
|
|
28
28
|
allowed enum values
|
|
29
29
|
"""
|
|
30
|
-
CREATING =
|
|
31
|
-
RESTORING =
|
|
32
|
-
DESTROYED =
|
|
33
|
-
DESTROYING =
|
|
34
|
-
STARTED =
|
|
35
|
-
STOPPED =
|
|
36
|
-
STARTING =
|
|
37
|
-
STOPPING =
|
|
38
|
-
ERROR =
|
|
39
|
-
BUILD_FAILED =
|
|
40
|
-
PENDING_BUILD =
|
|
41
|
-
BUILDING_SNAPSHOT =
|
|
42
|
-
UNKNOWN =
|
|
43
|
-
PULLING_SNAPSHOT =
|
|
44
|
-
ARCHIVING =
|
|
45
|
-
ARCHIVED =
|
|
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
|
+
BUILD_FAILED = 'build_failed'
|
|
40
|
+
PENDING_BUILD = 'pending_build'
|
|
41
|
+
BUILDING_SNAPSHOT = 'building_snapshot'
|
|
42
|
+
UNKNOWN = 'unknown'
|
|
43
|
+
PULLING_SNAPSHOT = 'pulling_snapshot'
|
|
44
|
+
ARCHIVING = 'archiving'
|
|
45
|
+
ARCHIVED = 'archived'
|
|
46
46
|
|
|
47
47
|
@classmethod
|
|
48
48
|
def from_json(cls, json_str: str) -> Self:
|
|
49
49
|
"""Create an instance of SandboxState from a JSON string"""
|
|
50
50
|
return cls(json.loads(json_str))
|
|
51
|
+
|
|
52
|
+
|