daytona_api_client 0.21.5a8__py3-none-any.whl → 0.22.0a5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of daytona_api_client might be problematic. Click here for more details.

Files changed (44) hide show
  1. daytona_api_client/__init__.py +25 -0
  2. daytona_api_client/api/sandbox_api.py +29 -5
  3. daytona_api_client/api/snapshots_api.py +280 -0
  4. daytona_api_client/api/toolbox_api.py +8022 -1640
  5. daytona_api_client/models/__init__.py +25 -0
  6. daytona_api_client/models/compressed_screenshot_response.py +105 -0
  7. daytona_api_client/models/computer_use_start_response.py +103 -0
  8. daytona_api_client/models/computer_use_status_response.py +108 -0
  9. daytona_api_client/models/computer_use_stop_response.py +103 -0
  10. daytona_api_client/models/display_info_response.py +101 -0
  11. daytona_api_client/models/download_files.py +101 -0
  12. daytona_api_client/models/empty_response.py +101 -0
  13. daytona_api_client/models/keyboard_hotkey_request.py +101 -0
  14. daytona_api_client/models/keyboard_hotkey_response.py +103 -0
  15. daytona_api_client/models/keyboard_press_request.py +103 -0
  16. daytona_api_client/models/keyboard_press_response.py +105 -0
  17. daytona_api_client/models/keyboard_type_request.py +103 -0
  18. daytona_api_client/models/keyboard_type_response.py +103 -0
  19. daytona_api_client/models/mouse_click_request.py +107 -0
  20. daytona_api_client/models/mouse_click_response.py +103 -0
  21. daytona_api_client/models/mouse_drag_request.py +109 -0
  22. daytona_api_client/models/mouse_drag_response.py +103 -0
  23. daytona_api_client/models/mouse_move_request.py +103 -0
  24. daytona_api_client/models/mouse_move_response.py +103 -0
  25. daytona_api_client/models/mouse_position.py +103 -0
  26. daytona_api_client/models/mouse_scroll_request.py +107 -0
  27. daytona_api_client/models/mouse_scroll_response.py +101 -0
  28. daytona_api_client/models/port_preview_url.py +5 -3
  29. daytona_api_client/models/process_errors_response.py +103 -0
  30. daytona_api_client/models/process_logs_response.py +103 -0
  31. daytona_api_client/models/process_restart_response.py +103 -0
  32. daytona_api_client/models/process_status_response.py +103 -0
  33. daytona_api_client/models/region_screenshot_response.py +105 -0
  34. daytona_api_client/models/sandbox.py +4 -1
  35. daytona_api_client/models/sandbox_desired_state.py +41 -0
  36. daytona_api_client/models/screenshot_response.py +105 -0
  37. daytona_api_client/models/snapshot_state.py +1 -0
  38. daytona_api_client/models/windows_response.py +101 -0
  39. daytona_api_client/models/workspace.py +4 -1
  40. {daytona_api_client-0.21.5a8.dist-info → daytona_api_client-0.22.0a5.dist-info}/METADATA +1 -1
  41. {daytona_api_client-0.21.5a8.dist-info → daytona_api_client-0.22.0a5.dist-info}/RECORD +44 -14
  42. {daytona_api_client-0.21.5a8.dist-info → daytona_api_client-0.22.0a5.dist-info}/WHEEL +0 -0
  43. {daytona_api_client-0.21.5a8.dist-info → daytona_api_client-0.22.0a5.dist-info}/licenses/LICENSE +0 -0
  44. {daytona_api_client-0.21.5a8.dist-info → daytona_api_client-0.22.0a5.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,103 @@
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 ProcessLogsResponse(BaseModel):
27
+ """
28
+ ProcessLogsResponse
29
+ """ # noqa: E501
30
+ process_name: StrictStr = Field(description="The name of the VNC process whose logs were retrieved", alias="processName")
31
+ logs: StrictStr = Field(description="The log output from the specified VNC process")
32
+ additional_properties: Dict[str, Any] = {}
33
+ __properties: ClassVar[List[str]] = ["processName", "logs"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ProcessLogsResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ * Fields in `self.additional_properties` are added to the output dict.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ "additional_properties",
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # puts key-value pairs in additional_properties in the top level
77
+ if self.additional_properties is not None:
78
+ for _key, _value in self.additional_properties.items():
79
+ _dict[_key] = _value
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of ProcessLogsResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "processName": obj.get("processName"),
94
+ "logs": obj.get("logs")
95
+ })
96
+ # store additional fields in additional_properties
97
+ for _key in obj.keys():
98
+ if _key not in cls.__properties:
99
+ _obj.additional_properties[_key] = obj.get(_key)
100
+
101
+ return _obj
102
+
103
+
@@ -0,0 +1,103 @@
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 ProcessRestartResponse(BaseModel):
27
+ """
28
+ ProcessRestartResponse
29
+ """ # noqa: E501
30
+ message: StrictStr = Field(description="A message indicating the result of restarting the process")
31
+ process_name: StrictStr = Field(description="The name of the VNC process that was restarted", alias="processName")
32
+ additional_properties: Dict[str, Any] = {}
33
+ __properties: ClassVar[List[str]] = ["message", "processName"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ProcessRestartResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ * Fields in `self.additional_properties` are added to the output dict.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ "additional_properties",
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # puts key-value pairs in additional_properties in the top level
77
+ if self.additional_properties is not None:
78
+ for _key, _value in self.additional_properties.items():
79
+ _dict[_key] = _value
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of ProcessRestartResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "message": obj.get("message"),
94
+ "processName": obj.get("processName")
95
+ })
96
+ # store additional fields in additional_properties
97
+ for _key in obj.keys():
98
+ if _key not in cls.__properties:
99
+ _obj.additional_properties[_key] = obj.get(_key)
100
+
101
+ return _obj
102
+
103
+
@@ -0,0 +1,103 @@
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
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ProcessStatusResponse(BaseModel):
27
+ """
28
+ ProcessStatusResponse
29
+ """ # noqa: E501
30
+ process_name: StrictStr = Field(description="The name of the VNC process being checked", alias="processName")
31
+ running: StrictBool = Field(description="Whether the specified VNC process is currently running")
32
+ additional_properties: Dict[str, Any] = {}
33
+ __properties: ClassVar[List[str]] = ["processName", "running"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ProcessStatusResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ * Fields in `self.additional_properties` are added to the output dict.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ "additional_properties",
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # puts key-value pairs in additional_properties in the top level
77
+ if self.additional_properties is not None:
78
+ for _key, _value in self.additional_properties.items():
79
+ _dict[_key] = _value
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of ProcessStatusResponse from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "processName": obj.get("processName"),
94
+ "running": obj.get("running")
95
+ })
96
+ # store additional fields in additional_properties
97
+ for _key in obj.keys():
98
+ if _key not in cls.__properties:
99
+ _obj.additional_properties[_key] = obj.get(_key)
100
+
101
+ return _obj
102
+
103
+
@@ -0,0 +1,105 @@
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
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class RegionScreenshotResponse(BaseModel):
27
+ """
28
+ RegionScreenshotResponse
29
+ """ # noqa: E501
30
+ screenshot: StrictStr = Field(description="Base64 encoded screenshot image data of the specified region")
31
+ cursor_position: Optional[Dict[str, Any]] = Field(default=None, description="The current cursor position when the region screenshot was taken", alias="cursorPosition")
32
+ size_bytes: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The size of the screenshot data in bytes", alias="sizeBytes")
33
+ additional_properties: Dict[str, Any] = {}
34
+ __properties: ClassVar[List[str]] = ["screenshot", "cursorPosition", "sizeBytes"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of RegionScreenshotResponse from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ * Fields in `self.additional_properties` are added to the output dict.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ "additional_properties",
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # puts key-value pairs in additional_properties in the top level
78
+ if self.additional_properties is not None:
79
+ for _key, _value in self.additional_properties.items():
80
+ _dict[_key] = _value
81
+
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of RegionScreenshotResponse from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "screenshot": obj.get("screenshot"),
95
+ "cursorPosition": obj.get("cursorPosition"),
96
+ "sizeBytes": obj.get("sizeBytes")
97
+ })
98
+ # store additional fields in additional_properties
99
+ for _key in obj.keys():
100
+ if _key not in cls.__properties:
101
+ _obj.additional_properties[_key] = obj.get(_key)
102
+
103
+ return _obj
104
+
105
+
@@ -21,6 +21,7 @@ import json
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
23
23
  from daytona_api_client.models.build_info import BuildInfo
24
+ from daytona_api_client.models.sandbox_desired_state import SandboxDesiredState
24
25
  from daytona_api_client.models.sandbox_state import SandboxState
25
26
  from daytona_api_client.models.sandbox_volume import SandboxVolume
26
27
  from typing import Optional, Set
@@ -43,6 +44,7 @@ class Sandbox(BaseModel):
43
44
  memory: Union[StrictFloat, StrictInt] = Field(description="The memory quota for the sandbox")
44
45
  disk: Union[StrictFloat, StrictInt] = Field(description="The disk quota for the sandbox")
45
46
  state: Optional[SandboxState] = Field(default=None, description="The state of the sandbox")
47
+ desired_state: Optional[SandboxDesiredState] = Field(default=None, description="The desired state of the sandbox", alias="desiredState")
46
48
  error_reason: Optional[StrictStr] = Field(default=None, description="The error reason of the sandbox", alias="errorReason")
47
49
  backup_state: Optional[StrictStr] = Field(default=None, description="The state of the backup", alias="backupState")
48
50
  backup_created_at: Optional[StrictStr] = Field(default=None, description="The creation timestamp of the last backup", alias="backupCreatedAt")
@@ -56,7 +58,7 @@ class Sandbox(BaseModel):
56
58
  var_class: Optional[StrictStr] = Field(default=None, description="The class of the sandbox", alias="class")
57
59
  daemon_version: Optional[StrictStr] = Field(default=None, description="The version of the daemon running in the sandbox", alias="daemonVersion")
58
60
  additional_properties: Dict[str, Any] = {}
59
- __properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion"]
61
+ __properties: ClassVar[List[str]] = ["id", "organizationId", "snapshot", "user", "env", "labels", "public", "target", "cpu", "gpu", "memory", "disk", "state", "desiredState", "errorReason", "backupState", "backupCreatedAt", "autoStopInterval", "autoArchiveInterval", "runnerDomain", "volumes", "buildInfo", "createdAt", "updatedAt", "class", "daemonVersion"]
60
62
 
61
63
  @field_validator('backup_state')
62
64
  def backup_state_validate_enum(cls, value):
@@ -159,6 +161,7 @@ class Sandbox(BaseModel):
159
161
  "memory": obj.get("memory"),
160
162
  "disk": obj.get("disk"),
161
163
  "state": obj.get("state"),
164
+ "desiredState": obj.get("desiredState"),
162
165
  "errorReason": obj.get("errorReason"),
163
166
  "backupState": obj.get("backupState"),
164
167
  "backupCreatedAt": obj.get("backupCreatedAt"),
@@ -0,0 +1,41 @@
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 json
18
+ from enum import Enum
19
+ from typing_extensions import Self
20
+
21
+
22
+ class SandboxDesiredState(str, Enum):
23
+ """
24
+ The desired state of the sandbox
25
+ """
26
+
27
+ """
28
+ allowed enum values
29
+ """
30
+ DESTROYED = 'destroyed'
31
+ STARTED = 'started'
32
+ STOPPED = 'stopped'
33
+ RESIZED = 'resized'
34
+ ARCHIVED = 'archived'
35
+
36
+ @classmethod
37
+ def from_json(cls, json_str: str) -> Self:
38
+ """Create an instance of SandboxDesiredState from a JSON string"""
39
+ return cls(json.loads(json_str))
40
+
41
+
@@ -0,0 +1,105 @@
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
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ScreenshotResponse(BaseModel):
27
+ """
28
+ ScreenshotResponse
29
+ """ # noqa: E501
30
+ screenshot: StrictStr = Field(description="Base64 encoded screenshot image data")
31
+ cursor_position: Optional[Dict[str, Any]] = Field(default=None, description="The current cursor position when the screenshot was taken", alias="cursorPosition")
32
+ size_bytes: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The size of the screenshot data in bytes", alias="sizeBytes")
33
+ additional_properties: Dict[str, Any] = {}
34
+ __properties: ClassVar[List[str]] = ["screenshot", "cursorPosition", "sizeBytes"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of ScreenshotResponse from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ * Fields in `self.additional_properties` are added to the output dict.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ "additional_properties",
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # puts key-value pairs in additional_properties in the top level
78
+ if self.additional_properties is not None:
79
+ for _key, _value in self.additional_properties.items():
80
+ _dict[_key] = _value
81
+
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of ScreenshotResponse from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "screenshot": obj.get("screenshot"),
95
+ "cursorPosition": obj.get("cursorPosition"),
96
+ "sizeBytes": obj.get("sizeBytes")
97
+ })
98
+ # store additional fields in additional_properties
99
+ for _key in obj.keys():
100
+ if _key not in cls.__properties:
101
+ _obj.additional_properties[_key] = obj.get(_key)
102
+
103
+ return _obj
104
+
105
+
@@ -34,6 +34,7 @@ class SnapshotState(str, Enum):
34
34
  PENDING_VALIDATION = 'pending_validation'
35
35
  VALIDATING = 'validating'
36
36
  ACTIVE = 'active'
37
+ INACTIVE = 'inactive'
37
38
  ERROR = 'error'
38
39
  BUILD_FAILED = 'build_failed'
39
40
  REMOVING = 'removing'