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.

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