daytona_api_client 0.21.3a0__py3-none-any.whl → 0.21.5a0__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 (107) hide show
  1. daytona_api_client/api/__init__.py +1 -0
  2. daytona_api_client/api/api_keys_api.py +328 -171
  3. daytona_api_client/api/docker_registry_api.py +463 -239
  4. daytona_api_client/api/object_storage_api.py +63 -33
  5. daytona_api_client/api/organizations_api.py +1582 -612
  6. daytona_api_client/api/preview_api.py +175 -71
  7. daytona_api_client/api/runners_api.py +195 -67
  8. daytona_api_client/api/sandbox_api.py +909 -499
  9. daytona_api_client/api/snapshots_api.py +482 -253
  10. daytona_api_client/api/toolbox_api.py +2684 -1410
  11. daytona_api_client/api/users_api.py +526 -184
  12. daytona_api_client/api/volumes_api.py +332 -180
  13. daytona_api_client/api/workspace_api.py +909 -499
  14. daytona_api_client/api_client.py +192 -90
  15. daytona_api_client/api_response.py +3 -2
  16. daytona_api_client/configuration.py +52 -55
  17. daytona_api_client/exceptions.py +16 -15
  18. daytona_api_client/models/account_provider.py +11 -9
  19. daytona_api_client/models/api_key_list.py +21 -40
  20. daytona_api_client/models/api_key_response.py +19 -38
  21. daytona_api_client/models/build_info.py +15 -22
  22. daytona_api_client/models/command.py +13 -12
  23. daytona_api_client/models/completion_context.py +11 -11
  24. daytona_api_client/models/completion_item.py +17 -28
  25. daytona_api_client/models/completion_list.py +12 -17
  26. daytona_api_client/models/create_api_key.py +17 -32
  27. daytona_api_client/models/create_build_info.py +13 -17
  28. daytona_api_client/models/create_docker_registry.py +18 -21
  29. daytona_api_client/models/create_linked_account.py +11 -9
  30. daytona_api_client/models/create_organization.py +10 -9
  31. daytona_api_client/models/create_organization_invitation.py +17 -24
  32. daytona_api_client/models/create_organization_quota.py +19 -32
  33. daytona_api_client/models/create_organization_role.py +15 -28
  34. daytona_api_client/models/create_runner.py +26 -41
  35. daytona_api_client/models/create_sandbox.py +39 -76
  36. daytona_api_client/models/create_session_request.py +10 -9
  37. daytona_api_client/models/create_snapshot.py +22 -39
  38. daytona_api_client/models/create_user.py +19 -26
  39. daytona_api_client/models/create_volume.py +10 -9
  40. daytona_api_client/models/create_workspace.py +38 -73
  41. daytona_api_client/models/docker_registry.py +21 -33
  42. daytona_api_client/models/execute_request.py +13 -12
  43. daytona_api_client/models/execute_response.py +11 -9
  44. daytona_api_client/models/file_info.py +17 -20
  45. daytona_api_client/models/file_status.py +13 -16
  46. daytona_api_client/models/git_add_request.py +11 -9
  47. daytona_api_client/models/git_branch_request.py +11 -9
  48. daytona_api_client/models/git_checkout_request.py +11 -9
  49. daytona_api_client/models/git_clone_request.py +15 -18
  50. daytona_api_client/models/git_commit_info.py +14 -17
  51. daytona_api_client/models/git_commit_request.py +13 -16
  52. daytona_api_client/models/git_commit_response.py +10 -9
  53. daytona_api_client/models/git_delete_branch_request.py +11 -9
  54. daytona_api_client/models/git_repo_request.py +12 -11
  55. daytona_api_client/models/git_status.py +15 -20
  56. daytona_api_client/models/list_branch_response.py +10 -9
  57. daytona_api_client/models/lsp_completion_params.py +16 -19
  58. daytona_api_client/models/lsp_document_request.py +12 -11
  59. daytona_api_client/models/lsp_location.py +12 -12
  60. daytona_api_client/models/lsp_server_request.py +11 -9
  61. daytona_api_client/models/lsp_symbol.py +13 -16
  62. daytona_api_client/models/match.py +12 -9
  63. daytona_api_client/models/organization.py +20 -34
  64. daytona_api_client/models/organization_invitation.py +27 -44
  65. daytona_api_client/models/organization_role.py +21 -46
  66. daytona_api_client/models/organization_suspension.py +11 -9
  67. daytona_api_client/models/organization_user.py +22 -36
  68. daytona_api_client/models/paginated_snapshots_dto.py +14 -19
  69. daytona_api_client/models/port_preview_url.py +11 -9
  70. daytona_api_client/models/position.py +11 -9
  71. daytona_api_client/models/project_dir_response.py +10 -9
  72. daytona_api_client/models/range.py +13 -16
  73. daytona_api_client/models/registry_push_access_dto.py +15 -18
  74. daytona_api_client/models/replace_request.py +12 -11
  75. daytona_api_client/models/replace_result.py +12 -9
  76. daytona_api_client/models/sandbox.py +49 -95
  77. daytona_api_client/models/sandbox_info.py +13 -18
  78. daytona_api_client/models/sandbox_labels.py +10 -9
  79. daytona_api_client/models/sandbox_state.py +18 -16
  80. daytona_api_client/models/sandbox_volume.py +11 -9
  81. daytona_api_client/models/search_files_response.py +10 -9
  82. daytona_api_client/models/session.py +13 -18
  83. daytona_api_client/models/session_execute_request.py +14 -19
  84. daytona_api_client/models/session_execute_response.py +13 -14
  85. daytona_api_client/models/set_snapshot_general_status_dto.py +10 -9
  86. daytona_api_client/models/snapshot_dto.py +34 -58
  87. daytona_api_client/models/snapshot_state.py +12 -10
  88. daytona_api_client/models/storage_access_dto.py +16 -26
  89. daytona_api_client/models/toggle_state.py +10 -9
  90. daytona_api_client/models/update_assigned_organization_roles.py +10 -9
  91. daytona_api_client/models/update_docker_registry.py +12 -11
  92. daytona_api_client/models/update_organization_invitation.py +15 -16
  93. daytona_api_client/models/update_organization_member_role.py +12 -11
  94. daytona_api_client/models/update_organization_quota.py +28 -41
  95. daytona_api_client/models/update_organization_role.py +15 -28
  96. daytona_api_client/models/usage_overview.py +17 -28
  97. daytona_api_client/models/user.py +14 -19
  98. daytona_api_client/models/user_public_key.py +11 -9
  99. daytona_api_client/models/volume_dto.py +20 -32
  100. daytona_api_client/models/volume_state.py +9 -7
  101. daytona_api_client/models/workspace.py +58 -113
  102. daytona_api_client/rest.py +77 -26
  103. {daytona_api_client-0.21.3a0.dist-info → daytona_api_client-0.21.5a0.dist-info}/METADATA +1 -1
  104. daytona_api_client-0.21.5a0.dist-info/RECORD +117 -0
  105. daytona_api_client-0.21.3a0.dist-info/RECORD +0 -117
  106. {daytona_api_client-0.21.3a0.dist-info → daytona_api_client-0.21.5a0.dist-info}/WHEEL +0 -0
  107. {daytona_api_client-0.21.3a0.dist-info → daytona_api_client-0.21.5a0.dist-info}/top_level.txt +0 -0
@@ -26,16 +26,9 @@ import urllib3
26
26
 
27
27
 
28
28
  JSON_SCHEMA_VALIDATION_KEYWORDS = {
29
- "multipleOf",
30
- "maximum",
31
- "exclusiveMaximum",
32
- "minimum",
33
- "exclusiveMinimum",
34
- "maxLength",
35
- "minLength",
36
- "pattern",
37
- "maxItems",
38
- "minItems",
29
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
30
+ 'minimum', 'exclusiveMinimum', 'maxLength',
31
+ 'minLength', 'pattern', 'maxItems', 'minItems'
39
32
  }
40
33
 
41
34
  ServerVariablesT = Dict[str, str]
@@ -179,24 +172,25 @@ class Configuration:
179
172
 
180
173
  def __init__(
181
174
  self,
182
- host: Optional[str] = None,
183
- api_key: Optional[Dict[str, str]] = None,
184
- api_key_prefix: Optional[Dict[str, str]] = None,
185
- username: Optional[str] = None,
186
- password: Optional[str] = None,
187
- access_token: Optional[str] = None,
188
- server_index: Optional[int] = None,
189
- server_variables: Optional[ServerVariablesT] = None,
190
- server_operation_index: Optional[Dict[int, int]] = None,
191
- server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None,
192
- ignore_operation_servers: bool = False,
193
- ssl_ca_cert: Optional[str] = None,
175
+ host: Optional[str]=None,
176
+ api_key: Optional[Dict[str, str]]=None,
177
+ api_key_prefix: Optional[Dict[str, str]]=None,
178
+ username: Optional[str]=None,
179
+ password: Optional[str]=None,
180
+ access_token: Optional[str]=None,
181
+ server_index: Optional[int]=None,
182
+ server_variables: Optional[ServerVariablesT]=None,
183
+ server_operation_index: Optional[Dict[int, int]]=None,
184
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
185
+ ignore_operation_servers: bool=False,
186
+ ssl_ca_cert: Optional[str]=None,
194
187
  retries: Optional[int] = None,
195
188
  ca_cert_data: Optional[Union[str, bytes]] = None,
196
189
  *,
197
190
  debug: Optional[bool] = None,
198
191
  ) -> None:
199
- """Constructor"""
192
+ """Constructor
193
+ """
200
194
  self._base_path = "http://localhost:3000" if host is None else host
201
195
  """Default Base url
202
196
  """
@@ -242,7 +236,7 @@ class Configuration:
242
236
  """
243
237
  self.logger["package_logger"] = logging.getLogger("daytona_api_client")
244
238
  self.logger["urllib3_logger"] = logging.getLogger("urllib3")
245
- self.logger_format = "%(asctime)s %(levelname)s %(message)s"
239
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
246
240
  """Log format
247
241
  """
248
242
  self.logger_stream_handler = None
@@ -301,7 +295,7 @@ class Configuration:
301
295
  self.proxy_headers = None
302
296
  """Proxy headers
303
297
  """
304
- self.safe_chars_for_path_param = ""
298
+ self.safe_chars_for_path_param = ''
305
299
  """Safe chars for path_param
306
300
  """
307
301
  self.retries = retries
@@ -322,12 +316,12 @@ class Configuration:
322
316
  """date format
323
317
  """
324
318
 
325
- def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
319
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
326
320
  cls = self.__class__
327
321
  result = cls.__new__(cls)
328
322
  memo[id(self)] = result
329
323
  for k, v in self.__dict__.items():
330
- if k not in ("logger", "logger_file_handler"):
324
+ if k not in ('logger', 'logger_file_handler'):
331
325
  setattr(result, k, copy.deepcopy(v, memo))
332
326
  # shallow copy of loggers
333
327
  result.logger = copy.copy(self.logger)
@@ -459,7 +453,7 @@ class Configuration:
459
453
  self.__logger_format = value
460
454
  self.logger_formatter = logging.Formatter(self.__logger_format)
461
455
 
462
- def get_api_key_with_prefix(self, identifier: str, alias: Optional[str] = None) -> Optional[str]:
456
+ def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
463
457
  """Gets API key (with prefix if set).
464
458
 
465
459
  :param identifier: The identifier of apiKey.
@@ -489,21 +483,23 @@ class Configuration:
489
483
  password = ""
490
484
  if self.password is not None:
491
485
  password = self.password
492
- return urllib3.util.make_headers(basic_auth=username + ":" + password).get("authorization")
486
+ return urllib3.util.make_headers(
487
+ basic_auth=username + ':' + password
488
+ ).get('authorization')
493
489
 
494
- def auth_settings(self) -> AuthSettings:
490
+ def auth_settings(self)-> AuthSettings:
495
491
  """Gets Auth Settings dict for api client.
496
492
 
497
493
  :return: The Auth Settings information dict.
498
494
  """
499
495
  auth: AuthSettings = {}
500
496
  if self.access_token is not None:
501
- auth["bearer"] = {
502
- "type": "bearer",
503
- "in": "header",
504
- "format": "JWT",
505
- "key": "Authorization",
506
- "value": "Bearer " + self.access_token,
497
+ auth['bearer'] = {
498
+ 'type': 'bearer',
499
+ 'in': 'header',
500
+ 'format': 'JWT',
501
+ 'key': 'Authorization',
502
+ 'value': 'Bearer ' + self.access_token
507
503
  }
508
504
  return auth
509
505
 
@@ -512,13 +508,12 @@ class Configuration:
512
508
 
513
509
  :return: The report for debugging.
514
510
  """
515
- return (
516
- "Python SDK Debug Report:\n"
517
- "OS: {env}\n"
518
- "Python Version: {pyversion}\n"
519
- "Version of the API: 1.0\n"
520
- "SDK Package Version: 0.0.0-dev".format(env=sys.platform, pyversion=sys.version)
521
- )
511
+ return "Python SDK Debug Report:\n"\
512
+ "OS: {env}\n"\
513
+ "Python Version: {pyversion}\n"\
514
+ "Version of the API: 1.0\n"\
515
+ "SDK Package Version: 0.0.0-dev".\
516
+ format(env=sys.platform, pyversion=sys.version)
522
517
 
523
518
  def get_host_settings(self) -> List[HostSetting]:
524
519
  """Gets an array of host settings
@@ -527,16 +522,16 @@ class Configuration:
527
522
  """
528
523
  return [
529
524
  {
530
- "url": "http://localhost:3000",
531
- "description": "No description provided",
525
+ 'url': "http://localhost:3000",
526
+ 'description': "No description provided",
532
527
  }
533
528
  ]
534
529
 
535
530
  def get_host_from_settings(
536
531
  self,
537
532
  index: Optional[int],
538
- variables: Optional[ServerVariablesT] = None,
539
- servers: Optional[List[HostSetting]] = None,
533
+ variables: Optional[ServerVariablesT]=None,
534
+ servers: Optional[List[HostSetting]]=None,
540
535
  ) -> str:
541
536
  """Gets host URL based on the index and variables
542
537
  :param index: array index of the host settings
@@ -555,20 +550,22 @@ class Configuration:
555
550
  except IndexError:
556
551
  raise ValueError(
557
552
  "Invalid index {0} when selecting the host settings. "
558
- "Must be less than {1}".format(index, len(servers))
559
- )
553
+ "Must be less than {1}".format(index, len(servers)))
560
554
 
561
- url = server["url"]
555
+ url = server['url']
562
556
 
563
557
  # go through variables and replace placeholders
564
- for variable_name, variable in server.get("variables", {}).items():
565
- used_value = variables.get(variable_name, variable["default_value"])
558
+ for variable_name, variable in server.get('variables', {}).items():
559
+ used_value = variables.get(
560
+ variable_name, variable['default_value'])
566
561
 
567
- if "enum_values" in variable and used_value not in variable["enum_values"]:
562
+ if 'enum_values' in variable \
563
+ and used_value not in variable['enum_values']:
568
564
  raise ValueError(
569
565
  "The variable `{0}` in the host URL has invalid value "
570
- "{1}. Must be {2}.".format(variable_name, variables[variable_name], variable["enum_values"])
571
- )
566
+ "{1}. Must be {2}.".format(
567
+ variable_name, variables[variable_name],
568
+ variable['enum_values']))
572
569
 
573
570
  url = url.replace("{" + variable_name + "}", used_value)
574
571
 
@@ -15,14 +15,14 @@
15
15
  from typing import Any, Optional
16
16
  from typing_extensions import Self
17
17
 
18
-
19
18
  class OpenApiException(Exception):
20
19
  """The base exception class for all OpenAPIExceptions"""
21
20
 
22
21
 
23
22
  class ApiTypeError(OpenApiException, TypeError):
24
- def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> None:
25
- """Raises an exception for TypeErrors
23
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
24
+ key_type=None) -> None:
25
+ """ Raises an exception for TypeErrors
26
26
 
27
27
  Args:
28
28
  msg (str): the exception message
@@ -103,10 +103,11 @@ class ApiKeyError(OpenApiException, KeyError):
103
103
 
104
104
 
105
105
  class ApiException(OpenApiException):
106
+
106
107
  def __init__(
107
- self,
108
- status=None,
109
- reason=None,
108
+ self,
109
+ status=None,
110
+ reason=None,
110
111
  http_resp=None,
111
112
  *,
112
113
  body: Optional[str] = None,
@@ -125,17 +126,17 @@ class ApiException(OpenApiException):
125
126
  self.reason = http_resp.reason
126
127
  if self.body is None:
127
128
  try:
128
- self.body = http_resp.data.decode("utf-8")
129
+ self.body = http_resp.data.decode('utf-8')
129
130
  except Exception:
130
131
  pass
131
132
  self.headers = http_resp.getheaders()
132
133
 
133
134
  @classmethod
134
135
  def from_response(
135
- cls,
136
- *,
137
- http_resp,
138
- body: Optional[str],
136
+ cls,
137
+ *,
138
+ http_resp,
139
+ body: Optional[str],
139
140
  data: Optional[Any],
140
141
  ) -> Self:
141
142
  if http_resp.status == 400:
@@ -163,9 +164,11 @@ class ApiException(OpenApiException):
163
164
 
164
165
  def __str__(self):
165
166
  """Custom error messages for exception"""
166
- error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason)
167
+ error_message = "({0})\n"\
168
+ "Reason: {1}\n".format(self.status, self.reason)
167
169
  if self.headers:
168
- error_message += "HTTP response headers: {0}\n".format(self.headers)
170
+ error_message += "HTTP response headers: {0}\n".format(
171
+ self.headers)
169
172
 
170
173
  if self.data or self.body:
171
174
  error_message += "HTTP response body: {0}\n".format(self.data or self.body)
@@ -195,13 +198,11 @@ class ServiceException(ApiException):
195
198
 
196
199
  class ConflictException(ApiException):
197
200
  """Exception for HTTP 409 Conflict."""
198
-
199
201
  pass
200
202
 
201
203
 
202
204
  class UnprocessableEntityException(ApiException):
203
205
  """Exception for HTTP 422 Unprocessable Entity."""
204
-
205
206
  pass
206
207
 
207
208
 
@@ -23,12 +23,10 @@ from typing import Any, ClassVar, Dict, List
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
26
-
27
26
  class AccountProvider(BaseModel):
28
27
  """
29
28
  AccountProvider
30
- """ # noqa: E501
31
-
29
+ """ # noqa: E501
32
30
  name: StrictStr
33
31
  display_name: StrictStr = Field(alias="displayName")
34
32
  additional_properties: Dict[str, Any] = {}
@@ -40,6 +38,7 @@ class AccountProvider(BaseModel):
40
38
  protected_namespaces=(),
41
39
  )
42
40
 
41
+
43
42
  def to_str(self) -> str:
44
43
  """Returns the string representation of the model using alias"""
45
44
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -65,11 +64,9 @@ class AccountProvider(BaseModel):
65
64
  are ignored.
66
65
  * Fields in `self.additional_properties` are added to the output dict.
67
66
  """
68
- excluded_fields: Set[str] = set(
69
- [
70
- "additional_properties",
71
- ]
72
- )
67
+ excluded_fields: Set[str] = set([
68
+ "additional_properties",
69
+ ])
73
70
 
74
71
  _dict = self.model_dump(
75
72
  by_alias=True,
@@ -92,10 +89,15 @@ class AccountProvider(BaseModel):
92
89
  if not isinstance(obj, dict):
93
90
  return cls.model_validate(obj)
94
91
 
95
- _obj = cls.model_validate({"name": obj.get("name"), "displayName": obj.get("displayName")})
92
+ _obj = cls.model_validate({
93
+ "name": obj.get("name"),
94
+ "displayName": obj.get("displayName")
95
+ })
96
96
  # store additional fields in additional_properties
97
97
  for _key in obj.keys():
98
98
  if _key not in cls.__properties:
99
99
  _obj.additional_properties[_key] = obj.get(_key)
100
100
 
101
101
  return _obj
102
+
103
+
@@ -24,43 +24,25 @@ from typing import Any, ClassVar, Dict, List, Optional
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
-
28
27
  class ApiKeyList(BaseModel):
29
28
  """
30
29
  ApiKeyList
31
- """ # noqa: E501
32
-
30
+ """ # noqa: E501
33
31
  name: StrictStr = Field(description="The name of the API key")
34
32
  value: StrictStr = Field(description="The masked API key value")
35
33
  created_at: datetime = Field(description="When the API key was created", alias="createdAt")
36
- permissions: List[StrictStr] = Field(
37
- description="The list of organization resource permissions assigned to the API key"
38
- )
34
+ permissions: List[StrictStr] = Field(description="The list of organization resource permissions assigned to the API key")
39
35
  last_used_at: Optional[datetime] = Field(description="When the API key was last used", alias="lastUsedAt")
40
36
  expires_at: Optional[datetime] = Field(description="When the API key expires", alias="expiresAt")
41
37
  additional_properties: Dict[str, Any] = {}
42
38
  __properties: ClassVar[List[str]] = ["name", "value", "createdAt", "permissions", "lastUsedAt", "expiresAt"]
43
39
 
44
- @field_validator("permissions")
40
+ @field_validator('permissions')
45
41
  def permissions_validate_enum(cls, value):
46
42
  """Validates the enum"""
47
43
  for i in value:
48
- if i not in set(
49
- [
50
- "write:registries",
51
- "delete:registries",
52
- "write:snapshots",
53
- "delete:snapshots",
54
- "write:sandboxes",
55
- "delete:sandboxes",
56
- "read:volumes",
57
- "write:volumes",
58
- "delete:volumes",
59
- ]
60
- ):
61
- raise ValueError(
62
- "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')"
63
- )
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')")
64
46
  return value
65
47
 
66
48
  model_config = ConfigDict(
@@ -69,6 +51,7 @@ class ApiKeyList(BaseModel):
69
51
  protected_namespaces=(),
70
52
  )
71
53
 
54
+
72
55
  def to_str(self) -> str:
73
56
  """Returns the string representation of the model using alias"""
74
57
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -94,11 +77,9 @@ class ApiKeyList(BaseModel):
94
77
  are ignored.
95
78
  * Fields in `self.additional_properties` are added to the output dict.
96
79
  """
97
- excluded_fields: Set[str] = set(
98
- [
99
- "additional_properties",
100
- ]
101
- )
80
+ excluded_fields: Set[str] = set([
81
+ "additional_properties",
82
+ ])
102
83
 
103
84
  _dict = self.model_dump(
104
85
  by_alias=True,
@@ -113,12 +94,12 @@ class ApiKeyList(BaseModel):
113
94
  # set to None if last_used_at (nullable) is None
114
95
  # and model_fields_set contains the field
115
96
  if self.last_used_at is None and "last_used_at" in self.model_fields_set:
116
- _dict["lastUsedAt"] = None
97
+ _dict['lastUsedAt'] = None
117
98
 
118
99
  # set to None if expires_at (nullable) is None
119
100
  # and model_fields_set contains the field
120
101
  if self.expires_at is None and "expires_at" in self.model_fields_set:
121
- _dict["expiresAt"] = None
102
+ _dict['expiresAt'] = None
122
103
 
123
104
  return _dict
124
105
 
@@ -131,19 +112,19 @@ class ApiKeyList(BaseModel):
131
112
  if not isinstance(obj, dict):
132
113
  return cls.model_validate(obj)
133
114
 
134
- _obj = cls.model_validate(
135
- {
136
- "name": obj.get("name"),
137
- "value": obj.get("value"),
138
- "createdAt": obj.get("createdAt"),
139
- "permissions": obj.get("permissions"),
140
- "lastUsedAt": obj.get("lastUsedAt"),
141
- "expiresAt": obj.get("expiresAt"),
142
- }
143
- )
115
+ _obj = cls.model_validate({
116
+ "name": obj.get("name"),
117
+ "value": obj.get("value"),
118
+ "createdAt": obj.get("createdAt"),
119
+ "permissions": obj.get("permissions"),
120
+ "lastUsedAt": obj.get("lastUsedAt"),
121
+ "expiresAt": obj.get("expiresAt")
122
+ })
144
123
  # store additional fields in additional_properties
145
124
  for _key in obj.keys():
146
125
  if _key not in cls.__properties:
147
126
  _obj.additional_properties[_key] = obj.get(_key)
148
127
 
149
128
  return _obj
129
+
130
+
@@ -24,42 +24,24 @@ from typing import Any, ClassVar, Dict, List, Optional
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
-
28
27
  class ApiKeyResponse(BaseModel):
29
28
  """
30
29
  ApiKeyResponse
31
- """ # noqa: E501
32
-
30
+ """ # noqa: E501
33
31
  name: StrictStr = Field(description="The name of the API key")
34
32
  value: StrictStr = Field(description="The API key value")
35
33
  created_at: datetime = Field(description="When the API key was created", alias="createdAt")
36
- permissions: List[StrictStr] = Field(
37
- description="The list of organization resource permissions assigned to the API key"
38
- )
34
+ permissions: List[StrictStr] = Field(description="The list of organization resource permissions assigned to the API key")
39
35
  expires_at: Optional[datetime] = Field(description="When the API key expires", alias="expiresAt")
40
36
  additional_properties: Dict[str, Any] = {}
41
37
  __properties: ClassVar[List[str]] = ["name", "value", "createdAt", "permissions", "expiresAt"]
42
38
 
43
- @field_validator("permissions")
39
+ @field_validator('permissions')
44
40
  def permissions_validate_enum(cls, value):
45
41
  """Validates the enum"""
46
42
  for i in value:
47
- if i not in set(
48
- [
49
- "write:registries",
50
- "delete:registries",
51
- "write:snapshots",
52
- "delete:snapshots",
53
- "write:sandboxes",
54
- "delete:sandboxes",
55
- "read:volumes",
56
- "write:volumes",
57
- "delete:volumes",
58
- ]
59
- ):
60
- raise ValueError(
61
- "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')"
62
- )
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')")
63
45
  return value
64
46
 
65
47
  model_config = ConfigDict(
@@ -68,6 +50,7 @@ class ApiKeyResponse(BaseModel):
68
50
  protected_namespaces=(),
69
51
  )
70
52
 
53
+
71
54
  def to_str(self) -> str:
72
55
  """Returns the string representation of the model using alias"""
73
56
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -93,11 +76,9 @@ class ApiKeyResponse(BaseModel):
93
76
  are ignored.
94
77
  * Fields in `self.additional_properties` are added to the output dict.
95
78
  """
96
- excluded_fields: Set[str] = set(
97
- [
98
- "additional_properties",
99
- ]
100
- )
79
+ excluded_fields: Set[str] = set([
80
+ "additional_properties",
81
+ ])
101
82
 
102
83
  _dict = self.model_dump(
103
84
  by_alias=True,
@@ -112,7 +93,7 @@ class ApiKeyResponse(BaseModel):
112
93
  # set to None if expires_at (nullable) is None
113
94
  # and model_fields_set contains the field
114
95
  if self.expires_at is None and "expires_at" in self.model_fields_set:
115
- _dict["expiresAt"] = None
96
+ _dict['expiresAt'] = None
116
97
 
117
98
  return _dict
118
99
 
@@ -125,18 +106,18 @@ class ApiKeyResponse(BaseModel):
125
106
  if not isinstance(obj, dict):
126
107
  return cls.model_validate(obj)
127
108
 
128
- _obj = cls.model_validate(
129
- {
130
- "name": obj.get("name"),
131
- "value": obj.get("value"),
132
- "createdAt": obj.get("createdAt"),
133
- "permissions": obj.get("permissions"),
134
- "expiresAt": obj.get("expiresAt"),
135
- }
136
- )
109
+ _obj = cls.model_validate({
110
+ "name": obj.get("name"),
111
+ "value": obj.get("value"),
112
+ "createdAt": obj.get("createdAt"),
113
+ "permissions": obj.get("permissions"),
114
+ "expiresAt": obj.get("expiresAt")
115
+ })
137
116
  # store additional fields in additional_properties
138
117
  for _key in obj.keys():
139
118
  if _key not in cls.__properties:
140
119
  _obj.additional_properties[_key] = obj.get(_key)
141
120
 
142
121
  return _obj
122
+
123
+
@@ -24,18 +24,12 @@ from typing import Any, ClassVar, Dict, List, Optional
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
-
28
27
  class BuildInfo(BaseModel):
29
28
  """
30
29
  BuildInfo
31
- """ # noqa: E501
32
-
33
- dockerfile_content: Optional[StrictStr] = Field(
34
- default=None, description="The Dockerfile content used for the build", alias="dockerfileContent"
35
- )
36
- context_hashes: Optional[List[StrictStr]] = Field(
37
- default=None, description="The context hashes used for the build", alias="contextHashes"
38
- )
30
+ """ # noqa: E501
31
+ dockerfile_content: Optional[StrictStr] = Field(default=None, description="The Dockerfile content used for the build", alias="dockerfileContent")
32
+ context_hashes: Optional[List[StrictStr]] = Field(default=None, description="The context hashes used for the build", alias="contextHashes")
39
33
  created_at: datetime = Field(description="The creation timestamp", alias="createdAt")
40
34
  updated_at: datetime = Field(description="The last update timestamp", alias="updatedAt")
41
35
  additional_properties: Dict[str, Any] = {}
@@ -47,6 +41,7 @@ class BuildInfo(BaseModel):
47
41
  protected_namespaces=(),
48
42
  )
49
43
 
44
+
50
45
  def to_str(self) -> str:
51
46
  """Returns the string representation of the model using alias"""
52
47
  return pprint.pformat(self.model_dump(by_alias=True))
@@ -72,11 +67,9 @@ class BuildInfo(BaseModel):
72
67
  are ignored.
73
68
  * Fields in `self.additional_properties` are added to the output dict.
74
69
  """
75
- excluded_fields: Set[str] = set(
76
- [
77
- "additional_properties",
78
- ]
79
- )
70
+ excluded_fields: Set[str] = set([
71
+ "additional_properties",
72
+ ])
80
73
 
81
74
  _dict = self.model_dump(
82
75
  by_alias=True,
@@ -99,17 +92,17 @@ class BuildInfo(BaseModel):
99
92
  if not isinstance(obj, dict):
100
93
  return cls.model_validate(obj)
101
94
 
102
- _obj = cls.model_validate(
103
- {
104
- "dockerfileContent": obj.get("dockerfileContent"),
105
- "contextHashes": obj.get("contextHashes"),
106
- "createdAt": obj.get("createdAt"),
107
- "updatedAt": obj.get("updatedAt"),
108
- }
109
- )
95
+ _obj = cls.model_validate({
96
+ "dockerfileContent": obj.get("dockerfileContent"),
97
+ "contextHashes": obj.get("contextHashes"),
98
+ "createdAt": obj.get("createdAt"),
99
+ "updatedAt": obj.get("updatedAt")
100
+ })
110
101
  # store additional fields in additional_properties
111
102
  for _key in obj.keys():
112
103
  if _key not in cls.__properties:
113
104
  _obj.additional_properties[_key] = obj.get(_key)
114
105
 
115
106
  return _obj
107
+
108
+