daytona_api_client 0.26.0rc1__py3-none-any.whl → 0.26.0rc2__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 +9 -1
- daytona_api_client/api/__init__.py +1 -0
- daytona_api_client/api/default_api.py +1884 -0
- daytona_api_client/api/organizations_api.py +6 -6
- daytona_api_client/api/sandbox_api.py +855 -2
- daytona_api_client/api/toolbox_api.py +13 -12
- daytona_api_client/api/webhooks_api.py +1704 -0
- daytona_api_client/models/__init__.py +8 -1
- daytona_api_client/models/create_audit_log.py +2 -2
- daytona_api_client/models/{usage_overview.py → organization_usage_overview.py} +14 -8
- daytona_api_client/models/sandbox_created_post_request.py +110 -0
- daytona_api_client/models/sandbox_created_post_request_data.py +152 -0
- daytona_api_client/models/sandbox_state_updated_post_request.py +110 -0
- daytona_api_client/models/sandbox_state_updated_post_request_data.py +129 -0
- daytona_api_client/models/sandbox_state_updated_post_request_data_sandbox.py +115 -0
- daytona_api_client/models/send_webhook_dto.py +105 -0
- daytona_api_client/models/session_command_logs_response.py +103 -0
- daytona_api_client/models/session_execute_response.py +5 -3
- daytona_api_client/models/snapshot_created_post_request.py +110 -0
- daytona_api_client/models/snapshot_created_post_request_data.py +136 -0
- daytona_api_client/models/snapshot_removed_post_request.py +106 -0
- daytona_api_client/models/snapshot_state_updated_post_request.py +110 -0
- daytona_api_client/models/snapshot_state_updated_post_request_data.py +129 -0
- daytona_api_client/models/snapshot_state_updated_post_request_data_snapshot.py +115 -0
- daytona_api_client/models/ssh_access_dto.py +112 -0
- daytona_api_client/models/ssh_access_validation_dto.py +107 -0
- daytona_api_client/models/volume_created_post_request.py +110 -0
- daytona_api_client/models/volume_created_post_request_data.py +126 -0
- daytona_api_client/models/volume_state_updated_post_request.py +110 -0
- daytona_api_client/models/volume_state_updated_post_request_data.py +129 -0
- daytona_api_client/models/volume_state_updated_post_request_data_volume.py +115 -0
- daytona_api_client/models/webhook_app_portal_access.py +101 -0
- daytona_api_client/models/webhook_controller_get_app_portal_access200_response.py +101 -0
- daytona_api_client/models/webhook_controller_get_initialization_status200_response.py +118 -0
- daytona_api_client/models/{toggle_state.py → webhook_controller_get_status200_response.py} +7 -7
- daytona_api_client/models/webhook_initialization_status.py +121 -0
- {daytona_api_client-0.26.0rc1.dist-info → daytona_api_client-0.26.0rc2.dist-info}/METADATA +1 -1
- {daytona_api_client-0.26.0rc1.dist-info → daytona_api_client-0.26.0rc2.dist-info}/RECORD +41 -15
- {daytona_api_client-0.26.0rc1.dist-info → daytona_api_client-0.26.0rc2.dist-info}/WHEEL +0 -0
- {daytona_api_client-0.26.0rc1.dist-info → daytona_api_client-0.26.0rc2.dist-info}/licenses/LICENSE +0 -0
- {daytona_api_client-0.26.0rc1.dist-info → daytona_api_client-0.26.0rc2.dist-info}/top_level.txt +0 -0
|
@@ -83,6 +83,7 @@ from daytona_api_client.models.organization import Organization
|
|
|
83
83
|
from daytona_api_client.models.organization_invitation import OrganizationInvitation
|
|
84
84
|
from daytona_api_client.models.organization_role import OrganizationRole
|
|
85
85
|
from daytona_api_client.models.organization_suspension import OrganizationSuspension
|
|
86
|
+
from daytona_api_client.models.organization_usage_overview import OrganizationUsageOverview
|
|
86
87
|
from daytona_api_client.models.organization_user import OrganizationUser
|
|
87
88
|
from daytona_api_client.models.paginated_audit_logs import PaginatedAuditLogs
|
|
88
89
|
from daytona_api_client.models.paginated_snapshots_dto import PaginatedSnapshotsDto
|
|
@@ -110,12 +111,16 @@ from daytona_api_client.models.sandbox_state import SandboxState
|
|
|
110
111
|
from daytona_api_client.models.sandbox_volume import SandboxVolume
|
|
111
112
|
from daytona_api_client.models.screenshot_response import ScreenshotResponse
|
|
112
113
|
from daytona_api_client.models.search_files_response import SearchFilesResponse
|
|
114
|
+
from daytona_api_client.models.send_webhook_dto import SendWebhookDto
|
|
113
115
|
from daytona_api_client.models.session import Session
|
|
116
|
+
from daytona_api_client.models.session_command_logs_response import SessionCommandLogsResponse
|
|
114
117
|
from daytona_api_client.models.session_execute_request import SessionExecuteRequest
|
|
115
118
|
from daytona_api_client.models.session_execute_response import SessionExecuteResponse
|
|
116
119
|
from daytona_api_client.models.set_snapshot_general_status_dto import SetSnapshotGeneralStatusDto
|
|
117
120
|
from daytona_api_client.models.snapshot_dto import SnapshotDto
|
|
118
121
|
from daytona_api_client.models.snapshot_state import SnapshotState
|
|
122
|
+
from daytona_api_client.models.ssh_access_dto import SshAccessDto
|
|
123
|
+
from daytona_api_client.models.ssh_access_validation_dto import SshAccessValidationDto
|
|
119
124
|
from daytona_api_client.models.storage_access_dto import StorageAccessDto
|
|
120
125
|
from daytona_api_client.models.update_assigned_organization_roles import UpdateAssignedOrganizationRoles
|
|
121
126
|
from daytona_api_client.models.update_docker_registry import UpdateDockerRegistry
|
|
@@ -123,10 +128,12 @@ from daytona_api_client.models.update_organization_invitation import UpdateOrgan
|
|
|
123
128
|
from daytona_api_client.models.update_organization_member_role import UpdateOrganizationMemberRole
|
|
124
129
|
from daytona_api_client.models.update_organization_quota import UpdateOrganizationQuota
|
|
125
130
|
from daytona_api_client.models.update_organization_role import UpdateOrganizationRole
|
|
126
|
-
from daytona_api_client.models.usage_overview import UsageOverview
|
|
127
131
|
from daytona_api_client.models.user import User
|
|
128
132
|
from daytona_api_client.models.user_public_key import UserPublicKey
|
|
129
133
|
from daytona_api_client.models.volume_dto import VolumeDto
|
|
130
134
|
from daytona_api_client.models.volume_state import VolumeState
|
|
135
|
+
from daytona_api_client.models.webhook_app_portal_access import WebhookAppPortalAccess
|
|
136
|
+
from daytona_api_client.models.webhook_controller_get_status200_response import WebhookControllerGetStatus200Response
|
|
137
|
+
from daytona_api_client.models.webhook_initialization_status import WebhookInitializationStatus
|
|
131
138
|
from daytona_api_client.models.windows_response import WindowsResponse
|
|
132
139
|
from daytona_api_client.models.workspace import Workspace
|
|
@@ -39,8 +39,8 @@ class CreateAuditLog(BaseModel):
|
|
|
39
39
|
@field_validator('action')
|
|
40
40
|
def action_validate_enum(cls, value):
|
|
41
41
|
"""Validates the enum"""
|
|
42
|
-
if value not in set(['create', 'read', 'update', 'delete', 'login', 'set_default', 'update_role', 'update_assigned_roles', 'update_quota', 'suspend', 'unsuspend', 'accept', 'decline', 'link_account', 'unlink_account', 'leave_organization', 'regenerate_key_pair', 'update_scheduling', 'start', 'stop', 'replace_labels', 'create_backup', 'update_public_status', 'set_auto_stop_interval', 'set_auto_archive_interval', 'set_auto_delete_interval', 'archive', 'get_port_preview_url', 'set_general_status', 'activate', 'deactivate', 'update_network_settings', 'toolbox_delete_file', 'toolbox_download_file', 'toolbox_create_folder', 'toolbox_move_file', 'toolbox_set_file_permissions', 'toolbox_replace_in_files', 'toolbox_upload_file', 'toolbox_bulk_upload_files', 'toolbox_git_add_files', 'toolbox_git_create_branch', 'toolbox_git_delete_branch', 'toolbox_git_clone_repository', 'toolbox_git_commit_changes', 'toolbox_git_pull_changes', 'toolbox_git_push_changes', 'toolbox_git_checkout_branch', 'toolbox_execute_command', 'toolbox_create_session', 'toolbox_session_execute_command', 'toolbox_delete_session', 'toolbox_computer_use_start', 'toolbox_computer_use_stop', 'toolbox_computer_use_restart_process']):
|
|
43
|
-
raise ValueError("must be one of enum values ('create', 'read', 'update', 'delete', 'login', 'set_default', 'update_role', 'update_assigned_roles', 'update_quota', 'suspend', 'unsuspend', 'accept', 'decline', 'link_account', 'unlink_account', 'leave_organization', 'regenerate_key_pair', 'update_scheduling', 'start', 'stop', 'replace_labels', 'create_backup', 'update_public_status', 'set_auto_stop_interval', 'set_auto_archive_interval', 'set_auto_delete_interval', 'archive', 'get_port_preview_url', 'set_general_status', 'activate', 'deactivate', 'update_network_settings', 'toolbox_delete_file', 'toolbox_download_file', 'toolbox_create_folder', 'toolbox_move_file', 'toolbox_set_file_permissions', 'toolbox_replace_in_files', 'toolbox_upload_file', 'toolbox_bulk_upload_files', 'toolbox_git_add_files', 'toolbox_git_create_branch', 'toolbox_git_delete_branch', 'toolbox_git_clone_repository', 'toolbox_git_commit_changes', 'toolbox_git_pull_changes', 'toolbox_git_push_changes', 'toolbox_git_checkout_branch', 'toolbox_execute_command', 'toolbox_create_session', 'toolbox_session_execute_command', 'toolbox_delete_session', 'toolbox_computer_use_start', 'toolbox_computer_use_stop', 'toolbox_computer_use_restart_process')")
|
|
42
|
+
if value not in set(['create', 'read', 'update', 'delete', 'login', 'set_default', 'update_role', 'update_assigned_roles', 'update_quota', 'suspend', 'unsuspend', 'accept', 'decline', 'link_account', 'unlink_account', 'leave_organization', 'regenerate_key_pair', 'update_scheduling', 'start', 'stop', 'replace_labels', 'create_backup', 'update_public_status', 'set_auto_stop_interval', 'set_auto_archive_interval', 'set_auto_delete_interval', 'archive', 'get_port_preview_url', 'set_general_status', 'activate', 'deactivate', 'update_network_settings', 'get_webhook_app_portal_access', 'send_webhook_message', 'initialize_webhooks', 'toolbox_delete_file', 'toolbox_download_file', 'toolbox_create_folder', 'toolbox_move_file', 'toolbox_set_file_permissions', 'toolbox_replace_in_files', 'toolbox_upload_file', 'toolbox_bulk_upload_files', 'toolbox_git_add_files', 'toolbox_git_create_branch', 'toolbox_git_delete_branch', 'toolbox_git_clone_repository', 'toolbox_git_commit_changes', 'toolbox_git_pull_changes', 'toolbox_git_push_changes', 'toolbox_git_checkout_branch', 'toolbox_execute_command', 'toolbox_create_session', 'toolbox_session_execute_command', 'toolbox_delete_session', 'toolbox_computer_use_start', 'toolbox_computer_use_stop', 'toolbox_computer_use_restart_process']):
|
|
43
|
+
raise ValueError("must be one of enum values ('create', 'read', 'update', 'delete', 'login', 'set_default', 'update_role', 'update_assigned_roles', 'update_quota', 'suspend', 'unsuspend', 'accept', 'decline', 'link_account', 'unlink_account', 'leave_organization', 'regenerate_key_pair', 'update_scheduling', 'start', 'stop', 'replace_labels', 'create_backup', 'update_public_status', 'set_auto_stop_interval', 'set_auto_archive_interval', 'set_auto_delete_interval', 'archive', 'get_port_preview_url', 'set_general_status', 'activate', 'deactivate', 'update_network_settings', 'get_webhook_app_portal_access', 'send_webhook_message', 'initialize_webhooks', 'toolbox_delete_file', 'toolbox_download_file', 'toolbox_create_folder', 'toolbox_move_file', 'toolbox_set_file_permissions', 'toolbox_replace_in_files', 'toolbox_upload_file', 'toolbox_bulk_upload_files', 'toolbox_git_add_files', 'toolbox_git_create_branch', 'toolbox_git_delete_branch', 'toolbox_git_clone_repository', 'toolbox_git_commit_changes', 'toolbox_git_pull_changes', 'toolbox_git_push_changes', 'toolbox_git_checkout_branch', 'toolbox_execute_command', 'toolbox_create_session', 'toolbox_session_execute_command', 'toolbox_delete_session', 'toolbox_computer_use_start', 'toolbox_computer_use_stop', 'toolbox_computer_use_restart_process')")
|
|
44
44
|
return value
|
|
45
45
|
|
|
46
46
|
@field_validator('target_type')
|
|
@@ -23,19 +23,22 @@ from typing import Any, ClassVar, Dict, List, Union
|
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class OrganizationUsageOverview(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
OrganizationUsageOverview
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
total_cpu_quota: Union[StrictFloat, StrictInt] = Field(alias="totalCpuQuota")
|
|
31
|
-
total_gpu_quota: Union[StrictFloat, StrictInt] = Field(alias="totalGpuQuota")
|
|
32
31
|
total_memory_quota: Union[StrictFloat, StrictInt] = Field(alias="totalMemoryQuota")
|
|
33
32
|
total_disk_quota: Union[StrictFloat, StrictInt] = Field(alias="totalDiskQuota")
|
|
34
33
|
current_cpu_usage: Union[StrictFloat, StrictInt] = Field(alias="currentCpuUsage")
|
|
35
34
|
current_memory_usage: Union[StrictFloat, StrictInt] = Field(alias="currentMemoryUsage")
|
|
36
35
|
current_disk_usage: Union[StrictFloat, StrictInt] = Field(alias="currentDiskUsage")
|
|
36
|
+
total_snapshot_quota: Union[StrictFloat, StrictInt] = Field(alias="totalSnapshotQuota")
|
|
37
|
+
current_snapshot_usage: Union[StrictFloat, StrictInt] = Field(alias="currentSnapshotUsage")
|
|
38
|
+
total_volume_quota: Union[StrictFloat, StrictInt] = Field(alias="totalVolumeQuota")
|
|
39
|
+
current_volume_usage: Union[StrictFloat, StrictInt] = Field(alias="currentVolumeUsage")
|
|
37
40
|
additional_properties: Dict[str, Any] = {}
|
|
38
|
-
__properties: ClassVar[List[str]] = ["totalCpuQuota", "
|
|
41
|
+
__properties: ClassVar[List[str]] = ["totalCpuQuota", "totalMemoryQuota", "totalDiskQuota", "currentCpuUsage", "currentMemoryUsage", "currentDiskUsage", "totalSnapshotQuota", "currentSnapshotUsage", "totalVolumeQuota", "currentVolumeUsage"]
|
|
39
42
|
|
|
40
43
|
model_config = ConfigDict(
|
|
41
44
|
populate_by_name=True,
|
|
@@ -55,7 +58,7 @@ class UsageOverview(BaseModel):
|
|
|
55
58
|
|
|
56
59
|
@classmethod
|
|
57
60
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
-
"""Create an instance of
|
|
61
|
+
"""Create an instance of OrganizationUsageOverview from a JSON string"""
|
|
59
62
|
return cls.from_dict(json.loads(json_str))
|
|
60
63
|
|
|
61
64
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -87,7 +90,7 @@ class UsageOverview(BaseModel):
|
|
|
87
90
|
|
|
88
91
|
@classmethod
|
|
89
92
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
-
"""Create an instance of
|
|
93
|
+
"""Create an instance of OrganizationUsageOverview from a dict"""
|
|
91
94
|
if obj is None:
|
|
92
95
|
return None
|
|
93
96
|
|
|
@@ -96,12 +99,15 @@ class UsageOverview(BaseModel):
|
|
|
96
99
|
|
|
97
100
|
_obj = cls.model_validate({
|
|
98
101
|
"totalCpuQuota": obj.get("totalCpuQuota"),
|
|
99
|
-
"totalGpuQuota": obj.get("totalGpuQuota"),
|
|
100
102
|
"totalMemoryQuota": obj.get("totalMemoryQuota"),
|
|
101
103
|
"totalDiskQuota": obj.get("totalDiskQuota"),
|
|
102
104
|
"currentCpuUsage": obj.get("currentCpuUsage"),
|
|
103
105
|
"currentMemoryUsage": obj.get("currentMemoryUsage"),
|
|
104
|
-
"currentDiskUsage": obj.get("currentDiskUsage")
|
|
106
|
+
"currentDiskUsage": obj.get("currentDiskUsage"),
|
|
107
|
+
"totalSnapshotQuota": obj.get("totalSnapshotQuota"),
|
|
108
|
+
"currentSnapshotUsage": obj.get("currentSnapshotUsage"),
|
|
109
|
+
"totalVolumeQuota": obj.get("totalVolumeQuota"),
|
|
110
|
+
"currentVolumeUsage": obj.get("currentVolumeUsage")
|
|
105
111
|
})
|
|
106
112
|
# store additional fields in additional_properties
|
|
107
113
|
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.models.sandbox_created_post_request_data import SandboxCreatedPostRequestData
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class SandboxCreatedPostRequest(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
SandboxCreatedPostRequest
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
event: Optional[StrictStr] = None
|
|
33
|
+
timestamp: Optional[datetime] = None
|
|
34
|
+
data: Optional[SandboxCreatedPostRequestData] = 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 SandboxCreatedPostRequest 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 SandboxCreatedPostRequest 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": SandboxCreatedPostRequestData.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,152 @@
|
|
|
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, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
|
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class SandboxCreatedPostRequestData(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SandboxCreatedPostRequestData
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
id: Optional[StrictStr] = None
|
|
32
|
+
organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId")
|
|
33
|
+
target: Optional[StrictStr] = None
|
|
34
|
+
snapshot: Optional[StrictStr] = None
|
|
35
|
+
user: Optional[StrictStr] = None
|
|
36
|
+
env: Optional[Dict[str, StrictStr]] = None
|
|
37
|
+
cpu: Optional[Union[StrictFloat, StrictInt]] = None
|
|
38
|
+
gpu: Optional[Union[StrictFloat, StrictInt]] = None
|
|
39
|
+
memory: Optional[Union[StrictFloat, StrictInt]] = None
|
|
40
|
+
disk: Optional[Union[StrictFloat, StrictInt]] = None
|
|
41
|
+
public: Optional[StrictBool] = None
|
|
42
|
+
labels: Optional[Dict[str, StrictStr]] = None
|
|
43
|
+
state: Optional[StrictStr] = None
|
|
44
|
+
desired_state: Optional[StrictStr] = Field(default=None, alias="desiredState")
|
|
45
|
+
created_at: Optional[datetime] = Field(default=None, alias="createdAt")
|
|
46
|
+
updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
|
|
47
|
+
additional_properties: Dict[str, Any] = {}
|
|
48
|
+
__properties: ClassVar[List[str]] = ["id", "organizationId", "target", "snapshot", "user", "env", "cpu", "gpu", "memory", "disk", "public", "labels", "state", "desiredState", "createdAt", "updatedAt"]
|
|
49
|
+
|
|
50
|
+
@field_validator('state')
|
|
51
|
+
def state_validate_enum(cls, value):
|
|
52
|
+
"""Validates the enum"""
|
|
53
|
+
if value is None:
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
if value not in set(['creating', 'restoring', 'destroyed', 'destroying', 'started', 'stopped', 'starting', 'stopping', 'error', 'build_failed', 'pending_build', 'building_snapshot', 'unknown', 'pulling_snapshot', 'archived', 'archiving']):
|
|
57
|
+
raise ValueError("must be one of enum values ('creating', 'restoring', 'destroyed', 'destroying', 'started', 'stopped', 'starting', 'stopping', 'error', 'build_failed', 'pending_build', 'building_snapshot', 'unknown', 'pulling_snapshot', 'archived', 'archiving')")
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
@field_validator('desired_state')
|
|
61
|
+
def desired_state_validate_enum(cls, value):
|
|
62
|
+
"""Validates the enum"""
|
|
63
|
+
if value is None:
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
if value not in set(['destroyed', 'started', 'stopped', 'resized', 'archived']):
|
|
67
|
+
raise ValueError("must be one of enum values ('destroyed', 'started', 'stopped', 'resized', 'archived')")
|
|
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 SandboxCreatedPostRequestData 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
|
+
# puts key-value pairs in additional_properties in the top level
|
|
112
|
+
if self.additional_properties is not None:
|
|
113
|
+
for _key, _value in self.additional_properties.items():
|
|
114
|
+
_dict[_key] = _value
|
|
115
|
+
|
|
116
|
+
return _dict
|
|
117
|
+
|
|
118
|
+
@classmethod
|
|
119
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
120
|
+
"""Create an instance of SandboxCreatedPostRequestData from a dict"""
|
|
121
|
+
if obj is None:
|
|
122
|
+
return None
|
|
123
|
+
|
|
124
|
+
if not isinstance(obj, dict):
|
|
125
|
+
return cls.model_validate(obj)
|
|
126
|
+
|
|
127
|
+
_obj = cls.model_validate({
|
|
128
|
+
"id": obj.get("id"),
|
|
129
|
+
"organizationId": obj.get("organizationId"),
|
|
130
|
+
"target": obj.get("target"),
|
|
131
|
+
"snapshot": obj.get("snapshot"),
|
|
132
|
+
"user": obj.get("user"),
|
|
133
|
+
"env": obj.get("env"),
|
|
134
|
+
"cpu": obj.get("cpu"),
|
|
135
|
+
"gpu": obj.get("gpu"),
|
|
136
|
+
"memory": obj.get("memory"),
|
|
137
|
+
"disk": obj.get("disk"),
|
|
138
|
+
"public": obj.get("public"),
|
|
139
|
+
"labels": obj.get("labels"),
|
|
140
|
+
"state": obj.get("state"),
|
|
141
|
+
"desiredState": obj.get("desiredState"),
|
|
142
|
+
"createdAt": obj.get("createdAt"),
|
|
143
|
+
"updatedAt": obj.get("updatedAt")
|
|
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
|
|
151
|
+
|
|
152
|
+
|
|
@@ -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.models.sandbox_state_updated_post_request_data import SandboxStateUpdatedPostRequestData
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class SandboxStateUpdatedPostRequest(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
SandboxStateUpdatedPostRequest
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
event: Optional[StrictStr] = None
|
|
33
|
+
timestamp: Optional[datetime] = None
|
|
34
|
+
data: Optional[SandboxStateUpdatedPostRequestData] = 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 SandboxStateUpdatedPostRequest 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 SandboxStateUpdatedPostRequest 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": SandboxStateUpdatedPostRequestData.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.models.sandbox_state_updated_post_request_data_sandbox import SandboxStateUpdatedPostRequestDataSandbox
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class SandboxStateUpdatedPostRequestData(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SandboxStateUpdatedPostRequestData
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
sandbox: Optional[SandboxStateUpdatedPostRequestDataSandbox] = 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]] = ["sandbox", "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(['creating', 'restoring', 'destroyed', 'destroying', 'started', 'stopped', 'starting', 'stopping', 'error', 'build_failed', 'pending_build', 'building_snapshot', 'unknown', 'pulling_snapshot', 'archived', 'archiving']):
|
|
44
|
+
raise ValueError("must be one of enum values ('creating', 'restoring', 'destroyed', 'destroying', 'started', 'stopped', 'starting', 'stopping', 'error', 'build_failed', 'pending_build', 'building_snapshot', 'unknown', 'pulling_snapshot', 'archived', 'archiving')")
|
|
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(['creating', 'restoring', 'destroyed', 'destroying', 'started', 'stopped', 'starting', 'stopping', 'error', 'build_failed', 'pending_build', 'building_snapshot', 'unknown', 'pulling_snapshot', 'archived', 'archiving']):
|
|
54
|
+
raise ValueError("must be one of enum values ('creating', 'restoring', 'destroyed', 'destroying', 'started', 'stopped', 'starting', 'stopping', 'error', 'build_failed', 'pending_build', 'building_snapshot', 'unknown', 'pulling_snapshot', 'archived', 'archiving')")
|
|
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 SandboxStateUpdatedPostRequestData 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 sandbox
|
|
99
|
+
if self.sandbox:
|
|
100
|
+
_dict['sandbox'] = self.sandbox.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 SandboxStateUpdatedPostRequestData 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
|
+
"sandbox": SandboxStateUpdatedPostRequestDataSandbox.from_dict(obj["sandbox"]) if obj.get("sandbox") 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
|
+
|