stackit-sqlserverflex 1.1.2__py3-none-any.whl → 1.2.0__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.
Files changed (61) hide show
  1. stackit/sqlserverflex/api_client.py +15 -17
  2. stackit/sqlserverflex/models/acl.py +4 -3
  3. stackit/sqlserverflex/models/backup.py +4 -3
  4. stackit/sqlserverflex/models/backup_list_backups_response_grouped.py +4 -3
  5. stackit/sqlserverflex/models/create_database_payload.py +4 -3
  6. stackit/sqlserverflex/models/create_database_response.py +4 -3
  7. stackit/sqlserverflex/models/create_instance_payload.py +4 -3
  8. stackit/sqlserverflex/models/create_instance_response.py +4 -3
  9. stackit/sqlserverflex/models/create_user_payload.py +4 -3
  10. stackit/sqlserverflex/models/create_user_response.py +4 -3
  11. stackit/sqlserverflex/models/data_point.py +4 -3
  12. stackit/sqlserverflex/models/database.py +4 -3
  13. stackit/sqlserverflex/models/database_documentation_create_database_request_options.py +4 -3
  14. stackit/sqlserverflex/models/database_options.py +4 -3
  15. stackit/sqlserverflex/models/flavor.py +4 -3
  16. stackit/sqlserverflex/models/get_backup_response.py +4 -3
  17. stackit/sqlserverflex/models/get_database_response.py +4 -3
  18. stackit/sqlserverflex/models/get_instance_response.py +4 -3
  19. stackit/sqlserverflex/models/get_user_response.py +4 -3
  20. stackit/sqlserverflex/models/host.py +4 -3
  21. stackit/sqlserverflex/models/host_metric.py +4 -3
  22. stackit/sqlserverflex/models/instance.py +4 -3
  23. stackit/sqlserverflex/models/instance_documentation_acl.py +4 -3
  24. stackit/sqlserverflex/models/instance_documentation_options.py +4 -3
  25. stackit/sqlserverflex/models/instance_documentation_storage.py +4 -3
  26. stackit/sqlserverflex/models/instance_error.py +4 -3
  27. stackit/sqlserverflex/models/instance_flavor_entry.py +4 -3
  28. stackit/sqlserverflex/models/instance_list_instance.py +4 -3
  29. stackit/sqlserverflex/models/instance_list_user.py +4 -3
  30. stackit/sqlserverflex/models/list_backups_response.py +4 -3
  31. stackit/sqlserverflex/models/list_collations_response.py +4 -3
  32. stackit/sqlserverflex/models/list_compatibility_response.py +4 -3
  33. stackit/sqlserverflex/models/list_databases_response.py +4 -3
  34. stackit/sqlserverflex/models/list_flavors_response.py +4 -3
  35. stackit/sqlserverflex/models/list_instances_response.py +4 -3
  36. stackit/sqlserverflex/models/list_metrics_response.py +4 -3
  37. stackit/sqlserverflex/models/list_restore_jobs_response.py +4 -3
  38. stackit/sqlserverflex/models/list_roles_response.py +4 -3
  39. stackit/sqlserverflex/models/list_storages_response.py +4 -3
  40. stackit/sqlserverflex/models/list_users_response.py +4 -3
  41. stackit/sqlserverflex/models/list_versions_response.py +4 -3
  42. stackit/sqlserverflex/models/mssql_database_collation.py +4 -3
  43. stackit/sqlserverflex/models/mssql_database_compatibility.py +4 -3
  44. stackit/sqlserverflex/models/partial_update_instance_payload.py +4 -3
  45. stackit/sqlserverflex/models/reset_user_response.py +4 -3
  46. stackit/sqlserverflex/models/restore_running_restore.py +4 -3
  47. stackit/sqlserverflex/models/single_database.py +4 -3
  48. stackit/sqlserverflex/models/single_user.py +4 -3
  49. stackit/sqlserverflex/models/storage.py +4 -3
  50. stackit/sqlserverflex/models/storage_range.py +4 -3
  51. stackit/sqlserverflex/models/trigger_database_restore_payload.py +4 -3
  52. stackit/sqlserverflex/models/update_instance_payload.py +4 -3
  53. stackit/sqlserverflex/models/update_instance_response.py +4 -3
  54. stackit/sqlserverflex/models/user.py +4 -3
  55. stackit/sqlserverflex/models/user_response_user.py +4 -3
  56. {stackit_sqlserverflex-1.1.2.dist-info → stackit_sqlserverflex-1.2.0.dist-info}/METADATA +1 -1
  57. stackit_sqlserverflex-1.2.0.dist-info/RECORD +70 -0
  58. stackit_sqlserverflex-1.1.2.dist-info/RECORD +0 -70
  59. {stackit_sqlserverflex-1.1.2.dist-info → stackit_sqlserverflex-1.2.0.dist-info}/WHEEL +0 -0
  60. {stackit_sqlserverflex-1.1.2.dist-info → stackit_sqlserverflex-1.2.0.dist-info}/licenses/LICENSE.md +0 -0
  61. {stackit_sqlserverflex-1.1.2.dist-info → stackit_sqlserverflex-1.2.0.dist-info}/licenses/NOTICE.txt +0 -0
@@ -67,6 +67,7 @@ class ApiClient:
67
67
  "date": datetime.date,
68
68
  "datetime": datetime.datetime,
69
69
  "decimal": decimal.Decimal,
70
+ "UUID": uuid.UUID,
70
71
  "object": object,
71
72
  }
72
73
  _pool = None
@@ -266,7 +267,7 @@ class ApiClient:
266
267
  response_text = None
267
268
  return_data = None
268
269
  try:
269
- if response_type == "bytearray":
270
+ if response_type in ("bytearray", "bytes"):
270
271
  return_data = response_data.data
271
272
  elif response_type == "file":
272
273
  return_data = self.__deserialize_file(response_data)
@@ -327,25 +328,20 @@ class ApiClient:
327
328
  return obj.isoformat()
328
329
  elif isinstance(obj, decimal.Decimal):
329
330
  return str(obj)
330
-
331
331
  elif isinstance(obj, dict):
332
- obj_dict = obj
332
+ return {key: self.sanitize_for_serialization(val) for key, val in obj.items()}
333
+
334
+ # Convert model obj to dict except
335
+ # attributes `openapi_types`, `attribute_map`
336
+ # and attributes which value is not None.
337
+ # Convert attribute name to json key in
338
+ # model definition for request.
339
+ if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
340
+ obj_dict = obj.to_dict()
333
341
  else:
334
- # Convert model obj to dict except
335
- # attributes `openapi_types`, `attribute_map`
336
- # and attributes which value is not None.
337
- # Convert attribute name to json key in
338
- # model definition for request.
339
- if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
340
- obj_dict = obj.to_dict()
341
- else:
342
- obj_dict = obj.__dict__
343
-
344
- if isinstance(obj_dict, list):
345
- # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501
346
- return self.sanitize_for_serialization(obj_dict)
342
+ obj_dict = obj.__dict__
347
343
 
348
- return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()}
344
+ return self.sanitize_for_serialization(obj_dict)
349
345
 
350
346
  def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
351
347
  """Deserializes response into an object.
@@ -418,6 +414,8 @@ class ApiClient:
418
414
  return self.__deserialize_datetime(data)
419
415
  elif klass is decimal.Decimal:
420
416
  return decimal.Decimal(data)
417
+ elif klass is uuid.UUID:
418
+ return uuid.UUID(data)
421
419
  elif issubclass(klass, Enum):
422
420
  return self.__deserialize_enum(data, klass)
423
421
  else:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -31,7 +32,8 @@ class ACL(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["items"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -42,8 +44,7 @@ class ACL(BaseModel):
42
44
 
43
45
  def to_json(self) -> str:
44
46
  """Returns the JSON representation of the model using alias"""
45
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
- return json.dumps(self.to_dict())
47
+ return json.dumps(to_jsonable_python(self.to_dict()))
47
48
 
48
49
  @classmethod
49
50
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -38,7 +39,8 @@ class Backup(BaseModel):
38
39
  __properties: ClassVar[List[str]] = ["endTime", "error", "id", "labels", "name", "options", "size", "startTime"]
39
40
 
40
41
  model_config = ConfigDict(
41
- populate_by_name=True,
42
+ validate_by_name=True,
43
+ validate_by_alias=True,
42
44
  validate_assignment=True,
43
45
  protected_namespaces=(),
44
46
  )
@@ -49,8 +51,7 @@ class Backup(BaseModel):
49
51
 
50
52
  def to_json(self) -> str:
51
53
  """Returns the JSON representation of the model using alias"""
52
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
- return json.dumps(self.to_dict())
54
+ return json.dumps(to_jsonable_python(self.to_dict()))
54
55
 
55
56
  @classmethod
56
57
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.backup import Backup
@@ -34,7 +35,8 @@ class BackupListBackupsResponseGrouped(BaseModel):
34
35
  __properties: ClassVar[List[str]] = ["backups", "name"]
35
36
 
36
37
  model_config = ConfigDict(
37
- populate_by_name=True,
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
38
40
  validate_assignment=True,
39
41
  protected_namespaces=(),
40
42
  )
@@ -45,8 +47,7 @@ class BackupListBackupsResponseGrouped(BaseModel):
45
47
 
46
48
  def to_json(self) -> str:
47
49
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
51
 
51
52
  @classmethod
52
53
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.database_documentation_create_database_request_options import (
@@ -36,7 +37,8 @@ class CreateDatabasePayload(BaseModel):
36
37
  __properties: ClassVar[List[str]] = ["name", "options"]
37
38
 
38
39
  model_config = ConfigDict(
39
- populate_by_name=True,
40
+ validate_by_name=True,
41
+ validate_by_alias=True,
40
42
  validate_assignment=True,
41
43
  protected_namespaces=(),
42
44
  )
@@ -47,8 +49,7 @@ class CreateDatabasePayload(BaseModel):
47
49
 
48
50
  def to_json(self) -> str:
49
51
  """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
+ return json.dumps(to_jsonable_python(self.to_dict()))
52
53
 
53
54
  @classmethod
54
55
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -31,7 +32,8 @@ class CreateDatabaseResponse(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["id"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -42,8 +44,7 @@ class CreateDatabaseResponse(BaseModel):
42
44
 
43
45
  def to_json(self) -> str:
44
46
  """Returns the JSON representation of the model using alias"""
45
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
- return json.dumps(self.to_dict())
47
+ return json.dumps(to_jsonable_python(self.to_dict()))
47
48
 
48
49
  @classmethod
49
50
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.instance_documentation_acl import (
@@ -66,7 +67,8 @@ class CreateInstancePayload(BaseModel):
66
67
  ]
67
68
 
68
69
  model_config = ConfigDict(
69
- populate_by_name=True,
70
+ validate_by_name=True,
71
+ validate_by_alias=True,
70
72
  validate_assignment=True,
71
73
  protected_namespaces=(),
72
74
  )
@@ -77,8 +79,7 @@ class CreateInstancePayload(BaseModel):
77
79
 
78
80
  def to_json(self) -> str:
79
81
  """Returns the JSON representation of the model using alias"""
80
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
81
- return json.dumps(self.to_dict())
82
+ return json.dumps(to_jsonable_python(self.to_dict()))
82
83
 
83
84
  @classmethod
84
85
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -31,7 +32,8 @@ class CreateInstanceResponse(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["id"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -42,8 +44,7 @@ class CreateInstanceResponse(BaseModel):
42
44
 
43
45
  def to_json(self) -> str:
44
46
  """Returns the JSON representation of the model using alias"""
45
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
- return json.dumps(self.to_dict())
47
+ return json.dumps(to_jsonable_python(self.to_dict()))
47
48
 
48
49
  @classmethod
49
50
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -33,7 +34,8 @@ class CreateUserPayload(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["default_database", "roles", "username"]
34
35
 
35
36
  model_config = ConfigDict(
36
- populate_by_name=True,
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
37
39
  validate_assignment=True,
38
40
  protected_namespaces=(),
39
41
  )
@@ -44,8 +46,7 @@ class CreateUserPayload(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.single_user import SingleUser
@@ -33,7 +34,8 @@ class CreateUserResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["item"]
34
35
 
35
36
  model_config = ConfigDict(
36
- populate_by_name=True,
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
37
39
  validate_assignment=True,
38
40
  protected_namespaces=(),
39
41
  )
@@ -44,8 +46,7 @@ class CreateUserResponse(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -25,6 +25,7 @@ from pydantic import (
25
25
  StrictInt,
26
26
  StrictStr,
27
27
  )
28
+ from pydantic_core import to_jsonable_python
28
29
  from typing_extensions import Self
29
30
 
30
31
 
@@ -38,7 +39,8 @@ class DataPoint(BaseModel):
38
39
  __properties: ClassVar[List[str]] = ["timestamp", "value"]
39
40
 
40
41
  model_config = ConfigDict(
41
- populate_by_name=True,
42
+ validate_by_name=True,
43
+ validate_by_alias=True,
42
44
  validate_assignment=True,
43
45
  protected_namespaces=(),
44
46
  )
@@ -49,8 +51,7 @@ class DataPoint(BaseModel):
49
51
 
50
52
  def to_json(self) -> str:
51
53
  """Returns the JSON representation of the model using alias"""
52
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
- return json.dumps(self.to_dict())
54
+ return json.dumps(to_jsonable_python(self.to_dict()))
54
55
 
55
56
  @classmethod
56
57
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -33,7 +34,8 @@ class Database(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["id", "name", "options"]
34
35
 
35
36
  model_config = ConfigDict(
36
- populate_by_name=True,
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
37
39
  validate_assignment=True,
38
40
  protected_namespaces=(),
39
41
  )
@@ -44,8 +46,7 @@ class Database(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -35,7 +36,8 @@ class DatabaseDocumentationCreateDatabaseRequestOptions(BaseModel):
35
36
  __properties: ClassVar[List[str]] = ["collation", "compatibilityLevel", "owner"]
36
37
 
37
38
  model_config = ConfigDict(
38
- populate_by_name=True,
39
+ validate_by_name=True,
40
+ validate_by_alias=True,
39
41
  validate_assignment=True,
40
42
  protected_namespaces=(),
41
43
  )
@@ -46,8 +48,7 @@ class DatabaseDocumentationCreateDatabaseRequestOptions(BaseModel):
46
48
 
47
49
  def to_json(self) -> str:
48
50
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
51
52
 
52
53
  @classmethod
53
54
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -37,7 +38,8 @@ class DatabaseOptions(BaseModel):
37
38
  __properties: ClassVar[List[str]] = ["collationName", "compatibilityLevel", "owner"]
38
39
 
39
40
  model_config = ConfigDict(
40
- populate_by_name=True,
41
+ validate_by_name=True,
42
+ validate_by_alias=True,
41
43
  validate_assignment=True,
42
44
  protected_namespaces=(),
43
45
  )
@@ -48,8 +50,7 @@ class DatabaseOptions(BaseModel):
48
50
 
49
51
  def to_json(self) -> str:
50
52
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
53
54
 
54
55
  @classmethod
55
56
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -34,7 +35,8 @@ class Flavor(BaseModel):
34
35
  __properties: ClassVar[List[str]] = ["cpu", "description", "id", "memory"]
35
36
 
36
37
  model_config = ConfigDict(
37
- populate_by_name=True,
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
38
40
  validate_assignment=True,
39
41
  protected_namespaces=(),
40
42
  )
@@ -45,8 +47,7 @@ class Flavor(BaseModel):
45
47
 
46
48
  def to_json(self) -> str:
47
49
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
51
 
51
52
  @classmethod
52
53
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -42,7 +43,8 @@ class GetBackupResponse(BaseModel):
42
43
  __properties: ClassVar[List[str]] = ["endTime", "error", "id", "labels", "name", "options", "size", "startTime"]
43
44
 
44
45
  model_config = ConfigDict(
45
- populate_by_name=True,
46
+ validate_by_name=True,
47
+ validate_by_alias=True,
46
48
  validate_assignment=True,
47
49
  protected_namespaces=(),
48
50
  )
@@ -53,8 +55,7 @@ class GetBackupResponse(BaseModel):
53
55
 
54
56
  def to_json(self) -> str:
55
57
  """Returns the JSON representation of the model using alias"""
56
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
- return json.dumps(self.to_dict())
58
+ return json.dumps(to_jsonable_python(self.to_dict()))
58
59
 
59
60
  @classmethod
60
61
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.single_database import SingleDatabase
@@ -33,7 +34,8 @@ class GetDatabaseResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["database"]
34
35
 
35
36
  model_config = ConfigDict(
36
- populate_by_name=True,
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
37
39
  validate_assignment=True,
38
40
  protected_namespaces=(),
39
41
  )
@@ -44,8 +46,7 @@ class GetDatabaseResponse(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.instance import Instance
@@ -33,7 +34,8 @@ class GetInstanceResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["item"]
34
35
 
35
36
  model_config = ConfigDict(
36
- populate_by_name=True,
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
37
39
  validate_assignment=True,
38
40
  protected_namespaces=(),
39
41
  )
@@ -44,8 +46,7 @@ class GetInstanceResponse(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.user_response_user import UserResponseUser
@@ -33,7 +34,8 @@ class GetUserResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["item"]
34
35
 
35
36
  model_config = ConfigDict(
36
- populate_by_name=True,
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
37
39
  validate_assignment=True,
38
40
  protected_namespaces=(),
39
41
  )
@@ -44,8 +46,7 @@ class GetUserResponse(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.host_metric import HostMetric
@@ -34,7 +35,8 @@ class Host(BaseModel):
34
35
  __properties: ClassVar[List[str]] = ["hostMetrics", "id"]
35
36
 
36
37
  model_config = ConfigDict(
37
- populate_by_name=True,
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
38
40
  validate_assignment=True,
39
41
  protected_namespaces=(),
40
42
  )
@@ -45,8 +47,7 @@ class Host(BaseModel):
45
47
 
46
48
  def to_json(self) -> str:
47
49
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
51
 
51
52
  @classmethod
52
53
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.data_point import DataPoint
@@ -35,7 +36,8 @@ class HostMetric(BaseModel):
35
36
  __properties: ClassVar[List[str]] = ["datapoints", "name", "units"]
36
37
 
37
38
  model_config = ConfigDict(
38
- populate_by_name=True,
39
+ validate_by_name=True,
40
+ validate_by_alias=True,
39
41
  validate_assignment=True,
40
42
  protected_namespaces=(),
41
43
  )
@@ -46,8 +48,7 @@ class HostMetric(BaseModel):
46
48
 
47
49
  def to_json(self) -> str:
48
50
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
51
52
 
52
53
  @classmethod
53
54
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.sqlserverflex.models.acl import ACL
@@ -55,7 +56,8 @@ class Instance(BaseModel):
55
56
  ]
56
57
 
57
58
  model_config = ConfigDict(
58
- populate_by_name=True,
59
+ validate_by_name=True,
60
+ validate_by_alias=True,
59
61
  validate_assignment=True,
60
62
  protected_namespaces=(),
61
63
  )
@@ -66,8 +68,7 @@ class Instance(BaseModel):
66
68
 
67
69
  def to_json(self) -> str:
68
70
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
71
72
 
72
73
  @classmethod
73
74
  def from_json(cls, json_str: str) -> Optional[Self]: