stackit-serviceenablement 1.1.2__tar.gz → 1.2.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 (25) hide show
  1. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/PKG-INFO +1 -1
  2. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/pyproject.toml +1 -1
  3. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/api_client.py +15 -17
  4. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/action_error.py +4 -3
  5. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/check_service.py +7 -3
  6. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/cloud_service.py +7 -3
  7. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/dependencies.py +4 -3
  8. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/error_response.py +4 -3
  9. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/list_service_status_regional200_response.py +4 -3
  10. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/parameters.py +4 -3
  11. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/parameters_general.py +4 -3
  12. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/service_status.py +7 -3
  13. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/.gitignore +0 -0
  14. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/LICENSE.md +0 -0
  15. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/NOTICE.txt +0 -0
  16. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/README.md +0 -0
  17. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/__init__.py +0 -0
  18. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/api/__init__.py +0 -0
  19. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/api/default_api.py +0 -0
  20. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/api_response.py +0 -0
  21. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/configuration.py +0 -0
  22. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/exceptions.py +0 -0
  23. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/models/__init__.py +0 -0
  24. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/py.typed +0 -0
  25. {stackit_serviceenablement-1.1.2 → stackit_serviceenablement-1.2.0}/src/stackit/serviceenablement/rest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackit-serviceenablement
3
- Version: 1.1.2
3
+ Version: 1.2.0
4
4
  Summary: STACKIT Service Enablement 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-serviceenablement"
3
- version = "v1.1.2"
3
+ version = "v1.2.0"
4
4
  description = "STACKIT Service Enablement 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, StrictStr, field_validator
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Self
22
23
 
23
24
 
@@ -42,7 +43,8 @@ class ActionError(BaseModel):
42
43
  return value
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 ActionError(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 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
 
@@ -50,12 +51,16 @@ class CheckService(BaseModel):
50
51
  if value is None:
51
52
  return value
52
53
 
54
+ if not isinstance(value, str):
55
+ value = str(value)
56
+
53
57
  if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$", value):
54
58
  raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$/")
55
59
  return value
56
60
 
57
61
  model_config = ConfigDict(
58
- populate_by_name=True,
62
+ validate_by_name=True,
63
+ validate_by_alias=True,
59
64
  validate_assignment=True,
60
65
  protected_namespaces=(),
61
66
  )
@@ -66,8 +71,7 @@ class CheckService(BaseModel):
66
71
 
67
72
  def to_json(self) -> str:
68
73
  """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())
74
+ return json.dumps(to_jsonable_python(self.to_dict()))
71
75
 
72
76
  @classmethod
73
77
  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, StrictStr, field_validator
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Annotated, Self
23
24
 
24
25
  from stackit.serviceenablement.models.dependencies import Dependencies
@@ -53,12 +54,16 @@ class CloudService(BaseModel):
53
54
  if value is None:
54
55
  return value
55
56
 
57
+ if not isinstance(value, str):
58
+ value = str(value)
59
+
56
60
  if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$", value):
57
61
  raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$/")
58
62
  return value
59
63
 
60
64
  model_config = ConfigDict(
61
- populate_by_name=True,
65
+ validate_by_name=True,
66
+ validate_by_alias=True,
62
67
  validate_assignment=True,
63
68
  protected_namespaces=(),
64
69
  )
@@ -69,8 +74,7 @@ class CloudService(BaseModel):
69
74
 
70
75
  def to_json(self) -> str:
71
76
  """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())
77
+ return json.dumps(to_jsonable_python(self.to_dict()))
74
78
 
75
79
  @classmethod
76
80
  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
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Annotated, Self
22
23
 
23
24
 
@@ -37,7 +38,8 @@ class Dependencies(BaseModel):
37
38
  __properties: ClassVar[List[str]] = ["hard", "soft"]
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 Dependencies(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]:
@@ -20,6 +20,7 @@ from datetime import datetime
20
20
  from typing import Any, ClassVar, Dict, List, Optional, Set
21
21
 
22
22
  from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator
23
+ from pydantic_core import to_jsonable_python
23
24
  from typing_extensions import Self
24
25
 
25
26
 
@@ -49,7 +50,8 @@ class ErrorResponse(BaseModel):
49
50
  return value
50
51
 
51
52
  model_config = ConfigDict(
52
- populate_by_name=True,
53
+ validate_by_name=True,
54
+ validate_by_alias=True,
53
55
  validate_assignment=True,
54
56
  protected_namespaces=(),
55
57
  )
@@ -60,8 +62,7 @@ class ErrorResponse(BaseModel):
60
62
 
61
63
  def to_json(self) -> str:
62
64
  """Returns the JSON representation of the model using alias"""
63
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
64
- return json.dumps(self.to_dict())
65
+ return json.dumps(to_jsonable_python(self.to_dict()))
65
66
 
66
67
  @classmethod
67
68
  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
  from stackit.serviceenablement.models.service_status import ServiceStatus
@@ -33,7 +34,8 @@ class ListServiceStatusRegional200Response(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["items", "nextCursor"]
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 ListServiceStatusRegional200Response(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]:
@@ -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.serviceenablement.models.parameters_general import ParametersGeneral
@@ -33,7 +34,8 @@ class Parameters(BaseModel):
33
34
  __properties: ClassVar[List[str]] = ["general"]
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 Parameters(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]:
@@ -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, field_validator
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Self
22
23
 
23
24
 
@@ -42,7 +43,8 @@ class ParametersGeneral(BaseModel):
42
43
  return value
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 ParametersGeneral(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 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
  from stackit.serviceenablement.models.action_error import ActionError
@@ -90,6 +91,9 @@ class ServiceStatus(BaseModel):
90
91
  if value is None:
91
92
  return value
92
93
 
94
+ if not isinstance(value, str):
95
+ value = str(value)
96
+
93
97
  if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$", value):
94
98
  raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9._-]{1,254}$/")
95
99
  return value
@@ -105,7 +109,8 @@ class ServiceStatus(BaseModel):
105
109
  return value
106
110
 
107
111
  model_config = ConfigDict(
108
- populate_by_name=True,
112
+ validate_by_name=True,
113
+ validate_by_alias=True,
109
114
  validate_assignment=True,
110
115
  protected_namespaces=(),
111
116
  )
@@ -116,8 +121,7 @@ class ServiceStatus(BaseModel):
116
121
 
117
122
  def to_json(self) -> str:
118
123
  """Returns the JSON representation of the model using alias"""
119
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
120
- return json.dumps(self.to_dict())
124
+ return json.dumps(to_jsonable_python(self.to_dict()))
121
125
 
122
126
  @classmethod
123
127
  def from_json(cls, json_str: str) -> Optional[Self]: