daytona_api_client 0.24.2__py3-none-any.whl → 0.24.5__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.

@@ -18,6 +18,7 @@
18
18
  from daytona_api_client.models.account_provider import AccountProvider
19
19
  from daytona_api_client.models.api_key_list import ApiKeyList
20
20
  from daytona_api_client.models.api_key_response import ApiKeyResponse
21
+ from daytona_api_client.models.audit_log import AuditLog
21
22
  from daytona_api_client.models.build_info import BuildInfo
22
23
  from daytona_api_client.models.command import Command
23
24
  from daytona_api_client.models.completion_context import CompletionContext
@@ -28,6 +29,7 @@ from daytona_api_client.models.computer_use_start_response import ComputerUseSta
28
29
  from daytona_api_client.models.computer_use_status_response import ComputerUseStatusResponse
29
30
  from daytona_api_client.models.computer_use_stop_response import ComputerUseStopResponse
30
31
  from daytona_api_client.models.create_api_key import CreateApiKey
32
+ from daytona_api_client.models.create_audit_log import CreateAuditLog
31
33
  from daytona_api_client.models.create_build_info import CreateBuildInfo
32
34
  from daytona_api_client.models.create_docker_registry import CreateDockerRegistry
33
35
  from daytona_api_client.models.create_linked_account import CreateLinkedAccount
@@ -82,6 +84,7 @@ from daytona_api_client.models.organization_invitation import OrganizationInvita
82
84
  from daytona_api_client.models.organization_role import OrganizationRole
83
85
  from daytona_api_client.models.organization_suspension import OrganizationSuspension
84
86
  from daytona_api_client.models.organization_user import OrganizationUser
87
+ from daytona_api_client.models.paginated_audit_logs import PaginatedAuditLogs
85
88
  from daytona_api_client.models.paginated_snapshots_dto import PaginatedSnapshotsDto
86
89
  from daytona_api_client.models.port_preview_url import PortPreviewUrl
87
90
  from daytona_api_client.models.position import Position
@@ -41,8 +41,8 @@ class ApiKeyList(BaseModel):
41
41
  def permissions_validate_enum(cls, value):
42
42
  """Validates the enum"""
43
43
  for i in value:
44
- if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes']):
45
- raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes')")
44
+ if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs']):
45
+ raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs')")
46
46
  return value
47
47
 
48
48
  model_config = ConfigDict(
@@ -40,8 +40,8 @@ class ApiKeyResponse(BaseModel):
40
40
  def permissions_validate_enum(cls, value):
41
41
  """Validates the enum"""
42
42
  for i in value:
43
- if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes']):
44
- raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes')")
43
+ if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs']):
44
+ raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs')")
45
45
  return value
46
46
 
47
47
  model_config = ConfigDict(
@@ -0,0 +1,128 @@
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, StrictFloat, StrictInt, StrictStr
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 AuditLog(BaseModel):
28
+ """
29
+ AuditLog
30
+ """ # noqa: E501
31
+ id: StrictStr
32
+ actor_id: StrictStr = Field(alias="actorId")
33
+ actor_email: StrictStr = Field(alias="actorEmail")
34
+ organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId")
35
+ action: StrictStr
36
+ target_type: Optional[StrictStr] = Field(default=None, alias="targetType")
37
+ target_id: Optional[StrictStr] = Field(default=None, alias="targetId")
38
+ status_code: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="statusCode")
39
+ error_message: Optional[StrictStr] = Field(default=None, alias="errorMessage")
40
+ ip_address: Optional[StrictStr] = Field(default=None, alias="ipAddress")
41
+ user_agent: Optional[StrictStr] = Field(default=None, alias="userAgent")
42
+ source: Optional[StrictStr] = None
43
+ metadata: Optional[Dict[str, Any]] = None
44
+ created_at: datetime = Field(alias="createdAt")
45
+ additional_properties: Dict[str, Any] = {}
46
+ __properties: ClassVar[List[str]] = ["id", "actorId", "actorEmail", "organizationId", "action", "targetType", "targetId", "statusCode", "errorMessage", "ipAddress", "userAgent", "source", "metadata", "createdAt"]
47
+
48
+ model_config = ConfigDict(
49
+ populate_by_name=True,
50
+ validate_assignment=True,
51
+ protected_namespaces=(),
52
+ )
53
+
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.model_dump(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
62
+ return json.dumps(self.to_dict())
63
+
64
+ @classmethod
65
+ def from_json(cls, json_str: str) -> Optional[Self]:
66
+ """Create an instance of AuditLog from a JSON string"""
67
+ return cls.from_dict(json.loads(json_str))
68
+
69
+ def to_dict(self) -> Dict[str, Any]:
70
+ """Return the dictionary representation of the model using alias.
71
+
72
+ This has the following differences from calling pydantic's
73
+ `self.model_dump(by_alias=True)`:
74
+
75
+ * `None` is only added to the output dict for nullable fields that
76
+ were set at model initialization. Other fields with value `None`
77
+ are ignored.
78
+ * Fields in `self.additional_properties` are added to the output dict.
79
+ """
80
+ excluded_fields: Set[str] = set([
81
+ "additional_properties",
82
+ ])
83
+
84
+ _dict = self.model_dump(
85
+ by_alias=True,
86
+ exclude=excluded_fields,
87
+ exclude_none=True,
88
+ )
89
+ # puts key-value pairs in additional_properties in the top level
90
+ if self.additional_properties is not None:
91
+ for _key, _value in self.additional_properties.items():
92
+ _dict[_key] = _value
93
+
94
+ return _dict
95
+
96
+ @classmethod
97
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
+ """Create an instance of AuditLog from a dict"""
99
+ if obj is None:
100
+ return None
101
+
102
+ if not isinstance(obj, dict):
103
+ return cls.model_validate(obj)
104
+
105
+ _obj = cls.model_validate({
106
+ "id": obj.get("id"),
107
+ "actorId": obj.get("actorId"),
108
+ "actorEmail": obj.get("actorEmail"),
109
+ "organizationId": obj.get("organizationId"),
110
+ "action": obj.get("action"),
111
+ "targetType": obj.get("targetType"),
112
+ "targetId": obj.get("targetId"),
113
+ "statusCode": obj.get("statusCode"),
114
+ "errorMessage": obj.get("errorMessage"),
115
+ "ipAddress": obj.get("ipAddress"),
116
+ "userAgent": obj.get("userAgent"),
117
+ "source": obj.get("source"),
118
+ "metadata": obj.get("metadata"),
119
+ "createdAt": obj.get("createdAt")
120
+ })
121
+ # store additional fields in additional_properties
122
+ for _key in obj.keys():
123
+ if _key not in cls.__properties:
124
+ _obj.additional_properties[_key] = obj.get(_key)
125
+
126
+ return _obj
127
+
128
+
@@ -38,8 +38,8 @@ class CreateApiKey(BaseModel):
38
38
  def permissions_validate_enum(cls, value):
39
39
  """Validates the enum"""
40
40
  for i in value:
41
- if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes']):
42
- raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes')")
41
+ if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs']):
42
+ raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs')")
43
43
  return value
44
44
 
45
45
  model_config = ConfigDict(
@@ -0,0 +1,128 @@
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 CreateAuditLog(BaseModel):
27
+ """
28
+ CreateAuditLog
29
+ """ # noqa: E501
30
+ actor_id: StrictStr = Field(alias="actorId")
31
+ actor_email: StrictStr = Field(alias="actorEmail")
32
+ organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId")
33
+ action: StrictStr
34
+ target_type: Optional[StrictStr] = Field(default=None, alias="targetType")
35
+ target_id: Optional[StrictStr] = Field(default=None, alias="targetId")
36
+ additional_properties: Dict[str, Any] = {}
37
+ __properties: ClassVar[List[str]] = ["actorId", "actorEmail", "organizationId", "action", "targetType", "targetId"]
38
+
39
+ @field_validator('action')
40
+ def action_validate_enum(cls, value):
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', 'toggle_state', 'set_general_status', 'activate', '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', 'toggle_state', 'set_general_status', 'activate', '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
+ return value
45
+
46
+ @field_validator('target_type')
47
+ def target_type_validate_enum(cls, value):
48
+ """Validates the enum"""
49
+ if value is None:
50
+ return value
51
+
52
+ if value not in set(['api_key', 'organization', 'organization_invitation', 'organization_role', 'organization_user', 'docker_registry', 'runner', 'sandbox', 'snapshot', 'user', 'volume']):
53
+ raise ValueError("must be one of enum values ('api_key', 'organization', 'organization_invitation', 'organization_role', 'organization_user', 'docker_registry', 'runner', 'sandbox', 'snapshot', 'user', 'volume')")
54
+ return value
55
+
56
+ model_config = ConfigDict(
57
+ populate_by_name=True,
58
+ validate_assignment=True,
59
+ protected_namespaces=(),
60
+ )
61
+
62
+
63
+ def to_str(self) -> str:
64
+ """Returns the string representation of the model using alias"""
65
+ return pprint.pformat(self.model_dump(by_alias=True))
66
+
67
+ def to_json(self) -> str:
68
+ """Returns the JSON representation of the model using alias"""
69
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
70
+ return json.dumps(self.to_dict())
71
+
72
+ @classmethod
73
+ def from_json(cls, json_str: str) -> Optional[Self]:
74
+ """Create an instance of CreateAuditLog from a JSON string"""
75
+ return cls.from_dict(json.loads(json_str))
76
+
77
+ def to_dict(self) -> Dict[str, Any]:
78
+ """Return the dictionary representation of the model using alias.
79
+
80
+ This has the following differences from calling pydantic's
81
+ `self.model_dump(by_alias=True)`:
82
+
83
+ * `None` is only added to the output dict for nullable fields that
84
+ were set at model initialization. Other fields with value `None`
85
+ are ignored.
86
+ * Fields in `self.additional_properties` are added to the output dict.
87
+ """
88
+ excluded_fields: Set[str] = set([
89
+ "additional_properties",
90
+ ])
91
+
92
+ _dict = self.model_dump(
93
+ by_alias=True,
94
+ exclude=excluded_fields,
95
+ exclude_none=True,
96
+ )
97
+ # puts key-value pairs in additional_properties in the top level
98
+ if self.additional_properties is not None:
99
+ for _key, _value in self.additional_properties.items():
100
+ _dict[_key] = _value
101
+
102
+ return _dict
103
+
104
+ @classmethod
105
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
106
+ """Create an instance of CreateAuditLog from a dict"""
107
+ if obj is None:
108
+ return None
109
+
110
+ if not isinstance(obj, dict):
111
+ return cls.model_validate(obj)
112
+
113
+ _obj = cls.model_validate({
114
+ "actorId": obj.get("actorId"),
115
+ "actorEmail": obj.get("actorEmail"),
116
+ "organizationId": obj.get("organizationId"),
117
+ "action": obj.get("action"),
118
+ "targetType": obj.get("targetType"),
119
+ "targetId": obj.get("targetId")
120
+ })
121
+ # store additional fields in additional_properties
122
+ for _key in obj.keys():
123
+ if _key not in cls.__properties:
124
+ _obj.additional_properties[_key] = obj.get(_key)
125
+
126
+ return _obj
127
+
128
+
@@ -37,8 +37,8 @@ class CreateOrganizationRole(BaseModel):
37
37
  def permissions_validate_enum(cls, value):
38
38
  """Validates the enum"""
39
39
  for i in value:
40
- if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes']):
41
- raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes')")
40
+ if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs']):
41
+ raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs')")
42
42
  return value
43
43
 
44
44
  model_config = ConfigDict(
@@ -29,17 +29,19 @@ class CreateRunner(BaseModel):
29
29
  """ # noqa: E501
30
30
  domain: StrictStr
31
31
  api_url: StrictStr = Field(alias="apiUrl")
32
+ proxy_url: StrictStr = Field(alias="proxyUrl")
32
33
  api_key: StrictStr = Field(alias="apiKey")
33
34
  cpu: Union[StrictFloat, StrictInt]
34
- memory: Union[StrictFloat, StrictInt]
35
- disk: Union[StrictFloat, StrictInt]
35
+ memory_gi_b: Union[StrictFloat, StrictInt] = Field(alias="memoryGiB")
36
+ disk_gi_b: Union[StrictFloat, StrictInt] = Field(alias="diskGiB")
36
37
  gpu: Union[StrictFloat, StrictInt]
37
38
  gpu_type: StrictStr = Field(alias="gpuType")
38
39
  var_class: StrictStr = Field(alias="class")
39
40
  capacity: Union[StrictFloat, StrictInt]
40
41
  region: StrictStr
42
+ version: StrictStr
41
43
  additional_properties: Dict[str, Any] = {}
42
- __properties: ClassVar[List[str]] = ["domain", "apiUrl", "apiKey", "cpu", "memory", "disk", "gpu", "gpuType", "class", "capacity", "region"]
44
+ __properties: ClassVar[List[str]] = ["domain", "apiUrl", "proxyUrl", "apiKey", "cpu", "memoryGiB", "diskGiB", "gpu", "gpuType", "class", "capacity", "region", "version"]
43
45
 
44
46
  @field_validator('var_class')
45
47
  def var_class_validate_enum(cls, value):
@@ -108,15 +110,17 @@ class CreateRunner(BaseModel):
108
110
  _obj = cls.model_validate({
109
111
  "domain": obj.get("domain"),
110
112
  "apiUrl": obj.get("apiUrl"),
113
+ "proxyUrl": obj.get("proxyUrl"),
111
114
  "apiKey": obj.get("apiKey"),
112
115
  "cpu": obj.get("cpu"),
113
- "memory": obj.get("memory"),
114
- "disk": obj.get("disk"),
116
+ "memoryGiB": obj.get("memoryGiB"),
117
+ "diskGiB": obj.get("diskGiB"),
115
118
  "gpu": obj.get("gpu"),
116
119
  "gpuType": obj.get("gpuType"),
117
120
  "class": obj.get("class"),
118
121
  "capacity": obj.get("capacity"),
119
- "region": obj.get("region")
122
+ "region": obj.get("region"),
123
+ "version": obj.get("version")
120
124
  })
121
125
  # store additional fields in additional_properties
122
126
  for _key in obj.keys():
@@ -42,8 +42,8 @@ class OrganizationRole(BaseModel):
42
42
  def permissions_validate_enum(cls, value):
43
43
  """Validates the enum"""
44
44
  for i in value:
45
- if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes']):
46
- raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes')")
45
+ if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs']):
46
+ raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs')")
47
47
  return value
48
48
 
49
49
  model_config = ConfigDict(
@@ -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, StrictFloat, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from daytona_api_client.models.audit_log import AuditLog
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class PaginatedAuditLogs(BaseModel):
28
+ """
29
+ PaginatedAuditLogs
30
+ """ # noqa: E501
31
+ items: List[AuditLog]
32
+ total: Union[StrictFloat, StrictInt]
33
+ page: Union[StrictFloat, StrictInt]
34
+ total_pages: Union[StrictFloat, StrictInt] = Field(alias="totalPages")
35
+ additional_properties: Dict[str, Any] = {}
36
+ __properties: ClassVar[List[str]] = ["items", "total", "page", "totalPages"]
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 PaginatedAuditLogs 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 each item in items (list)
80
+ _items = []
81
+ if self.items:
82
+ for _item_items in self.items:
83
+ if _item_items:
84
+ _items.append(_item_items.to_dict())
85
+ _dict['items'] = _items
86
+ # puts key-value pairs in additional_properties in the top level
87
+ if self.additional_properties is not None:
88
+ for _key, _value in self.additional_properties.items():
89
+ _dict[_key] = _value
90
+
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of PaginatedAuditLogs from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "items": [AuditLog.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
104
+ "total": obj.get("total"),
105
+ "page": obj.get("page"),
106
+ "totalPages": obj.get("totalPages")
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
+
@@ -32,23 +32,33 @@ class Runner(BaseModel):
32
32
  id: StrictStr = Field(description="The ID of the runner")
33
33
  domain: StrictStr = Field(description="The domain of the runner")
34
34
  api_url: StrictStr = Field(description="The API URL of the runner", alias="apiUrl")
35
+ proxy_url: StrictStr = Field(description="The proxy URL of the runner", alias="proxyUrl")
35
36
  api_key: StrictStr = Field(description="The API key for the runner", alias="apiKey")
36
37
  cpu: Union[StrictFloat, StrictInt] = Field(description="The CPU capacity of the runner")
37
- memory: Union[StrictFloat, StrictInt] = Field(description="The memory capacity of the runner in GB")
38
- disk: Union[StrictFloat, StrictInt] = Field(description="The disk capacity of the runner in GB")
38
+ memory: Union[StrictFloat, StrictInt] = Field(description="The memory capacity of the runner in GiB")
39
+ disk: Union[StrictFloat, StrictInt] = Field(description="The disk capacity of the runner in GiB")
39
40
  gpu: Union[StrictFloat, StrictInt] = Field(description="The GPU capacity of the runner")
40
41
  gpu_type: StrictStr = Field(description="The type of GPU", alias="gpuType")
41
42
  var_class: SandboxClass = Field(description="The class of the runner", alias="class")
42
43
  used: Union[StrictFloat, StrictInt] = Field(description="The current usage of the runner")
43
44
  capacity: Union[StrictFloat, StrictInt] = Field(description="The capacity of the runner")
45
+ current_cpu_usage_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current CPU usage percentage", alias="currentCpuUsagePercentage")
46
+ current_memory_usage_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current RAM usage percentage", alias="currentMemoryUsagePercentage")
47
+ current_disk_usage_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current disk usage percentage", alias="currentDiskUsagePercentage")
48
+ current_allocated_cpu: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current allocated CPU", alias="currentAllocatedCpu")
49
+ current_allocated_memory_gi_b: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current allocated memory in GiB", alias="currentAllocatedMemoryGiB")
50
+ current_allocated_disk_gi_b: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current allocated disk in GiB", alias="currentAllocatedDiskGiB")
51
+ current_snapshot_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Current snapshot count", alias="currentSnapshotCount")
52
+ availability_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Runner availability score", alias="availabilityScore")
44
53
  region: StrictStr = Field(description="The region of the runner")
45
54
  state: RunnerState = Field(description="The state of the runner")
46
55
  last_checked: Optional[StrictStr] = Field(default=None, description="The last time the runner was checked", alias="lastChecked")
47
56
  unschedulable: StrictBool = Field(description="Whether the runner is unschedulable")
48
57
  created_at: StrictStr = Field(description="The creation timestamp of the runner", alias="createdAt")
49
58
  updated_at: StrictStr = Field(description="The last update timestamp of the runner", alias="updatedAt")
59
+ version: StrictStr = Field(description="The version of the runner")
50
60
  additional_properties: Dict[str, Any] = {}
51
- __properties: ClassVar[List[str]] = ["id", "domain", "apiUrl", "apiKey", "cpu", "memory", "disk", "gpu", "gpuType", "class", "used", "capacity", "region", "state", "lastChecked", "unschedulable", "createdAt", "updatedAt"]
61
+ __properties: ClassVar[List[str]] = ["id", "domain", "apiUrl", "proxyUrl", "apiKey", "cpu", "memory", "disk", "gpu", "gpuType", "class", "used", "capacity", "currentCpuUsagePercentage", "currentMemoryUsagePercentage", "currentDiskUsagePercentage", "currentAllocatedCpu", "currentAllocatedMemoryGiB", "currentAllocatedDiskGiB", "currentSnapshotCount", "availabilityScore", "region", "state", "lastChecked", "unschedulable", "createdAt", "updatedAt", "version"]
52
62
 
53
63
  model_config = ConfigDict(
54
64
  populate_by_name=True,
@@ -111,6 +121,7 @@ class Runner(BaseModel):
111
121
  "id": obj.get("id"),
112
122
  "domain": obj.get("domain"),
113
123
  "apiUrl": obj.get("apiUrl"),
124
+ "proxyUrl": obj.get("proxyUrl"),
114
125
  "apiKey": obj.get("apiKey"),
115
126
  "cpu": obj.get("cpu"),
116
127
  "memory": obj.get("memory"),
@@ -120,12 +131,21 @@ class Runner(BaseModel):
120
131
  "class": obj.get("class"),
121
132
  "used": obj.get("used"),
122
133
  "capacity": obj.get("capacity"),
134
+ "currentCpuUsagePercentage": obj.get("currentCpuUsagePercentage"),
135
+ "currentMemoryUsagePercentage": obj.get("currentMemoryUsagePercentage"),
136
+ "currentDiskUsagePercentage": obj.get("currentDiskUsagePercentage"),
137
+ "currentAllocatedCpu": obj.get("currentAllocatedCpu"),
138
+ "currentAllocatedMemoryGiB": obj.get("currentAllocatedMemoryGiB"),
139
+ "currentAllocatedDiskGiB": obj.get("currentAllocatedDiskGiB"),
140
+ "currentSnapshotCount": obj.get("currentSnapshotCount"),
141
+ "availabilityScore": obj.get("availabilityScore"),
123
142
  "region": obj.get("region"),
124
143
  "state": obj.get("state"),
125
144
  "lastChecked": obj.get("lastChecked"),
126
145
  "unschedulable": obj.get("unschedulable"),
127
146
  "createdAt": obj.get("createdAt"),
128
- "updatedAt": obj.get("updatedAt")
147
+ "updatedAt": obj.get("updatedAt"),
148
+ "version": obj.get("version")
129
149
  })
130
150
  # store additional fields in additional_properties
131
151
  for _key in obj.keys():
@@ -37,8 +37,8 @@ class UpdateOrganizationRole(BaseModel):
37
37
  def permissions_validate_enum(cls, value):
38
38
  """Validates the enum"""
39
39
  for i in value:
40
- if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes']):
41
- raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes')")
40
+ if i not in set(['write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs']):
41
+ raise ValueError("each list item must be one of ('write:registries', 'delete:registries', 'write:snapshots', 'delete:snapshots', 'write:sandboxes', 'delete:sandboxes', 'read:volumes', 'write:volumes', 'delete:volumes', 'read:audit_logs')")
42
42
  return value
43
43
 
44
44
  model_config = ConfigDict(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: daytona_api_client
3
- Version: 0.24.2
3
+ Version: 0.24.5
4
4
  Summary: Daytona
5
5
  Home-page:
6
6
  Author: Daytona Platforms Inc.