daytona_api_client_async 0.25.5__py3-none-any.whl → 0.26.0__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_async might be problematic. Click here for more details.

Files changed (49) hide show
  1. daytona_api_client_async/__init__.py +12 -1
  2. daytona_api_client_async/api/__init__.py +2 -0
  3. daytona_api_client_async/api/{images_api.py → default_api.py} +258 -724
  4. daytona_api_client_async/api/health_api.py +282 -0
  5. daytona_api_client_async/api/organizations_api.py +6 -6
  6. daytona_api_client_async/api/sandbox_api.py +855 -2
  7. daytona_api_client_async/api/webhooks_api.py +1704 -0
  8. daytona_api_client_async/models/__init__.py +10 -1
  9. daytona_api_client_async/models/create_audit_log.py +2 -2
  10. daytona_api_client_async/models/create_sandbox.py +5 -1
  11. daytona_api_client_async/models/health_controller_check200_response.py +154 -0
  12. daytona_api_client_async/models/{set_image_general_status.py → health_controller_check200_response_info_value.py} +8 -8
  13. daytona_api_client_async/models/health_controller_check503_response.py +154 -0
  14. daytona_api_client_async/models/{usage_overview.py → organization_usage_overview.py} +14 -8
  15. daytona_api_client_async/models/sandbox.py +5 -1
  16. daytona_api_client_async/models/{build_image.py → sandbox_created_post_request.py} +18 -15
  17. daytona_api_client_async/models/sandbox_created_post_request_data.py +152 -0
  18. daytona_api_client_async/models/sandbox_state.py +1 -1
  19. daytona_api_client_async/models/sandbox_state_updated_post_request.py +110 -0
  20. daytona_api_client_async/models/sandbox_state_updated_post_request_data.py +129 -0
  21. daytona_api_client_async/models/sandbox_state_updated_post_request_data_sandbox.py +115 -0
  22. daytona_api_client_async/models/{workspace_info.py → send_webhook_dto.py} +11 -11
  23. daytona_api_client_async/models/snapshot_created_post_request.py +110 -0
  24. daytona_api_client_async/models/{image_dto.py → snapshot_created_post_request_data.py} +34 -43
  25. daytona_api_client_async/models/{workspace_volume.py → snapshot_removed_post_request.py} +13 -10
  26. daytona_api_client_async/models/snapshot_state_updated_post_request.py +110 -0
  27. daytona_api_client_async/models/snapshot_state_updated_post_request_data.py +129 -0
  28. daytona_api_client_async/models/snapshot_state_updated_post_request_data_snapshot.py +115 -0
  29. daytona_api_client_async/models/ssh_access_dto.py +112 -0
  30. daytona_api_client_async/models/ssh_access_validation_dto.py +107 -0
  31. daytona_api_client_async/models/{create_image.py → volume_created_post_request.py} +17 -12
  32. daytona_api_client_async/models/{build_snapshot.py → volume_created_post_request_data.py} +32 -21
  33. daytona_api_client_async/models/volume_state_updated_post_request.py +110 -0
  34. daytona_api_client_async/models/{create_node.py → volume_state_updated_post_request_data.py} +31 -37
  35. daytona_api_client_async/models/{paginated_images_dto.py → volume_state_updated_post_request_data_volume.py} +23 -23
  36. daytona_api_client_async/models/{workspace_labels.py → webhook_app_portal_access.py} +7 -7
  37. daytona_api_client_async/models/{download_files.py → webhook_controller_get_app_portal_access200_response.py} +8 -8
  38. daytona_api_client_async/models/webhook_controller_get_initialization_status200_response.py +118 -0
  39. daytona_api_client_async/models/{toggle_state.py → webhook_controller_get_status200_response.py} +7 -7
  40. daytona_api_client_async/models/webhook_initialization_status.py +121 -0
  41. daytona_api_client_async/models/workspace.py +5 -1
  42. {daytona_api_client_async-0.25.5.dist-info → daytona_api_client_async-0.26.0.dist-info}/METADATA +1 -1
  43. {daytona_api_client_async-0.25.5.dist-info → daytona_api_client_async-0.26.0.dist-info}/RECORD +46 -32
  44. daytona_api_client_async/api/nodes_api.py +0 -792
  45. daytona_api_client_async/models/image_state.py +0 -45
  46. daytona_api_client_async/models/workspace_state.py +0 -51
  47. {daytona_api_client_async-0.25.5.dist-info → daytona_api_client_async-0.26.0.dist-info}/WHEEL +0 -0
  48. {daytona_api_client_async-0.25.5.dist-info → daytona_api_client_async-0.26.0.dist-info}/licenses/LICENSE +0 -0
  49. {daytona_api_client_async-0.25.5.dist-info → daytona_api_client_async-0.26.0.dist-info}/top_level.txt +0 -0
@@ -19,30 +19,40 @@ import re # noqa: F401
19
19
  import json
20
20
 
21
21
  from datetime import datetime
22
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
23
23
  from typing import Any, ClassVar, Dict, List, Optional, Union
24
- from daytona_api_client_async.models.image_state import ImageState
25
24
  from typing import Optional, Set
26
25
  from typing_extensions import Self
27
26
 
28
- class ImageDto(BaseModel):
27
+ class SnapshotCreatedPostRequestData(BaseModel):
29
28
  """
30
- ImageDto
29
+ SnapshotCreatedPostRequestData
31
30
  """ # noqa: E501
32
- id: StrictStr
31
+ id: Optional[StrictStr] = None
33
32
  organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId")
34
- general: StrictBool
35
- name: StrictStr
36
- enabled: StrictBool
37
- state: ImageState
38
- size: Optional[Union[StrictFloat, StrictInt]]
39
- entrypoint: Optional[List[StrictStr]]
40
- error_reason: Optional[StrictStr] = Field(alias="errorReason")
41
- created_at: datetime = Field(alias="createdAt")
42
- updated_at: datetime = Field(alias="updatedAt")
43
- last_used_at: Optional[datetime] = Field(alias="lastUsedAt")
33
+ general: Optional[StrictBool] = None
34
+ name: Optional[StrictStr] = None
35
+ image_name: Optional[StrictStr] = Field(default=None, alias="imageName")
36
+ state: Optional[StrictStr] = None
37
+ size: Optional[Union[StrictFloat, StrictInt]] = None
38
+ cpu: Optional[Union[StrictFloat, StrictInt]] = None
39
+ gpu: Optional[Union[StrictFloat, StrictInt]] = None
40
+ mem: Optional[Union[StrictFloat, StrictInt]] = None
41
+ disk: Optional[Union[StrictFloat, StrictInt]] = None
42
+ created_at: Optional[datetime] = Field(default=None, alias="createdAt")
43
+ updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
44
44
  additional_properties: Dict[str, Any] = {}
45
- __properties: ClassVar[List[str]] = ["id", "organizationId", "general", "name", "enabled", "state", "size", "entrypoint", "errorReason", "createdAt", "updatedAt", "lastUsedAt"]
45
+ __properties: ClassVar[List[str]] = ["id", "organizationId", "general", "name", "imageName", "state", "size", "cpu", "gpu", "mem", "disk", "createdAt", "updatedAt"]
46
+
47
+ @field_validator('state')
48
+ def state_validate_enum(cls, value):
49
+ """Validates the enum"""
50
+ if value is None:
51
+ return value
52
+
53
+ if value not in set(['build_pending', 'building', 'pending', 'pulling', 'pending_validation', 'validating', 'active', 'inactive', 'error', 'build_failed', 'removing']):
54
+ raise ValueError("must be one of enum values ('build_pending', 'building', 'pending', 'pulling', 'pending_validation', 'validating', 'active', 'inactive', 'error', 'build_failed', 'removing')")
55
+ return value
46
56
 
47
57
  model_config = ConfigDict(
48
58
  populate_by_name=True,
@@ -62,7 +72,7 @@ class ImageDto(BaseModel):
62
72
 
63
73
  @classmethod
64
74
  def from_json(cls, json_str: str) -> Optional[Self]:
65
- """Create an instance of ImageDto from a JSON string"""
75
+ """Create an instance of SnapshotCreatedPostRequestData from a JSON string"""
66
76
  return cls.from_dict(json.loads(json_str))
67
77
 
68
78
  def to_dict(self) -> Dict[str, Any]:
@@ -90,31 +100,11 @@ class ImageDto(BaseModel):
90
100
  for _key, _value in self.additional_properties.items():
91
101
  _dict[_key] = _value
92
102
 
93
- # set to None if size (nullable) is None
94
- # and model_fields_set contains the field
95
- if self.size is None and "size" in self.model_fields_set:
96
- _dict['size'] = None
97
-
98
- # set to None if entrypoint (nullable) is None
99
- # and model_fields_set contains the field
100
- if self.entrypoint is None and "entrypoint" in self.model_fields_set:
101
- _dict['entrypoint'] = None
102
-
103
- # set to None if error_reason (nullable) is None
104
- # and model_fields_set contains the field
105
- if self.error_reason is None and "error_reason" in self.model_fields_set:
106
- _dict['errorReason'] = None
107
-
108
- # set to None if last_used_at (nullable) is None
109
- # and model_fields_set contains the field
110
- if self.last_used_at is None and "last_used_at" in self.model_fields_set:
111
- _dict['lastUsedAt'] = None
112
-
113
103
  return _dict
114
104
 
115
105
  @classmethod
116
106
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
117
- """Create an instance of ImageDto from a dict"""
107
+ """Create an instance of SnapshotCreatedPostRequestData from a dict"""
118
108
  if obj is None:
119
109
  return None
120
110
 
@@ -126,14 +116,15 @@ class ImageDto(BaseModel):
126
116
  "organizationId": obj.get("organizationId"),
127
117
  "general": obj.get("general"),
128
118
  "name": obj.get("name"),
129
- "enabled": obj.get("enabled"),
119
+ "imageName": obj.get("imageName"),
130
120
  "state": obj.get("state"),
131
121
  "size": obj.get("size"),
132
- "entrypoint": obj.get("entrypoint"),
133
- "errorReason": obj.get("errorReason"),
122
+ "cpu": obj.get("cpu"),
123
+ "gpu": obj.get("gpu"),
124
+ "mem": obj.get("mem"),
125
+ "disk": obj.get("disk"),
134
126
  "createdAt": obj.get("createdAt"),
135
- "updatedAt": obj.get("updatedAt"),
136
- "lastUsedAt": obj.get("lastUsedAt")
127
+ "updatedAt": obj.get("updatedAt")
137
128
  })
138
129
  # store additional fields in additional_properties
139
130
  for _key in obj.keys():
@@ -18,19 +18,21 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
+ from datetime import datetime
21
22
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
- from typing import Any, ClassVar, Dict, List
23
+ from typing import Any, ClassVar, Dict, List, Optional
23
24
  from typing import Optional, Set
24
25
  from typing_extensions import Self
25
26
 
26
- class WorkspaceVolume(BaseModel):
27
+ class SnapshotRemovedPostRequest(BaseModel):
27
28
  """
28
- WorkspaceVolume
29
+ SnapshotRemovedPostRequest
29
30
  """ # noqa: E501
30
- volume_id: StrictStr = Field(description="The ID of the volume", alias="volumeId")
31
- mount_path: StrictStr = Field(description="The mount path for the volume", alias="mountPath")
31
+ event: Optional[StrictStr] = None
32
+ timestamp: Optional[datetime] = None
33
+ data: Optional[StrictStr] = Field(default=None, description="The ID of the removed snapshot")
32
34
  additional_properties: Dict[str, Any] = {}
33
- __properties: ClassVar[List[str]] = ["volumeId", "mountPath"]
35
+ __properties: ClassVar[List[str]] = ["event", "timestamp", "data"]
34
36
 
35
37
  model_config = ConfigDict(
36
38
  populate_by_name=True,
@@ -50,7 +52,7 @@ class WorkspaceVolume(BaseModel):
50
52
 
51
53
  @classmethod
52
54
  def from_json(cls, json_str: str) -> Optional[Self]:
53
- """Create an instance of WorkspaceVolume from a JSON string"""
55
+ """Create an instance of SnapshotRemovedPostRequest from a JSON string"""
54
56
  return cls.from_dict(json.loads(json_str))
55
57
 
56
58
  def to_dict(self) -> Dict[str, Any]:
@@ -82,7 +84,7 @@ class WorkspaceVolume(BaseModel):
82
84
 
83
85
  @classmethod
84
86
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
- """Create an instance of WorkspaceVolume from a dict"""
87
+ """Create an instance of SnapshotRemovedPostRequest from a dict"""
86
88
  if obj is None:
87
89
  return None
88
90
 
@@ -90,8 +92,9 @@ class WorkspaceVolume(BaseModel):
90
92
  return cls.model_validate(obj)
91
93
 
92
94
  _obj = cls.model_validate({
93
- "volumeId": obj.get("volumeId"),
94
- "mountPath": obj.get("mountPath")
95
+ "event": obj.get("event"),
96
+ "timestamp": obj.get("timestamp"),
97
+ "data": obj.get("data")
95
98
  })
96
99
  # store additional fields in additional_properties
97
100
  for _key in obj.keys():
@@ -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 datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, StrictStr
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from daytona_api_client_async.models.snapshot_state_updated_post_request_data import SnapshotStateUpdatedPostRequestData
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class SnapshotStateUpdatedPostRequest(BaseModel):
29
+ """
30
+ SnapshotStateUpdatedPostRequest
31
+ """ # noqa: E501
32
+ event: Optional[StrictStr] = None
33
+ timestamp: Optional[datetime] = None
34
+ data: Optional[SnapshotStateUpdatedPostRequestData] = None
35
+ additional_properties: Dict[str, Any] = {}
36
+ __properties: ClassVar[List[str]] = ["event", "timestamp", "data"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of SnapshotStateUpdatedPostRequest from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ * Fields in `self.additional_properties` are added to the output dict.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ "additional_properties",
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ # override the default output from pydantic by calling `to_dict()` of data
80
+ if self.data:
81
+ _dict['data'] = self.data.to_dict()
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 SnapshotStateUpdatedPostRequest 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
+ "event": obj.get("event"),
100
+ "timestamp": obj.get("timestamp"),
101
+ "data": SnapshotStateUpdatedPostRequestData.from_dict(obj["data"]) if obj.get("data") is not None else None
102
+ })
103
+ # store additional fields in additional_properties
104
+ for _key in obj.keys():
105
+ if _key not in cls.__properties:
106
+ _obj.additional_properties[_key] = obj.get(_key)
107
+
108
+ return _obj
109
+
110
+
@@ -0,0 +1,129 @@
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, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from daytona_api_client_async.models.snapshot_state_updated_post_request_data_snapshot import SnapshotStateUpdatedPostRequestDataSnapshot
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class SnapshotStateUpdatedPostRequestData(BaseModel):
28
+ """
29
+ SnapshotStateUpdatedPostRequestData
30
+ """ # noqa: E501
31
+ snapshot: Optional[SnapshotStateUpdatedPostRequestDataSnapshot] = None
32
+ old_state: Optional[StrictStr] = Field(default=None, alias="oldState")
33
+ new_state: Optional[StrictStr] = Field(default=None, alias="newState")
34
+ additional_properties: Dict[str, Any] = {}
35
+ __properties: ClassVar[List[str]] = ["snapshot", "oldState", "newState"]
36
+
37
+ @field_validator('old_state')
38
+ def old_state_validate_enum(cls, value):
39
+ """Validates the enum"""
40
+ if value is None:
41
+ return value
42
+
43
+ if value not in set(['build_pending', 'building', 'pending', 'pulling', 'pending_validation', 'validating', 'active', 'inactive', 'error', 'build_failed', 'removing']):
44
+ raise ValueError("must be one of enum values ('build_pending', 'building', 'pending', 'pulling', 'pending_validation', 'validating', 'active', 'inactive', 'error', 'build_failed', 'removing')")
45
+ return value
46
+
47
+ @field_validator('new_state')
48
+ def new_state_validate_enum(cls, value):
49
+ """Validates the enum"""
50
+ if value is None:
51
+ return value
52
+
53
+ if value not in set(['build_pending', 'building', 'pending', 'pulling', 'pending_validation', 'validating', 'active', 'inactive', 'error', 'build_failed', 'removing']):
54
+ raise ValueError("must be one of enum values ('build_pending', 'building', 'pending', 'pulling', 'pending_validation', 'validating', 'active', 'inactive', 'error', 'build_failed', 'removing')")
55
+ return value
56
+
57
+ model_config = ConfigDict(
58
+ populate_by_name=True,
59
+ validate_assignment=True,
60
+ protected_namespaces=(),
61
+ )
62
+
63
+
64
+ def to_str(self) -> str:
65
+ """Returns the string representation of the model using alias"""
66
+ return pprint.pformat(self.model_dump(by_alias=True))
67
+
68
+ def to_json(self) -> str:
69
+ """Returns the JSON representation of the model using alias"""
70
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
71
+ return json.dumps(self.to_dict())
72
+
73
+ @classmethod
74
+ def from_json(cls, json_str: str) -> Optional[Self]:
75
+ """Create an instance of SnapshotStateUpdatedPostRequestData from a JSON string"""
76
+ return cls.from_dict(json.loads(json_str))
77
+
78
+ def to_dict(self) -> Dict[str, Any]:
79
+ """Return the dictionary representation of the model using alias.
80
+
81
+ This has the following differences from calling pydantic's
82
+ `self.model_dump(by_alias=True)`:
83
+
84
+ * `None` is only added to the output dict for nullable fields that
85
+ were set at model initialization. Other fields with value `None`
86
+ are ignored.
87
+ * Fields in `self.additional_properties` are added to the output dict.
88
+ """
89
+ excluded_fields: Set[str] = set([
90
+ "additional_properties",
91
+ ])
92
+
93
+ _dict = self.model_dump(
94
+ by_alias=True,
95
+ exclude=excluded_fields,
96
+ exclude_none=True,
97
+ )
98
+ # override the default output from pydantic by calling `to_dict()` of snapshot
99
+ if self.snapshot:
100
+ _dict['snapshot'] = self.snapshot.to_dict()
101
+ # puts key-value pairs in additional_properties in the top level
102
+ if self.additional_properties is not None:
103
+ for _key, _value in self.additional_properties.items():
104
+ _dict[_key] = _value
105
+
106
+ return _dict
107
+
108
+ @classmethod
109
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
110
+ """Create an instance of SnapshotStateUpdatedPostRequestData from a dict"""
111
+ if obj is None:
112
+ return None
113
+
114
+ if not isinstance(obj, dict):
115
+ return cls.model_validate(obj)
116
+
117
+ _obj = cls.model_validate({
118
+ "snapshot": SnapshotStateUpdatedPostRequestDataSnapshot.from_dict(obj["snapshot"]) if obj.get("snapshot") is not None else None,
119
+ "oldState": obj.get("oldState"),
120
+ "newState": obj.get("newState")
121
+ })
122
+ # store additional fields in additional_properties
123
+ for _key in obj.keys():
124
+ if _key not in cls.__properties:
125
+ _obj.additional_properties[_key] = obj.get(_key)
126
+
127
+ return _obj
128
+
129
+
@@ -0,0 +1,115 @@
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, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class SnapshotStateUpdatedPostRequestDataSnapshot(BaseModel):
27
+ """
28
+ SnapshotStateUpdatedPostRequestDataSnapshot
29
+ """ # noqa: E501
30
+ id: Optional[StrictStr] = None
31
+ organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId")
32
+ state: Optional[StrictStr] = None
33
+ additional_properties: Dict[str, Any] = {}
34
+ __properties: ClassVar[List[str]] = ["id", "organizationId", "state"]
35
+
36
+ @field_validator('state')
37
+ def state_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value is None:
40
+ return value
41
+
42
+ if value not in set(['build_pending', 'building', 'pending', 'pulling', 'pending_validation', 'validating', 'active', 'inactive', 'error', 'build_failed', 'removing']):
43
+ raise ValueError("must be one of enum values ('build_pending', 'building', 'pending', 'pulling', 'pending_validation', 'validating', 'active', 'inactive', 'error', 'build_failed', 'removing')")
44
+ return value
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
+ return json.dumps(self.to_dict())
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of SnapshotStateUpdatedPostRequestDataSnapshot from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ * Fields in `self.additional_properties` are added to the output dict.
77
+ """
78
+ excluded_fields: Set[str] = set([
79
+ "additional_properties",
80
+ ])
81
+
82
+ _dict = self.model_dump(
83
+ by_alias=True,
84
+ exclude=excluded_fields,
85
+ exclude_none=True,
86
+ )
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
+ return _dict
93
+
94
+ @classmethod
95
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
96
+ """Create an instance of SnapshotStateUpdatedPostRequestDataSnapshot from a dict"""
97
+ if obj is None:
98
+ return None
99
+
100
+ if not isinstance(obj, dict):
101
+ return cls.model_validate(obj)
102
+
103
+ _obj = cls.model_validate({
104
+ "id": obj.get("id"),
105
+ "organizationId": obj.get("organizationId"),
106
+ "state": obj.get("state")
107
+ })
108
+ # store additional fields in additional_properties
109
+ for _key in obj.keys():
110
+ if _key not in cls.__properties:
111
+ _obj.additional_properties[_key] = obj.get(_key)
112
+
113
+ return _obj
114
+
115
+
@@ -0,0 +1,112 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Daytona
5
+
6
+ Daytona AI platform API Docs
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: support@daytona.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
23
+ from typing import Any, ClassVar, Dict, List
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class SshAccessDto(BaseModel):
28
+ """
29
+ SshAccessDto
30
+ """ # noqa: E501
31
+ id: StrictStr = Field(description="Unique identifier for the SSH access")
32
+ sandbox_id: StrictStr = Field(description="ID of the sandbox this SSH access is for", alias="sandboxId")
33
+ token: StrictStr = Field(description="SSH access token")
34
+ expires_at: datetime = Field(description="When the SSH access expires", alias="expiresAt")
35
+ created_at: datetime = Field(description="When the SSH access was created", alias="createdAt")
36
+ updated_at: datetime = Field(description="When the SSH access was last updated", alias="updatedAt")
37
+ additional_properties: Dict[str, Any] = {}
38
+ __properties: ClassVar[List[str]] = ["id", "sandboxId", "token", "expiresAt", "createdAt", "updatedAt"]
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of SshAccessDto from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ * Fields in `self.additional_properties` are added to the output dict.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ "additional_properties",
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ # puts key-value pairs in additional_properties in the top level
82
+ if self.additional_properties is not None:
83
+ for _key, _value in self.additional_properties.items():
84
+ _dict[_key] = _value
85
+
86
+ return _dict
87
+
88
+ @classmethod
89
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
+ """Create an instance of SshAccessDto from a dict"""
91
+ if obj is None:
92
+ return None
93
+
94
+ if not isinstance(obj, dict):
95
+ return cls.model_validate(obj)
96
+
97
+ _obj = cls.model_validate({
98
+ "id": obj.get("id"),
99
+ "sandboxId": obj.get("sandboxId"),
100
+ "token": obj.get("token"),
101
+ "expiresAt": obj.get("expiresAt"),
102
+ "createdAt": obj.get("createdAt"),
103
+ "updatedAt": obj.get("updatedAt")
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
111
+
112
+