daytona_api_client_async 0.27.0rc1__py3-none-any.whl → 0.28.0rc1__py3-none-any.whl

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

Potentially problematic release.


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

@@ -60,6 +60,9 @@ from daytona_api_client_async.models.git_commit_response import GitCommitRespons
60
60
  from daytona_api_client_async.models.git_delete_branch_request import GitDeleteBranchRequest
61
61
  from daytona_api_client_async.models.git_repo_request import GitRepoRequest
62
62
  from daytona_api_client_async.models.git_status import GitStatus
63
+ from daytona_api_client_async.models.health_controller_check200_response import HealthControllerCheck200Response
64
+ from daytona_api_client_async.models.health_controller_check200_response_info_value import HealthControllerCheck200ResponseInfoValue
65
+ from daytona_api_client_async.models.health_controller_check503_response import HealthControllerCheck503Response
63
66
  from daytona_api_client_async.models.keyboard_hotkey_request import KeyboardHotkeyRequest
64
67
  from daytona_api_client_async.models.keyboard_press_request import KeyboardPressRequest
65
68
  from daytona_api_client_async.models.keyboard_type_request import KeyboardTypeRequest
@@ -128,6 +131,7 @@ from daytona_api_client_async.models.update_organization_member_role import Upda
128
131
  from daytona_api_client_async.models.update_organization_quota import UpdateOrganizationQuota
129
132
  from daytona_api_client_async.models.update_organization_role import UpdateOrganizationRole
130
133
  from daytona_api_client_async.models.user import User
134
+ from daytona_api_client_async.models.user_home_dir_response import UserHomeDirResponse
131
135
  from daytona_api_client_async.models.user_public_key import UserPublicKey
132
136
  from daytona_api_client_async.models.volume_dto import VolumeDto
133
137
  from daytona_api_client_async.models.volume_state import VolumeState
@@ -135,4 +139,5 @@ from daytona_api_client_async.models.webhook_app_portal_access import WebhookApp
135
139
  from daytona_api_client_async.models.webhook_controller_get_status200_response import WebhookControllerGetStatus200Response
136
140
  from daytona_api_client_async.models.webhook_initialization_status import WebhookInitializationStatus
137
141
  from daytona_api_client_async.models.windows_response import WindowsResponse
142
+ from daytona_api_client_async.models.work_dir_response import WorkDirResponse
138
143
  from daytona_api_client_async.models.workspace import Workspace
@@ -34,8 +34,9 @@ class ApiKeyList(BaseModel):
34
34
  permissions: List[StrictStr] = Field(description="The list of organization resource permissions assigned to the API key")
35
35
  last_used_at: Optional[datetime] = Field(description="When the API key was last used", alias="lastUsedAt")
36
36
  expires_at: Optional[datetime] = Field(description="When the API key expires", alias="expiresAt")
37
+ user_id: StrictStr = Field(description="The user ID of the user who created the API key", alias="userId")
37
38
  additional_properties: Dict[str, Any] = {}
38
- __properties: ClassVar[List[str]] = ["name", "value", "createdAt", "permissions", "lastUsedAt", "expiresAt"]
39
+ __properties: ClassVar[List[str]] = ["name", "value", "createdAt", "permissions", "lastUsedAt", "expiresAt", "userId"]
39
40
 
40
41
  @field_validator('permissions')
41
42
  def permissions_validate_enum(cls, value):
@@ -118,7 +119,8 @@ class ApiKeyList(BaseModel):
118
119
  "createdAt": obj.get("createdAt"),
119
120
  "permissions": obj.get("permissions"),
120
121
  "lastUsedAt": obj.get("lastUsedAt"),
121
- "expiresAt": obj.get("expiresAt")
122
+ "expiresAt": obj.get("expiresAt"),
123
+ "userId": obj.get("userId")
122
124
  })
123
125
  # store additional fields in additional_properties
124
126
  for _key in obj.keys():
@@ -0,0 +1,154 @@
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, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from daytona_api_client_async.models.health_controller_check200_response_info_value import HealthControllerCheck200ResponseInfoValue
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class HealthControllerCheck200Response(BaseModel):
28
+ """
29
+ HealthControllerCheck200Response
30
+ """ # noqa: E501
31
+ status: Optional[StrictStr] = None
32
+ info: Optional[Dict[str, HealthControllerCheck200ResponseInfoValue]] = None
33
+ error: Optional[Dict[str, HealthControllerCheck200ResponseInfoValue]] = None
34
+ details: Optional[Dict[str, HealthControllerCheck200ResponseInfoValue]] = None
35
+ additional_properties: Dict[str, Any] = {}
36
+ __properties: ClassVar[List[str]] = ["status", "info", "error", "details"]
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 HealthControllerCheck200Response 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 value in info (dict)
80
+ _field_dict = {}
81
+ if self.info:
82
+ for _key_info in self.info:
83
+ if self.info[_key_info]:
84
+ _field_dict[_key_info] = self.info[_key_info].to_dict()
85
+ _dict['info'] = _field_dict
86
+ # override the default output from pydantic by calling `to_dict()` of each value in error (dict)
87
+ _field_dict = {}
88
+ if self.error:
89
+ for _key_error in self.error:
90
+ if self.error[_key_error]:
91
+ _field_dict[_key_error] = self.error[_key_error].to_dict()
92
+ _dict['error'] = _field_dict
93
+ # override the default output from pydantic by calling `to_dict()` of each value in details (dict)
94
+ _field_dict = {}
95
+ if self.details:
96
+ for _key_details in self.details:
97
+ if self.details[_key_details]:
98
+ _field_dict[_key_details] = self.details[_key_details].to_dict()
99
+ _dict['details'] = _field_dict
100
+ # puts key-value pairs in additional_properties in the top level
101
+ if self.additional_properties is not None:
102
+ for _key, _value in self.additional_properties.items():
103
+ _dict[_key] = _value
104
+
105
+ # set to None if info (nullable) is None
106
+ # and model_fields_set contains the field
107
+ if self.info is None and "info" in self.model_fields_set:
108
+ _dict['info'] = None
109
+
110
+ # set to None if error (nullable) is None
111
+ # and model_fields_set contains the field
112
+ if self.error is None and "error" in self.model_fields_set:
113
+ _dict['error'] = None
114
+
115
+ return _dict
116
+
117
+ @classmethod
118
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
119
+ """Create an instance of HealthControllerCheck200Response from a dict"""
120
+ if obj is None:
121
+ return None
122
+
123
+ if not isinstance(obj, dict):
124
+ return cls.model_validate(obj)
125
+
126
+ _obj = cls.model_validate({
127
+ "status": obj.get("status"),
128
+ "info": dict(
129
+ (_k, HealthControllerCheck200ResponseInfoValue.from_dict(_v))
130
+ for _k, _v in obj["info"].items()
131
+ )
132
+ if obj.get("info") is not None
133
+ else None,
134
+ "error": dict(
135
+ (_k, HealthControllerCheck200ResponseInfoValue.from_dict(_v))
136
+ for _k, _v in obj["error"].items()
137
+ )
138
+ if obj.get("error") is not None
139
+ else None,
140
+ "details": dict(
141
+ (_k, HealthControllerCheck200ResponseInfoValue.from_dict(_v))
142
+ for _k, _v in obj["details"].items()
143
+ )
144
+ if obj.get("details") is not None
145
+ else None
146
+ })
147
+ # store additional fields in additional_properties
148
+ for _key in obj.keys():
149
+ if _key not in cls.__properties:
150
+ _obj.additional_properties[_key] = obj.get(_key)
151
+
152
+ return _obj
153
+
154
+
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Daytona
5
+
6
+ Daytona AI platform API Docs
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: support@daytona.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class HealthControllerCheck200ResponseInfoValue(BaseModel):
27
+ """
28
+ HealthControllerCheck200ResponseInfoValue
29
+ """ # noqa: E501
30
+ status: StrictStr
31
+ additional_properties: Dict[str, Any] = {}
32
+ __properties: ClassVar[List[str]] = ["status"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of HealthControllerCheck200ResponseInfoValue from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ * Fields in `self.additional_properties` are added to the output dict.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ "additional_properties",
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # puts key-value pairs in additional_properties in the top level
76
+ if self.additional_properties is not None:
77
+ for _key, _value in self.additional_properties.items():
78
+ _dict[_key] = _value
79
+
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of HealthControllerCheck200ResponseInfoValue from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "status": obj.get("status")
93
+ })
94
+ # store additional fields in additional_properties
95
+ for _key in obj.keys():
96
+ if _key not in cls.__properties:
97
+ _obj.additional_properties[_key] = obj.get(_key)
98
+
99
+ return _obj
100
+
101
+
@@ -0,0 +1,154 @@
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, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from daytona_api_client_async.models.health_controller_check200_response_info_value import HealthControllerCheck200ResponseInfoValue
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class HealthControllerCheck503Response(BaseModel):
28
+ """
29
+ HealthControllerCheck503Response
30
+ """ # noqa: E501
31
+ status: Optional[StrictStr] = None
32
+ info: Optional[Dict[str, HealthControllerCheck200ResponseInfoValue]] = None
33
+ error: Optional[Dict[str, HealthControllerCheck200ResponseInfoValue]] = None
34
+ details: Optional[Dict[str, HealthControllerCheck200ResponseInfoValue]] = None
35
+ additional_properties: Dict[str, Any] = {}
36
+ __properties: ClassVar[List[str]] = ["status", "info", "error", "details"]
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 HealthControllerCheck503Response 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 value in info (dict)
80
+ _field_dict = {}
81
+ if self.info:
82
+ for _key_info in self.info:
83
+ if self.info[_key_info]:
84
+ _field_dict[_key_info] = self.info[_key_info].to_dict()
85
+ _dict['info'] = _field_dict
86
+ # override the default output from pydantic by calling `to_dict()` of each value in error (dict)
87
+ _field_dict = {}
88
+ if self.error:
89
+ for _key_error in self.error:
90
+ if self.error[_key_error]:
91
+ _field_dict[_key_error] = self.error[_key_error].to_dict()
92
+ _dict['error'] = _field_dict
93
+ # override the default output from pydantic by calling `to_dict()` of each value in details (dict)
94
+ _field_dict = {}
95
+ if self.details:
96
+ for _key_details in self.details:
97
+ if self.details[_key_details]:
98
+ _field_dict[_key_details] = self.details[_key_details].to_dict()
99
+ _dict['details'] = _field_dict
100
+ # puts key-value pairs in additional_properties in the top level
101
+ if self.additional_properties is not None:
102
+ for _key, _value in self.additional_properties.items():
103
+ _dict[_key] = _value
104
+
105
+ # set to None if info (nullable) is None
106
+ # and model_fields_set contains the field
107
+ if self.info is None and "info" in self.model_fields_set:
108
+ _dict['info'] = None
109
+
110
+ # set to None if error (nullable) is None
111
+ # and model_fields_set contains the field
112
+ if self.error is None and "error" in self.model_fields_set:
113
+ _dict['error'] = None
114
+
115
+ return _dict
116
+
117
+ @classmethod
118
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
119
+ """Create an instance of HealthControllerCheck503Response from a dict"""
120
+ if obj is None:
121
+ return None
122
+
123
+ if not isinstance(obj, dict):
124
+ return cls.model_validate(obj)
125
+
126
+ _obj = cls.model_validate({
127
+ "status": obj.get("status"),
128
+ "info": dict(
129
+ (_k, HealthControllerCheck200ResponseInfoValue.from_dict(_v))
130
+ for _k, _v in obj["info"].items()
131
+ )
132
+ if obj.get("info") is not None
133
+ else None,
134
+ "error": dict(
135
+ (_k, HealthControllerCheck200ResponseInfoValue.from_dict(_v))
136
+ for _k, _v in obj["error"].items()
137
+ )
138
+ if obj.get("error") is not None
139
+ else None,
140
+ "details": dict(
141
+ (_k, HealthControllerCheck200ResponseInfoValue.from_dict(_v))
142
+ for _k, _v in obj["details"].items()
143
+ )
144
+ if obj.get("details") is not None
145
+ else None
146
+ })
147
+ # store additional fields in additional_properties
148
+ for _key in obj.keys():
149
+ if _key not in cls.__properties:
150
+ _obj.additional_properties[_key] = obj.get(_key)
151
+
152
+ return _obj
153
+
154
+
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Daytona
5
+
6
+ Daytona AI platform API Docs
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: support@daytona.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class UserHomeDirResponse(BaseModel):
27
+ """
28
+ UserHomeDirResponse
29
+ """ # noqa: E501
30
+ dir: Optional[StrictStr] = None
31
+ additional_properties: Dict[str, Any] = {}
32
+ __properties: ClassVar[List[str]] = ["dir"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of UserHomeDirResponse from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ * Fields in `self.additional_properties` are added to the output dict.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ "additional_properties",
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # puts key-value pairs in additional_properties in the top level
76
+ if self.additional_properties is not None:
77
+ for _key, _value in self.additional_properties.items():
78
+ _dict[_key] = _value
79
+
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of UserHomeDirResponse from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "dir": obj.get("dir")
93
+ })
94
+ # store additional fields in additional_properties
95
+ for _key in obj.keys():
96
+ if _key not in cls.__properties:
97
+ _obj.additional_properties[_key] = obj.get(_key)
98
+
99
+ return _obj
100
+
101
+
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Daytona
5
+
6
+ Daytona AI platform API Docs
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: support@daytona.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class WorkDirResponse(BaseModel):
27
+ """
28
+ WorkDirResponse
29
+ """ # noqa: E501
30
+ dir: Optional[StrictStr] = None
31
+ additional_properties: Dict[str, Any] = {}
32
+ __properties: ClassVar[List[str]] = ["dir"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of WorkDirResponse from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ * Fields in `self.additional_properties` are added to the output dict.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ "additional_properties",
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # puts key-value pairs in additional_properties in the top level
76
+ if self.additional_properties is not None:
77
+ for _key, _value in self.additional_properties.items():
78
+ _dict[_key] = _value
79
+
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of WorkDirResponse from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "dir": obj.get("dir")
93
+ })
94
+ # store additional fields in additional_properties
95
+ for _key in obj.keys():
96
+ if _key not in cls.__properties:
97
+ _obj.additional_properties[_key] = obj.get(_key)
98
+
99
+ return _obj
100
+
101
+