stackit-postgresflex 1.2.2__py3-none-any.whl → 1.3.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 (62) hide show
  1. stackit/postgresflex/api_client.py +15 -17
  2. stackit/postgresflex/models/acl.py +4 -3
  3. stackit/postgresflex/models/api_configuration.py +4 -3
  4. stackit/postgresflex/models/api_extension_config_load_response.py +4 -3
  5. stackit/postgresflex/models/api_extension_configure_response.py +4 -3
  6. stackit/postgresflex/models/api_extension_delete_response.py +4 -3
  7. stackit/postgresflex/models/api_extension_list.py +4 -3
  8. stackit/postgresflex/models/api_extension_load_response.py +4 -3
  9. stackit/postgresflex/models/api_install_response.py +4 -3
  10. stackit/postgresflex/models/api_installed_list_response.py +4 -3
  11. stackit/postgresflex/models/backup.py +4 -3
  12. stackit/postgresflex/models/clone_instance_payload.py +4 -3
  13. stackit/postgresflex/models/clone_instance_response.py +4 -3
  14. stackit/postgresflex/models/create_database_payload.py +4 -3
  15. stackit/postgresflex/models/create_instance_payload.py +4 -3
  16. stackit/postgresflex/models/create_instance_response.py +4 -3
  17. stackit/postgresflex/models/create_user_payload.py +4 -3
  18. stackit/postgresflex/models/create_user_response.py +4 -3
  19. stackit/postgresflex/models/error.py +4 -3
  20. stackit/postgresflex/models/extensions_configuration.py +4 -3
  21. stackit/postgresflex/models/extensions_extension_list_response.py +4 -3
  22. stackit/postgresflex/models/extensions_new_config.py +4 -3
  23. stackit/postgresflex/models/flavor.py +4 -3
  24. stackit/postgresflex/models/get_backup_response.py +4 -3
  25. stackit/postgresflex/models/get_user_response.py +4 -3
  26. stackit/postgresflex/models/instance.py +4 -3
  27. stackit/postgresflex/models/instance_create_database_response.py +4 -3
  28. stackit/postgresflex/models/instance_data_point.py +4 -3
  29. stackit/postgresflex/models/instance_database.py +4 -3
  30. stackit/postgresflex/models/instance_host.py +4 -3
  31. stackit/postgresflex/models/instance_host_metric.py +4 -3
  32. stackit/postgresflex/models/instance_list_databases_response.py +4 -3
  33. stackit/postgresflex/models/instance_list_instance.py +4 -3
  34. stackit/postgresflex/models/instance_metrics_response.py +4 -3
  35. stackit/postgresflex/models/instance_response.py +4 -3
  36. stackit/postgresflex/models/list_backups_response.py +4 -3
  37. stackit/postgresflex/models/list_flavors_response.py +4 -3
  38. stackit/postgresflex/models/list_instances_response.py +4 -3
  39. stackit/postgresflex/models/list_storages_response.py +4 -3
  40. stackit/postgresflex/models/list_users_response.py +4 -3
  41. stackit/postgresflex/models/list_users_response_item.py +4 -3
  42. stackit/postgresflex/models/list_versions_response.py +4 -3
  43. stackit/postgresflex/models/partial_update_instance_payload.py +4 -3
  44. stackit/postgresflex/models/partial_update_instance_response.py +4 -3
  45. stackit/postgresflex/models/partial_update_user_payload.py +4 -3
  46. stackit/postgresflex/models/postgres_database_parameter.py +4 -3
  47. stackit/postgresflex/models/postgres_database_parameter_response.py +4 -3
  48. stackit/postgresflex/models/reset_user_response.py +4 -3
  49. stackit/postgresflex/models/storage.py +4 -3
  50. stackit/postgresflex/models/storage_range.py +4 -3
  51. stackit/postgresflex/models/storage_update.py +4 -3
  52. stackit/postgresflex/models/update_backup_schedule_payload.py +4 -3
  53. stackit/postgresflex/models/update_instance_payload.py +4 -3
  54. stackit/postgresflex/models/update_user_payload.py +4 -3
  55. stackit/postgresflex/models/user.py +4 -3
  56. stackit/postgresflex/models/user_response.py +4 -3
  57. {stackit_postgresflex-1.2.2.dist-info → stackit_postgresflex-1.3.0.dist-info}/METADATA +1 -1
  58. stackit_postgresflex-1.3.0.dist-info/RECORD +70 -0
  59. stackit_postgresflex-1.2.2.dist-info/RECORD +0 -70
  60. {stackit_postgresflex-1.2.2.dist-info → stackit_postgresflex-1.3.0.dist-info}/WHEEL +0 -0
  61. {stackit_postgresflex-1.2.2.dist-info → stackit_postgresflex-1.3.0.dist-info}/licenses/LICENSE.md +0 -0
  62. {stackit_postgresflex-1.2.2.dist-info → stackit_postgresflex-1.3.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, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -32,7 +33,8 @@ class ApiConfiguration(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["name", "setting"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -43,8 +45,7 @@ class ApiConfiguration(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  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
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.postgresflex.models.api_configuration import ApiConfiguration
@@ -35,7 +36,8 @@ class ApiExtensionConfigLoadResponse(BaseModel):
35
36
  __properties: ClassVar[List[str]] = ["configuration"]
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 ApiExtensionConfigLoadResponse(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
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
  from stackit.postgresflex.models.api_configuration import ApiConfiguration
@@ -35,7 +36,8 @@ class ApiExtensionConfigureResponse(BaseModel):
35
36
  __properties: ClassVar[List[str]] = ["configuration"]
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 ApiExtensionConfigureResponse(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, StrictBool
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -31,7 +32,8 @@ class ApiExtensionDeleteResponse(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["isSucceded"]
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 ApiExtensionDeleteResponse(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
 
@@ -33,7 +34,8 @@ class ApiExtensionList(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["ID", "description", "name"]
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 ApiExtensionList(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.postgresflex.models.api_extension_list import ApiExtensionList
@@ -33,7 +34,8 @@ class ApiExtensionLoadResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["extension"]
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 ApiExtensionLoadResponse(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.postgresflex.models.api_extension_list import ApiExtensionList
@@ -33,7 +34,8 @@ class ApiInstallResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["extension"]
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 ApiInstallResponse(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.postgresflex.models.api_extension_list import ApiExtensionList
@@ -33,7 +34,8 @@ class ApiInstalledListResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["installed"]
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 ApiInstalledListResponse(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, 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, Field, StrictInt, StrictStr
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Self
23
24
 
24
25
 
@@ -36,7 +37,8 @@ class CloneInstancePayload(BaseModel):
36
37
  __properties: ClassVar[List[str]] = ["class", "size", "timestamp"]
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 CloneInstancePayload(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, Field, 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 CloneInstanceResponse(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["instanceId"]
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 CloneInstanceResponse(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
 
@@ -32,7 +33,8 @@ class CreateDatabasePayload(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["name", "options"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -43,8 +45,7 @@ class CreateDatabasePayload(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  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.postgresflex.models.acl import ACL
@@ -52,7 +53,8 @@ class CreateInstancePayload(BaseModel):
52
53
  ]
53
54
 
54
55
  model_config = ConfigDict(
55
- populate_by_name=True,
56
+ validate_by_name=True,
57
+ validate_by_alias=True,
56
58
  validate_assignment=True,
57
59
  protected_namespaces=(),
58
60
  )
@@ -63,8 +65,7 @@ class CreateInstancePayload(BaseModel):
63
65
 
64
66
  def to_json(self) -> str:
65
67
  """Returns the JSON representation of the model using alias"""
66
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
67
- return json.dumps(self.to_dict())
68
+ return json.dumps(to_jsonable_python(self.to_dict()))
68
69
 
69
70
  @classmethod
70
71
  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
 
@@ -32,7 +33,8 @@ class CreateUserPayload(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["roles", "username"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -43,8 +45,7 @@ class CreateUserPayload(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  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.postgresflex.models.user import User
@@ -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]:
@@ -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 Error(BaseModel):
34
35
  __properties: ClassVar[List[str]] = ["code", "fields", "message", "type"]
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 Error(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
 
@@ -32,7 +33,8 @@ class ExtensionsConfiguration(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["name", "setting"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -43,8 +45,7 @@ class ExtensionsConfiguration(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  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.postgresflex.models.api_extension_list import ApiExtensionList
@@ -33,7 +34,8 @@ class ExtensionsExtensionListResponse(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["list"]
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 ExtensionsExtensionListResponse(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.postgresflex.models.extensions_configuration import ExtensionsConfiguration
@@ -33,7 +34,8 @@ class ExtensionsNewConfig(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["configuration"]
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 ExtensionsNewConfig(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]: