stackit-certificates 1.3.1__tar.gz → 1.5.0__tar.gz

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 (24) hide show
  1. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/PKG-INFO +1 -1
  2. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/pyproject.toml +1 -1
  3. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/api_client.py +15 -17
  4. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/models/certificates_quota.py +4 -3
  5. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/models/create_certificate_payload.py +19 -4
  6. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/models/get_certificate_response.py +16 -4
  7. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/models/get_quota_response.py +10 -3
  8. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/models/google_protobuf_any.py +4 -3
  9. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/models/list_certificates_response.py +7 -3
  10. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/models/quotas.py +4 -3
  11. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/models/status.py +4 -3
  12. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/.gitignore +0 -0
  13. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/LICENSE.md +0 -0
  14. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/NOTICE.txt +0 -0
  15. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/README.md +0 -0
  16. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/__init__.py +0 -0
  17. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/api/__init__.py +0 -0
  18. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/api/default_api.py +0 -0
  19. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/api_response.py +0 -0
  20. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/configuration.py +0 -0
  21. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/exceptions.py +0 -0
  22. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/models/__init__.py +0 -0
  23. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/py.typed +0 -0
  24. {stackit_certificates-1.3.1 → stackit_certificates-1.5.0}/src/stackit/certificates/rest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackit-certificates
3
- Version: 1.3.1
3
+ Version: 1.5.0
4
4
  Summary: Load Balancer Certificates API
5
5
  Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
6
6
  Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stackit-certificates"
3
- version = "v1.3.1"
3
+ version = "v1.5.0"
4
4
  description = "Load Balancer Certificates API"
5
5
  authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }]
6
6
  requires-python = ">=3.9,<4.0"
@@ -66,6 +66,7 @@ class ApiClient:
66
66
  "date": datetime.date,
67
67
  "datetime": datetime.datetime,
68
68
  "decimal": decimal.Decimal,
69
+ "UUID": uuid.UUID,
69
70
  "object": object,
70
71
  }
71
72
  _pool = None
@@ -265,7 +266,7 @@ class ApiClient:
265
266
  response_text = None
266
267
  return_data = None
267
268
  try:
268
- if response_type == "bytearray":
269
+ if response_type in ("bytearray", "bytes"):
269
270
  return_data = response_data.data
270
271
  elif response_type == "file":
271
272
  return_data = self.__deserialize_file(response_data)
@@ -326,25 +327,20 @@ class ApiClient:
326
327
  return obj.isoformat()
327
328
  elif isinstance(obj, decimal.Decimal):
328
329
  return str(obj)
329
-
330
330
  elif isinstance(obj, dict):
331
- obj_dict = obj
331
+ return {key: self.sanitize_for_serialization(val) for key, val in obj.items()}
332
+
333
+ # Convert model obj to dict except
334
+ # attributes `openapi_types`, `attribute_map`
335
+ # and attributes which value is not None.
336
+ # Convert attribute name to json key in
337
+ # model definition for request.
338
+ if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
339
+ obj_dict = obj.to_dict()
332
340
  else:
333
- # Convert model obj to dict except
334
- # attributes `openapi_types`, `attribute_map`
335
- # and attributes which value is not None.
336
- # Convert attribute name to json key in
337
- # model definition for request.
338
- if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
339
- obj_dict = obj.to_dict()
340
- else:
341
- obj_dict = obj.__dict__
342
-
343
- if isinstance(obj_dict, list):
344
- # 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
345
- return self.sanitize_for_serialization(obj_dict)
341
+ obj_dict = obj.__dict__
346
342
 
347
- return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()}
343
+ return self.sanitize_for_serialization(obj_dict)
348
344
 
349
345
  def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
350
346
  """Deserializes response into an object.
@@ -417,6 +413,8 @@ class ApiClient:
417
413
  return self.__deserialize_datetime(data)
418
414
  elif klass is decimal.Decimal:
419
415
  return decimal.Decimal(data)
416
+ elif klass is uuid.UUID:
417
+ return uuid.UUID(data)
420
418
  elif issubclass(klass, Enum):
421
419
  return self.__deserialize_enum(data, klass)
422
420
  else:
@@ -18,6 +18,7 @@ import pprint
18
18
  from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Annotated, Self
22
23
 
23
24
 
@@ -35,7 +36,8 @@ class CertificatesQuota(BaseModel):
35
36
  __properties: ClassVar[List[str]] = ["limit", "usage"]
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 CertificatesQuota(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]:
@@ -20,6 +20,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
  from uuid import UUID
21
21
 
22
22
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
+ from pydantic_core import to_jsonable_python
23
24
  from typing_extensions import Annotated, Self
24
25
 
25
26
 
@@ -28,6 +29,10 @@ class CreateCertificatePayload(BaseModel):
28
29
  Uploads a PEM encoded X509 public/private key pair
29
30
  """ # noqa: E501
30
31
 
32
+ labels: Optional[Dict[str, StrictStr]] = Field(
33
+ default=None,
34
+ description="Labels represent user-defined metadata as key-value pairs. Label count should not exceed 64 per Certificate. **Key Formatting Rules:** Length: 1-63 characters. Characters: Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. Keys starting with 'stackit-' are system-reserved; users MUST NOT manage them. **Value Formatting Rules:** Length: 0-63 characters (empty string explicitly allowed). Characters (for non-empty values): Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. ",
35
+ )
31
36
  name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="TLS certificate name")
32
37
  private_key: Optional[StrictStr] = Field(
33
38
  default=None, description="The PEM encoded private key part", alias="privateKey"
@@ -37,7 +42,7 @@ class CreateCertificatePayload(BaseModel):
37
42
  default=None, description="The PEM encoded public key part", alias="publicKey"
38
43
  )
39
44
  region: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Region")
40
- __properties: ClassVar[List[str]] = ["name", "privateKey", "projectId", "publicKey", "region"]
45
+ __properties: ClassVar[List[str]] = ["labels", "name", "privateKey", "projectId", "publicKey", "region"]
41
46
 
42
47
  @field_validator("name")
43
48
  def name_validate_regular_expression(cls, value):
@@ -45,6 +50,9 @@ class CreateCertificatePayload(BaseModel):
45
50
  if value is None:
46
51
  return value
47
52
 
53
+ if not isinstance(value, str):
54
+ value = str(value)
55
+
48
56
  if not re.match(r"^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$", value):
49
57
  raise ValueError(r"must validate the regular expression /^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$/")
50
58
  return value
@@ -55,6 +63,9 @@ class CreateCertificatePayload(BaseModel):
55
63
  if value is None:
56
64
  return value
57
65
 
66
+ if not isinstance(value, str):
67
+ value = str(value)
68
+
58
69
  if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", value):
59
70
  raise ValueError(
60
71
  r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/"
@@ -67,12 +78,16 @@ class CreateCertificatePayload(BaseModel):
67
78
  if value is None:
68
79
  return value
69
80
 
81
+ if not isinstance(value, str):
82
+ value = str(value)
83
+
70
84
  if not re.match(r"^[a-z]{2,4}[0-9]{2}$", value):
71
85
  raise ValueError(r"must validate the regular expression /^[a-z]{2,4}[0-9]{2}$/")
72
86
  return value
73
87
 
74
88
  model_config = ConfigDict(
75
- populate_by_name=True,
89
+ validate_by_name=True,
90
+ validate_by_alias=True,
76
91
  validate_assignment=True,
77
92
  protected_namespaces=(),
78
93
  )
@@ -83,8 +98,7 @@ class CreateCertificatePayload(BaseModel):
83
98
 
84
99
  def to_json(self) -> str:
85
100
  """Returns the JSON representation of the model using alias"""
86
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
87
- return json.dumps(self.to_dict())
101
+ return json.dumps(to_jsonable_python(self.to_dict()))
88
102
 
89
103
  @classmethod
90
104
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -128,6 +142,7 @@ class CreateCertificatePayload(BaseModel):
128
142
 
129
143
  _obj = cls.model_validate(
130
144
  {
145
+ "labels": obj.get("labels"),
131
146
  "name": obj.get("name"),
132
147
  "privateKey": obj.get("privateKey"),
133
148
  "projectId": obj.get("projectId"),
@@ -19,6 +19,7 @@ import re # noqa: F401
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Annotated, Self
23
24
 
24
25
 
@@ -28,12 +29,16 @@ class GetCertificateResponse(BaseModel):
28
29
  """ # noqa: E501
29
30
 
30
31
  id: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The certificates resource id")
32
+ labels: Optional[Dict[str, StrictStr]] = Field(
33
+ default=None,
34
+ description="Labels represent user-defined metadata as key-value pairs. Label count should not exceed 64 per Certificate. **Key Formatting Rules:** Length: 1-63 characters. Characters: Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. Keys starting with 'stackit-' are system-reserved; users MUST NOT manage them. **Value Formatting Rules:** Length: 0-63 characters (empty string explicitly allowed). Characters (for non-empty values): Must begin and end with [a-zA-Z0-9]. May contain dashes (-), underscores (_), dots (.), and alphanumerics in between. ",
35
+ )
31
36
  name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="TLS certificate name")
32
37
  public_key: Optional[StrictStr] = Field(
33
38
  default=None, description="The PEM encoded public key part", alias="publicKey"
34
39
  )
35
40
  region: Optional[StrictStr] = Field(default=None, description="Region of the LoadBalancer")
36
- __properties: ClassVar[List[str]] = ["id", "name", "publicKey", "region"]
41
+ __properties: ClassVar[List[str]] = ["id", "labels", "name", "publicKey", "region"]
37
42
 
38
43
  @field_validator("id")
39
44
  def id_validate_regular_expression(cls, value):
@@ -41,6 +46,9 @@ class GetCertificateResponse(BaseModel):
41
46
  if value is None:
42
47
  return value
43
48
 
49
+ if not isinstance(value, str):
50
+ value = str(value)
51
+
44
52
  if not re.match(r"^[0-9a-z](?:(?:[0-9a-z]|-){0,251}[0-9a-z])?$", value):
45
53
  raise ValueError(r"must validate the regular expression /^[0-9a-z](?:(?:[0-9a-z]|-){0,251}[0-9a-z])?$/")
46
54
  return value
@@ -51,12 +59,16 @@ class GetCertificateResponse(BaseModel):
51
59
  if value is None:
52
60
  return value
53
61
 
62
+ if not isinstance(value, str):
63
+ value = str(value)
64
+
54
65
  if not re.match(r"^[0-9a-z](?:(?:[0-9a-z]|-){0,251}[0-9a-z])?$", value):
55
66
  raise ValueError(r"must validate the regular expression /^[0-9a-z](?:(?:[0-9a-z]|-){0,251}[0-9a-z])?$/")
56
67
  return value
57
68
 
58
69
  model_config = ConfigDict(
59
- populate_by_name=True,
70
+ validate_by_name=True,
71
+ validate_by_alias=True,
60
72
  validate_assignment=True,
61
73
  protected_namespaces=(),
62
74
  )
@@ -67,8 +79,7 @@ class GetCertificateResponse(BaseModel):
67
79
 
68
80
  def to_json(self) -> str:
69
81
  """Returns the JSON representation of the model using alias"""
70
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
71
- return json.dumps(self.to_dict())
82
+ return json.dumps(to_jsonable_python(self.to_dict()))
72
83
 
73
84
  @classmethod
74
85
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -106,6 +117,7 @@ class GetCertificateResponse(BaseModel):
106
117
  _obj = cls.model_validate(
107
118
  {
108
119
  "id": obj.get("id"),
120
+ "labels": obj.get("labels"),
109
121
  "name": obj.get("name"),
110
122
  "publicKey": obj.get("publicKey"),
111
123
  "region": obj.get("region"),
@@ -20,6 +20,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
  from uuid import UUID
21
21
 
22
22
  from pydantic import BaseModel, ConfigDict, Field, field_validator
23
+ from pydantic_core import to_jsonable_python
23
24
  from typing_extensions import Annotated, Self
24
25
 
25
26
  from stackit.certificates.models.quotas import Quotas
@@ -41,6 +42,9 @@ class GetQuotaResponse(BaseModel):
41
42
  if value is None:
42
43
  return value
43
44
 
45
+ if not isinstance(value, str):
46
+ value = str(value)
47
+
44
48
  if not re.match(r"^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", value):
45
49
  raise ValueError(
46
50
  r"must validate the regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/"
@@ -53,12 +57,16 @@ class GetQuotaResponse(BaseModel):
53
57
  if value is None:
54
58
  return value
55
59
 
60
+ if not isinstance(value, str):
61
+ value = str(value)
62
+
56
63
  if not re.match(r"^[a-z]{2,4}[0-9]{2}$", value):
57
64
  raise ValueError(r"must validate the regular expression /^[a-z]{2,4}[0-9]{2}$/")
58
65
  return value
59
66
 
60
67
  model_config = ConfigDict(
61
- populate_by_name=True,
68
+ validate_by_name=True,
69
+ validate_by_alias=True,
62
70
  validate_assignment=True,
63
71
  protected_namespaces=(),
64
72
  )
@@ -69,8 +77,7 @@ class GetQuotaResponse(BaseModel):
69
77
 
70
78
  def to_json(self) -> str:
71
79
  """Returns the JSON representation of the model using alias"""
72
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
73
- return json.dumps(self.to_dict())
80
+ return json.dumps(to_jsonable_python(self.to_dict()))
74
81
 
75
82
  @classmethod
76
83
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -18,6 +18,7 @@ import pprint
18
18
  from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Self
22
23
 
23
24
 
@@ -31,7 +32,8 @@ class GoogleProtobufAny(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["@type"]
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 GoogleProtobufAny(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 re # noqa: F401
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, field_validator
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Annotated, Self
23
24
 
24
25
  from stackit.certificates.models.get_certificate_response import GetCertificateResponse
@@ -43,12 +44,16 @@ class ListCertificatesResponse(BaseModel):
43
44
  if value is None:
44
45
  return value
45
46
 
47
+ if not isinstance(value, str):
48
+ value = str(value)
49
+
46
50
  if not re.match(r"^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$", value):
47
51
  raise ValueError(r"must validate the regular expression /^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$/")
48
52
  return value
49
53
 
50
54
  model_config = ConfigDict(
51
- populate_by_name=True,
55
+ validate_by_name=True,
56
+ validate_by_alias=True,
52
57
  validate_assignment=True,
53
58
  protected_namespaces=(),
54
59
  )
@@ -59,8 +64,7 @@ class ListCertificatesResponse(BaseModel):
59
64
 
60
65
  def to_json(self) -> str:
61
66
  """Returns the JSON representation of the model using alias"""
62
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
63
- return json.dumps(self.to_dict())
67
+ return json.dumps(to_jsonable_python(self.to_dict()))
64
68
 
65
69
  @classmethod
66
70
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -18,6 +18,7 @@ import pprint
18
18
  from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Self
22
23
 
23
24
  from stackit.certificates.models.certificates_quota import CertificatesQuota
@@ -32,7 +33,8 @@ class Quotas(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["certificates"]
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 Quotas(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]:
@@ -18,6 +18,7 @@ import pprint
18
18
  from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Self
22
23
 
23
24
  from stackit.certificates.models.google_protobuf_any import GoogleProtobufAny
@@ -43,7 +44,8 @@ class Status(BaseModel):
43
44
  __properties: ClassVar[List[str]] = ["code", "details", "message"]
44
45
 
45
46
  model_config = ConfigDict(
46
- populate_by_name=True,
47
+ validate_by_name=True,
48
+ validate_by_alias=True,
47
49
  validate_assignment=True,
48
50
  protected_namespaces=(),
49
51
  )
@@ -54,8 +56,7 @@ class Status(BaseModel):
54
56
 
55
57
  def to_json(self) -> str:
56
58
  """Returns the JSON representation of the model using alias"""
57
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
- return json.dumps(self.to_dict())
59
+ return json.dumps(to_jsonable_python(self.to_dict()))
59
60
 
60
61
  @classmethod
61
62
  def from_json(cls, json_str: str) -> Optional[Self]: