daytona_api_client 0.26.0a11__py3-none-any.whl → 0.26.0rc1__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 +0 -1
- daytona_api_client/api/toolbox_api.py +12 -13
- daytona_api_client/models/__init__.py +0 -1
- daytona_api_client/models/create_audit_log.py +2 -2
- daytona_api_client/models/create_sandbox.py +5 -1
- daytona_api_client/models/sandbox.py +5 -1
- daytona_api_client/models/sandbox_state.py +1 -1
- daytona_api_client/models/session_execute_response.py +3 -5
- daytona_api_client/models/workspace.py +5 -1
- {daytona_api_client-0.26.0a11.dist-info → daytona_api_client-0.26.0rc1.dist-info}/METADATA +1 -1
- {daytona_api_client-0.26.0a11.dist-info → daytona_api_client-0.26.0rc1.dist-info}/RECORD +14 -24
- daytona_api_client/models/account_provider_dto.py +0 -101
- daytona_api_client/models/build_snapshot.py +0 -118
- daytona_api_client/models/download_files.py +0 -101
- daytona_api_client/models/get_build_logs400_response.py +0 -101
- daytona_api_client/models/session_command_logs_response.py +0 -103
- daytona_api_client/models/upload_file.py +0 -101
- daytona_api_client/models/upload_file_dto.py +0 -101
- daytona_api_client/models/upload_file_request_file.py +0 -159
- daytona_api_client/models/upload_files_multi_request_files_inner.py +0 -101
- daytona_api_client/models/volume.py +0 -133
- {daytona_api_client-0.26.0a11.dist-info → daytona_api_client-0.26.0rc1.dist-info}/WHEEL +0 -0
- {daytona_api_client-0.26.0a11.dist-info → daytona_api_client-0.26.0rc1.dist-info}/licenses/LICENSE +0 -0
- {daytona_api_client-0.26.0a11.dist-info → daytona_api_client-0.26.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Daytona
|
|
5
|
-
|
|
6
|
-
Daytona AI platform API Docs
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0
|
|
9
|
-
Contact: support@daytona.com
|
|
10
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
-
|
|
12
|
-
Do not edit the class manually.
|
|
13
|
-
""" # noqa: E501
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
from __future__ import annotations
|
|
17
|
-
import pprint
|
|
18
|
-
import re # noqa: F401
|
|
19
|
-
import json
|
|
20
|
-
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
23
|
-
from typing import Optional, Set
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
class DownloadFiles(BaseModel):
|
|
27
|
-
"""
|
|
28
|
-
DownloadFiles
|
|
29
|
-
""" # noqa: E501
|
|
30
|
-
paths: List[StrictStr] = Field(description="List of remote file paths to download")
|
|
31
|
-
additional_properties: Dict[str, Any] = {}
|
|
32
|
-
__properties: ClassVar[List[str]] = ["paths"]
|
|
33
|
-
|
|
34
|
-
model_config = ConfigDict(
|
|
35
|
-
populate_by_name=True,
|
|
36
|
-
validate_assignment=True,
|
|
37
|
-
protected_namespaces=(),
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def to_str(self) -> str:
|
|
42
|
-
"""Returns the string representation of the model using alias"""
|
|
43
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
-
|
|
45
|
-
def to_json(self) -> str:
|
|
46
|
-
"""Returns the JSON representation of the model using alias"""
|
|
47
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
-
return json.dumps(self.to_dict())
|
|
49
|
-
|
|
50
|
-
@classmethod
|
|
51
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
-
"""Create an instance of DownloadFiles from a JSON string"""
|
|
53
|
-
return cls.from_dict(json.loads(json_str))
|
|
54
|
-
|
|
55
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
-
"""Return the dictionary representation of the model using alias.
|
|
57
|
-
|
|
58
|
-
This has the following differences from calling pydantic's
|
|
59
|
-
`self.model_dump(by_alias=True)`:
|
|
60
|
-
|
|
61
|
-
* `None` is only added to the output dict for nullable fields that
|
|
62
|
-
were set at model initialization. Other fields with value `None`
|
|
63
|
-
are ignored.
|
|
64
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
|
-
"""
|
|
66
|
-
excluded_fields: Set[str] = set([
|
|
67
|
-
"additional_properties",
|
|
68
|
-
])
|
|
69
|
-
|
|
70
|
-
_dict = self.model_dump(
|
|
71
|
-
by_alias=True,
|
|
72
|
-
exclude=excluded_fields,
|
|
73
|
-
exclude_none=True,
|
|
74
|
-
)
|
|
75
|
-
# puts key-value pairs in additional_properties in the top level
|
|
76
|
-
if self.additional_properties is not None:
|
|
77
|
-
for _key, _value in self.additional_properties.items():
|
|
78
|
-
_dict[_key] = _value
|
|
79
|
-
|
|
80
|
-
return _dict
|
|
81
|
-
|
|
82
|
-
@classmethod
|
|
83
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
-
"""Create an instance of DownloadFiles from a dict"""
|
|
85
|
-
if obj is None:
|
|
86
|
-
return None
|
|
87
|
-
|
|
88
|
-
if not isinstance(obj, dict):
|
|
89
|
-
return cls.model_validate(obj)
|
|
90
|
-
|
|
91
|
-
_obj = cls.model_validate({
|
|
92
|
-
"paths": obj.get("paths")
|
|
93
|
-
})
|
|
94
|
-
# store additional fields in additional_properties
|
|
95
|
-
for _key in obj.keys():
|
|
96
|
-
if _key not in cls.__properties:
|
|
97
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
98
|
-
|
|
99
|
-
return _obj
|
|
100
|
-
|
|
101
|
-
|
|
@@ -1,101 +0,0 @@
|
|
|
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
|
-
|
|
18
|
-
import json
|
|
19
|
-
import pprint
|
|
20
|
-
import re # noqa: F401
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional, Set, Union
|
|
22
|
-
|
|
23
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class GetBuildLogs400Response(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
GetBuildLogs400Response
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
|
|
32
|
-
message: Optional[StrictStr] = None
|
|
33
|
-
status_code: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="statusCode")
|
|
34
|
-
additional_properties: Dict[str, Any] = {}
|
|
35
|
-
__properties: ClassVar[List[str]] = ["message", "statusCode"]
|
|
36
|
-
|
|
37
|
-
model_config = ConfigDict(
|
|
38
|
-
populate_by_name=True,
|
|
39
|
-
validate_assignment=True,
|
|
40
|
-
protected_namespaces=(),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
def to_str(self) -> str:
|
|
44
|
-
"""Returns the string representation of the model using alias"""
|
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
-
|
|
47
|
-
def to_json(self) -> str:
|
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
-
return json.dumps(self.to_dict())
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of GetBuildLogs400Response from a JSON string"""
|
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
|
56
|
-
|
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
|
59
|
-
|
|
60
|
-
This has the following differences from calling pydantic's
|
|
61
|
-
`self.model_dump(by_alias=True)`:
|
|
62
|
-
|
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
|
64
|
-
were set at model initialization. Other fields with value `None`
|
|
65
|
-
are ignored.
|
|
66
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
67
|
-
"""
|
|
68
|
-
excluded_fields: Set[str] = set(
|
|
69
|
-
[
|
|
70
|
-
"additional_properties",
|
|
71
|
-
]
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
_dict = self.model_dump(
|
|
75
|
-
by_alias=True,
|
|
76
|
-
exclude=excluded_fields,
|
|
77
|
-
exclude_none=True,
|
|
78
|
-
)
|
|
79
|
-
# puts key-value pairs in additional_properties in the top level
|
|
80
|
-
if self.additional_properties is not None:
|
|
81
|
-
for _key, _value in self.additional_properties.items():
|
|
82
|
-
_dict[_key] = _value
|
|
83
|
-
|
|
84
|
-
return _dict
|
|
85
|
-
|
|
86
|
-
@classmethod
|
|
87
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
-
"""Create an instance of GetBuildLogs400Response from a dict"""
|
|
89
|
-
if obj is None:
|
|
90
|
-
return None
|
|
91
|
-
|
|
92
|
-
if not isinstance(obj, dict):
|
|
93
|
-
return cls.model_validate(obj)
|
|
94
|
-
|
|
95
|
-
_obj = cls.model_validate({"message": obj.get("message"), "statusCode": obj.get("statusCode")})
|
|
96
|
-
# store additional fields in additional_properties
|
|
97
|
-
for _key in obj.keys():
|
|
98
|
-
if _key not in cls.__properties:
|
|
99
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
100
|
-
|
|
101
|
-
return _obj
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Daytona
|
|
5
|
-
|
|
6
|
-
Daytona AI platform API Docs
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0
|
|
9
|
-
Contact: support@daytona.com
|
|
10
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
-
|
|
12
|
-
Do not edit the class manually.
|
|
13
|
-
""" # noqa: E501
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
from __future__ import annotations
|
|
17
|
-
import pprint
|
|
18
|
-
import re # noqa: F401
|
|
19
|
-
import json
|
|
20
|
-
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
23
|
-
from typing import Optional, Set
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
class SessionCommandLogsResponse(BaseModel):
|
|
27
|
-
"""
|
|
28
|
-
SessionCommandLogsResponse
|
|
29
|
-
""" # noqa: E501
|
|
30
|
-
stdout: StrictStr = Field(description="The stdout of the command")
|
|
31
|
-
stderr: StrictStr = Field(description="The stderr of the command")
|
|
32
|
-
additional_properties: Dict[str, Any] = {}
|
|
33
|
-
__properties: ClassVar[List[str]] = ["stdout", "stderr"]
|
|
34
|
-
|
|
35
|
-
model_config = ConfigDict(
|
|
36
|
-
populate_by_name=True,
|
|
37
|
-
validate_assignment=True,
|
|
38
|
-
protected_namespaces=(),
|
|
39
|
-
)
|
|
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 SessionCommandLogsResponse 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
|
-
"additional_properties",
|
|
69
|
-
])
|
|
70
|
-
|
|
71
|
-
_dict = self.model_dump(
|
|
72
|
-
by_alias=True,
|
|
73
|
-
exclude=excluded_fields,
|
|
74
|
-
exclude_none=True,
|
|
75
|
-
)
|
|
76
|
-
# puts key-value pairs in additional_properties in the top level
|
|
77
|
-
if self.additional_properties is not None:
|
|
78
|
-
for _key, _value in self.additional_properties.items():
|
|
79
|
-
_dict[_key] = _value
|
|
80
|
-
|
|
81
|
-
return _dict
|
|
82
|
-
|
|
83
|
-
@classmethod
|
|
84
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
-
"""Create an instance of SessionCommandLogsResponse from a dict"""
|
|
86
|
-
if obj is None:
|
|
87
|
-
return None
|
|
88
|
-
|
|
89
|
-
if not isinstance(obj, dict):
|
|
90
|
-
return cls.model_validate(obj)
|
|
91
|
-
|
|
92
|
-
_obj = cls.model_validate({
|
|
93
|
-
"stdout": obj.get("stdout"),
|
|
94
|
-
"stderr": obj.get("stderr")
|
|
95
|
-
})
|
|
96
|
-
# store additional fields in additional_properties
|
|
97
|
-
for _key in obj.keys():
|
|
98
|
-
if _key not in cls.__properties:
|
|
99
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
100
|
-
|
|
101
|
-
return _obj
|
|
102
|
-
|
|
103
|
-
|
|
@@ -1,101 +0,0 @@
|
|
|
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
|
-
|
|
18
|
-
import json
|
|
19
|
-
import pprint
|
|
20
|
-
import re # noqa: F401
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional, Set, Tuple, Union
|
|
22
|
-
|
|
23
|
-
from pydantic import BaseModel, ConfigDict, StrictBytes, StrictStr
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class UploadFile(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
UploadFile
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
|
|
32
|
-
file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]
|
|
33
|
-
path: StrictStr
|
|
34
|
-
additional_properties: Dict[str, Any] = {}
|
|
35
|
-
__properties: ClassVar[List[str]] = ["file", "path"]
|
|
36
|
-
|
|
37
|
-
model_config = ConfigDict(
|
|
38
|
-
populate_by_name=True,
|
|
39
|
-
validate_assignment=True,
|
|
40
|
-
protected_namespaces=(),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
def to_str(self) -> str:
|
|
44
|
-
"""Returns the string representation of the model using alias"""
|
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
-
|
|
47
|
-
def to_json(self) -> str:
|
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
-
return json.dumps(self.to_dict())
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of UploadFile from a JSON string"""
|
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
|
56
|
-
|
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
|
59
|
-
|
|
60
|
-
This has the following differences from calling pydantic's
|
|
61
|
-
`self.model_dump(by_alias=True)`:
|
|
62
|
-
|
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
|
64
|
-
were set at model initialization. Other fields with value `None`
|
|
65
|
-
are ignored.
|
|
66
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
67
|
-
"""
|
|
68
|
-
excluded_fields: Set[str] = set(
|
|
69
|
-
[
|
|
70
|
-
"additional_properties",
|
|
71
|
-
]
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
_dict = self.model_dump(
|
|
75
|
-
by_alias=True,
|
|
76
|
-
exclude=excluded_fields,
|
|
77
|
-
exclude_none=True,
|
|
78
|
-
)
|
|
79
|
-
# puts key-value pairs in additional_properties in the top level
|
|
80
|
-
if self.additional_properties is not None:
|
|
81
|
-
for _key, _value in self.additional_properties.items():
|
|
82
|
-
_dict[_key] = _value
|
|
83
|
-
|
|
84
|
-
return _dict
|
|
85
|
-
|
|
86
|
-
@classmethod
|
|
87
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
-
"""Create an instance of UploadFile from a dict"""
|
|
89
|
-
if obj is None:
|
|
90
|
-
return None
|
|
91
|
-
|
|
92
|
-
if not isinstance(obj, dict):
|
|
93
|
-
return cls.model_validate(obj)
|
|
94
|
-
|
|
95
|
-
_obj = cls.model_validate({"file": obj.get("file"), "path": obj.get("path")})
|
|
96
|
-
# store additional fields in additional_properties
|
|
97
|
-
for _key in obj.keys():
|
|
98
|
-
if _key not in cls.__properties:
|
|
99
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
100
|
-
|
|
101
|
-
return _obj
|
|
@@ -1,101 +0,0 @@
|
|
|
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
|
-
|
|
18
|
-
import json
|
|
19
|
-
import pprint
|
|
20
|
-
import re # noqa: F401
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional, Set, Tuple, Union
|
|
22
|
-
|
|
23
|
-
from pydantic import BaseModel, ConfigDict, StrictBytes, StrictStr
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class UploadFileDto(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
UploadFileDto
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
|
|
32
|
-
file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]
|
|
33
|
-
path: StrictStr
|
|
34
|
-
additional_properties: Dict[str, Any] = {}
|
|
35
|
-
__properties: ClassVar[List[str]] = ["file", "path"]
|
|
36
|
-
|
|
37
|
-
model_config = ConfigDict(
|
|
38
|
-
populate_by_name=True,
|
|
39
|
-
validate_assignment=True,
|
|
40
|
-
protected_namespaces=(),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
def to_str(self) -> str:
|
|
44
|
-
"""Returns the string representation of the model using alias"""
|
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
-
|
|
47
|
-
def to_json(self) -> str:
|
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
-
return json.dumps(self.to_dict())
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of UploadFileDto from a JSON string"""
|
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
|
56
|
-
|
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
|
59
|
-
|
|
60
|
-
This has the following differences from calling pydantic's
|
|
61
|
-
`self.model_dump(by_alias=True)`:
|
|
62
|
-
|
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
|
64
|
-
were set at model initialization. Other fields with value `None`
|
|
65
|
-
are ignored.
|
|
66
|
-
* Fields in `self.additional_properties` are added to the output dict.
|
|
67
|
-
"""
|
|
68
|
-
excluded_fields: Set[str] = set(
|
|
69
|
-
[
|
|
70
|
-
"additional_properties",
|
|
71
|
-
]
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
_dict = self.model_dump(
|
|
75
|
-
by_alias=True,
|
|
76
|
-
exclude=excluded_fields,
|
|
77
|
-
exclude_none=True,
|
|
78
|
-
)
|
|
79
|
-
# puts key-value pairs in additional_properties in the top level
|
|
80
|
-
if self.additional_properties is not None:
|
|
81
|
-
for _key, _value in self.additional_properties.items():
|
|
82
|
-
_dict[_key] = _value
|
|
83
|
-
|
|
84
|
-
return _dict
|
|
85
|
-
|
|
86
|
-
@classmethod
|
|
87
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
-
"""Create an instance of UploadFileDto from a dict"""
|
|
89
|
-
if obj is None:
|
|
90
|
-
return None
|
|
91
|
-
|
|
92
|
-
if not isinstance(obj, dict):
|
|
93
|
-
return cls.model_validate(obj)
|
|
94
|
-
|
|
95
|
-
_obj = cls.model_validate({"file": obj.get("file"), "path": obj.get("path")})
|
|
96
|
-
# store additional fields in additional_properties
|
|
97
|
-
for _key in obj.keys():
|
|
98
|
-
if _key not in cls.__properties:
|
|
99
|
-
_obj.additional_properties[_key] = obj.get(_key)
|
|
100
|
-
|
|
101
|
-
return _obj
|
|
@@ -1,159 +0,0 @@
|
|
|
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
|
-
|
|
18
|
-
import json
|
|
19
|
-
import pprint
|
|
20
|
-
from typing import Any, Dict, List, Optional, Set, Tuple, Union
|
|
21
|
-
|
|
22
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr, ValidationError, field_validator
|
|
23
|
-
from typing_extensions import Literal, Self
|
|
24
|
-
|
|
25
|
-
UPLOADFILEREQUESTFILE_ONE_OF_SCHEMAS = ["Dict[str, object]", "bytearray"]
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class UploadFileRequestFile(BaseModel):
|
|
29
|
-
"""
|
|
30
|
-
File to upload. Supports file streaming and various file object types.
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
# data type: bytearray
|
|
34
|
-
oneof_schema_1_validator: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(
|
|
35
|
-
default=None, description="Binary file content"
|
|
36
|
-
)
|
|
37
|
-
# data type: Dict[str, object]
|
|
38
|
-
oneof_schema_2_validator: Optional[Dict[str, Any]] = Field(
|
|
39
|
-
default=None, description="File object that supports read operations"
|
|
40
|
-
)
|
|
41
|
-
actual_instance: Optional[Union[Dict[str, object], bytearray]] = None
|
|
42
|
-
one_of_schemas: Set[str] = {"Dict[str, object]", "bytearray"}
|
|
43
|
-
|
|
44
|
-
model_config = ConfigDict(
|
|
45
|
-
validate_assignment=True,
|
|
46
|
-
protected_namespaces=(),
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
50
|
-
if args:
|
|
51
|
-
if len(args) > 1:
|
|
52
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
53
|
-
if kwargs:
|
|
54
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
55
|
-
super().__init__(actual_instance=args[0])
|
|
56
|
-
else:
|
|
57
|
-
super().__init__(**kwargs)
|
|
58
|
-
|
|
59
|
-
@field_validator("actual_instance")
|
|
60
|
-
def actual_instance_must_validate_oneof(cls, v):
|
|
61
|
-
instance = UploadFileRequestFile.model_construct()
|
|
62
|
-
error_messages = []
|
|
63
|
-
match = 0
|
|
64
|
-
# validate data type: bytearray
|
|
65
|
-
try:
|
|
66
|
-
instance.oneof_schema_1_validator = v
|
|
67
|
-
match += 1
|
|
68
|
-
except (ValidationError, ValueError) as e:
|
|
69
|
-
error_messages.append(str(e))
|
|
70
|
-
# validate data type: Dict[str, object]
|
|
71
|
-
try:
|
|
72
|
-
instance.oneof_schema_2_validator = v
|
|
73
|
-
match += 1
|
|
74
|
-
except (ValidationError, ValueError) as e:
|
|
75
|
-
error_messages.append(str(e))
|
|
76
|
-
if match > 1:
|
|
77
|
-
# more than 1 match
|
|
78
|
-
raise ValueError(
|
|
79
|
-
"Multiple matches found when setting `actual_instance` in UploadFileRequestFile with oneOf schemas: Dict[str, object], bytearray. Details: "
|
|
80
|
-
+ ", ".join(error_messages)
|
|
81
|
-
)
|
|
82
|
-
elif match == 0:
|
|
83
|
-
# no match
|
|
84
|
-
raise ValueError(
|
|
85
|
-
"No match found when setting `actual_instance` in UploadFileRequestFile with oneOf schemas: Dict[str, object], bytearray. Details: "
|
|
86
|
-
+ ", ".join(error_messages)
|
|
87
|
-
)
|
|
88
|
-
else:
|
|
89
|
-
return v
|
|
90
|
-
|
|
91
|
-
@classmethod
|
|
92
|
-
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
93
|
-
return cls.from_json(json.dumps(obj))
|
|
94
|
-
|
|
95
|
-
@classmethod
|
|
96
|
-
def from_json(cls, json_str: str) -> Self:
|
|
97
|
-
"""Returns the object represented by the json string"""
|
|
98
|
-
instance = cls.model_construct()
|
|
99
|
-
error_messages = []
|
|
100
|
-
match = 0
|
|
101
|
-
|
|
102
|
-
# deserialize data into bytearray
|
|
103
|
-
try:
|
|
104
|
-
# validation
|
|
105
|
-
instance.oneof_schema_1_validator = json.loads(json_str)
|
|
106
|
-
# assign value to actual_instance
|
|
107
|
-
instance.actual_instance = instance.oneof_schema_1_validator
|
|
108
|
-
match += 1
|
|
109
|
-
except (ValidationError, ValueError) as e:
|
|
110
|
-
error_messages.append(str(e))
|
|
111
|
-
# deserialize data into Dict[str, object]
|
|
112
|
-
try:
|
|
113
|
-
# validation
|
|
114
|
-
instance.oneof_schema_2_validator = json.loads(json_str)
|
|
115
|
-
# assign value to actual_instance
|
|
116
|
-
instance.actual_instance = instance.oneof_schema_2_validator
|
|
117
|
-
match += 1
|
|
118
|
-
except (ValidationError, ValueError) as e:
|
|
119
|
-
error_messages.append(str(e))
|
|
120
|
-
|
|
121
|
-
if match > 1:
|
|
122
|
-
# more than 1 match
|
|
123
|
-
raise ValueError(
|
|
124
|
-
"Multiple matches found when deserializing the JSON string into UploadFileRequestFile with oneOf schemas: Dict[str, object], bytearray. Details: "
|
|
125
|
-
+ ", ".join(error_messages)
|
|
126
|
-
)
|
|
127
|
-
elif match == 0:
|
|
128
|
-
# no match
|
|
129
|
-
raise ValueError(
|
|
130
|
-
"No match found when deserializing the JSON string into UploadFileRequestFile with oneOf schemas: Dict[str, object], bytearray. Details: "
|
|
131
|
-
+ ", ".join(error_messages)
|
|
132
|
-
)
|
|
133
|
-
else:
|
|
134
|
-
return instance
|
|
135
|
-
|
|
136
|
-
def to_json(self) -> str:
|
|
137
|
-
"""Returns the JSON representation of the actual instance"""
|
|
138
|
-
if self.actual_instance is None:
|
|
139
|
-
return "null"
|
|
140
|
-
|
|
141
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
142
|
-
return self.actual_instance.to_json()
|
|
143
|
-
else:
|
|
144
|
-
return json.dumps(self.actual_instance)
|
|
145
|
-
|
|
146
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], Dict[str, object], bytearray]]:
|
|
147
|
-
"""Returns the dict representation of the actual instance"""
|
|
148
|
-
if self.actual_instance is None:
|
|
149
|
-
return None
|
|
150
|
-
|
|
151
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
152
|
-
return self.actual_instance.to_dict()
|
|
153
|
-
else:
|
|
154
|
-
# primitive type
|
|
155
|
-
return self.actual_instance
|
|
156
|
-
|
|
157
|
-
def to_str(self) -> str:
|
|
158
|
-
"""Returns the string representation of the actual instance"""
|
|
159
|
-
return pprint.pformat(self.model_dump())
|