daytona_api_client_async 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_async might be problematic. Click here for more details.

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