stackit-edge 0.2.0__tar.gz → 0.4.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 (28) hide show
  1. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/PKG-INFO +1 -1
  2. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/pyproject.toml +1 -1
  3. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/api/default_api.py +0 -215
  4. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/api_client.py +15 -17
  5. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/bad_request.py +4 -3
  6. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/create_instance_payload.py +4 -3
  7. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/instance.py +4 -3
  8. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/instance_list.py +4 -3
  9. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/kubeconfig.py +4 -3
  10. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/plan.py +4 -3
  11. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/plan_list.py +4 -3
  12. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/token.py +4 -3
  13. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/unauthorized_request.py +4 -3
  14. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/update_instance_by_name_payload.py +4 -3
  15. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/update_instance_payload.py +4 -3
  16. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/user.py +4 -3
  17. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/.gitignore +0 -0
  18. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/LICENSE.md +0 -0
  19. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/NOTICE.txt +0 -0
  20. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/README.md +0 -0
  21. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/__init__.py +0 -0
  22. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/api/__init__.py +0 -0
  23. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/api_response.py +0 -0
  24. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/configuration.py +0 -0
  25. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/exceptions.py +0 -0
  26. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/models/__init__.py +0 -0
  27. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/py.typed +0 -0
  28. {stackit_edge-0.2.0 → stackit_edge-0.4.0}/src/stackit/edge/rest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackit-edge
3
- Version: 0.2.0
3
+ Version: 0.4.0
4
4
  Summary: STACKIT Edge Cloud 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-edge"
3
- version = "v0.2.0"
3
+ version = "v0.4.0"
4
4
  description = "STACKIT Edge Cloud API"
5
5
  authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }]
6
6
  requires-python = ">=3.9,<4"
@@ -11,7 +11,6 @@
11
11
  Do not edit the class manually.
12
12
  """ # noqa: E501
13
13
 
14
- import warnings
15
14
  from typing import Any, Dict, List, Optional, Tuple, Union
16
15
  from uuid import UUID
17
16
 
@@ -2878,220 +2877,6 @@ class DefaultApi:
2878
2877
  _request_auth=_request_auth,
2879
2878
  )
2880
2879
 
2881
- @validate_call
2882
- def list_plans_global(
2883
- self,
2884
- _request_timeout: Union[
2885
- None,
2886
- Annotated[StrictFloat, Field(gt=0)],
2887
- Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2888
- ] = None,
2889
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2890
- _content_type: Optional[StrictStr] = None,
2891
- _headers: Optional[Dict[StrictStr, Any]] = None,
2892
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2893
- ) -> PlanList:
2894
- """(Deprecated) list_plans_global
2895
-
2896
- DEPRECATED: Will be removed at the 28 of february 2026. Use list-plans-project instead.
2897
-
2898
- :param _request_timeout: timeout setting for this request. If one
2899
- number provided, it will be total request
2900
- timeout. It can also be a pair (tuple) of
2901
- (connection, read) timeouts.
2902
- :type _request_timeout: int, tuple(int, int), optional
2903
- :param _request_auth: set to override the auth_settings for an a single
2904
- request; this effectively ignores the
2905
- authentication in the spec for a single request.
2906
- :type _request_auth: dict, optional
2907
- :param _content_type: force content-type for the request.
2908
- :type _content_type: str, Optional
2909
- :param _headers: set to override the headers for a single
2910
- request; this effectively ignores the headers
2911
- in the spec for a single request.
2912
- :type _headers: dict, optional
2913
- :param _host_index: set to override the host_index for a single
2914
- request; this effectively ignores the host_index
2915
- in the spec for a single request.
2916
- :type _host_index: int, optional
2917
- :return: Returns the result object.
2918
- """ # noqa: E501
2919
- warnings.warn("GET /v1beta1/plans is deprecated.", DeprecationWarning)
2920
-
2921
- _param = self._list_plans_global_serialize(
2922
- _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
2923
- )
2924
-
2925
- _response_types_map: Dict[str, Optional[str]] = {
2926
- "200": "PlanList",
2927
- "400": "BadRequest",
2928
- "401": "UnauthorizedRequest",
2929
- "500": None,
2930
- }
2931
- response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2932
- response_data.read()
2933
- return self.api_client.response_deserialize(
2934
- response_data=response_data,
2935
- response_types_map=_response_types_map,
2936
- ).data
2937
-
2938
- @validate_call
2939
- def list_plans_global_with_http_info(
2940
- self,
2941
- _request_timeout: Union[
2942
- None,
2943
- Annotated[StrictFloat, Field(gt=0)],
2944
- Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2945
- ] = None,
2946
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2947
- _content_type: Optional[StrictStr] = None,
2948
- _headers: Optional[Dict[StrictStr, Any]] = None,
2949
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2950
- ) -> ApiResponse[PlanList]:
2951
- """(Deprecated) list_plans_global
2952
-
2953
- DEPRECATED: Will be removed at the 28 of february 2026. Use list-plans-project instead.
2954
-
2955
- :param _request_timeout: timeout setting for this request. If one
2956
- number provided, it will be total request
2957
- timeout. It can also be a pair (tuple) of
2958
- (connection, read) timeouts.
2959
- :type _request_timeout: int, tuple(int, int), optional
2960
- :param _request_auth: set to override the auth_settings for an a single
2961
- request; this effectively ignores the
2962
- authentication in the spec for a single request.
2963
- :type _request_auth: dict, optional
2964
- :param _content_type: force content-type for the request.
2965
- :type _content_type: str, Optional
2966
- :param _headers: set to override the headers for a single
2967
- request; this effectively ignores the headers
2968
- in the spec for a single request.
2969
- :type _headers: dict, optional
2970
- :param _host_index: set to override the host_index for a single
2971
- request; this effectively ignores the host_index
2972
- in the spec for a single request.
2973
- :type _host_index: int, optional
2974
- :return: Returns the result object.
2975
- """ # noqa: E501
2976
- warnings.warn("GET /v1beta1/plans is deprecated.", DeprecationWarning)
2977
-
2978
- _param = self._list_plans_global_serialize(
2979
- _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
2980
- )
2981
-
2982
- _response_types_map: Dict[str, Optional[str]] = {
2983
- "200": "PlanList",
2984
- "400": "BadRequest",
2985
- "401": "UnauthorizedRequest",
2986
- "500": None,
2987
- }
2988
- response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2989
- response_data.read()
2990
- return self.api_client.response_deserialize(
2991
- response_data=response_data,
2992
- response_types_map=_response_types_map,
2993
- )
2994
-
2995
- @validate_call
2996
- def list_plans_global_without_preload_content(
2997
- self,
2998
- _request_timeout: Union[
2999
- None,
3000
- Annotated[StrictFloat, Field(gt=0)],
3001
- Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
3002
- ] = None,
3003
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3004
- _content_type: Optional[StrictStr] = None,
3005
- _headers: Optional[Dict[StrictStr, Any]] = None,
3006
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3007
- ) -> RESTResponseType:
3008
- """(Deprecated) list_plans_global
3009
-
3010
- DEPRECATED: Will be removed at the 28 of february 2026. Use list-plans-project instead.
3011
-
3012
- :param _request_timeout: timeout setting for this request. If one
3013
- number provided, it will be total request
3014
- timeout. It can also be a pair (tuple) of
3015
- (connection, read) timeouts.
3016
- :type _request_timeout: int, tuple(int, int), optional
3017
- :param _request_auth: set to override the auth_settings for an a single
3018
- request; this effectively ignores the
3019
- authentication in the spec for a single request.
3020
- :type _request_auth: dict, optional
3021
- :param _content_type: force content-type for the request.
3022
- :type _content_type: str, Optional
3023
- :param _headers: set to override the headers for a single
3024
- request; this effectively ignores the headers
3025
- in the spec for a single request.
3026
- :type _headers: dict, optional
3027
- :param _host_index: set to override the host_index for a single
3028
- request; this effectively ignores the host_index
3029
- in the spec for a single request.
3030
- :type _host_index: int, optional
3031
- :return: Returns the result object.
3032
- """ # noqa: E501
3033
- warnings.warn("GET /v1beta1/plans is deprecated.", DeprecationWarning)
3034
-
3035
- _param = self._list_plans_global_serialize(
3036
- _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
3037
- )
3038
-
3039
- _response_types_map: Dict[str, Optional[str]] = {
3040
- "200": "PlanList",
3041
- "400": "BadRequest",
3042
- "401": "UnauthorizedRequest",
3043
- "500": None,
3044
- }
3045
- response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
3046
- return response_data.response
3047
-
3048
- def _list_plans_global_serialize(
3049
- self,
3050
- _request_auth,
3051
- _content_type,
3052
- _headers,
3053
- _host_index,
3054
- ) -> RequestSerialized:
3055
-
3056
- _host = None
3057
-
3058
- _collection_formats: Dict[str, str] = {}
3059
-
3060
- _path_params: Dict[str, str] = {}
3061
- _query_params: List[Tuple[str, str]] = []
3062
- _header_params: Dict[str, Optional[str]] = _headers or {}
3063
- _form_params: List[Tuple[str, str]] = []
3064
- _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
3065
- _body_params: Optional[bytes] = None
3066
-
3067
- # process the path parameters
3068
- # process the query parameters
3069
- # process the header parameters
3070
- # process the form parameters
3071
- # process the body parameter
3072
-
3073
- # set the HTTP header `Accept`
3074
- if "Accept" not in _header_params:
3075
- _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
3076
-
3077
- # authentication setting
3078
- _auth_settings: List[str] = []
3079
-
3080
- return self.api_client.param_serialize(
3081
- method="GET",
3082
- resource_path="/v1beta1/plans",
3083
- path_params=_path_params,
3084
- query_params=_query_params,
3085
- header_params=_header_params,
3086
- body=_body_params,
3087
- post_params=_form_params,
3088
- files=_files,
3089
- auth_settings=_auth_settings,
3090
- collection_formats=_collection_formats,
3091
- _host=_host,
3092
- _request_auth=_request_auth,
3093
- )
3094
-
3095
2880
  @validate_call
3096
2881
  def list_plans_project(
3097
2882
  self,
@@ -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, 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 BadRequest(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["code", "message"]
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 BadRequest(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 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
  from uuid import UUID
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Annotated, Self
23
24
 
24
25
 
@@ -37,7 +38,8 @@ class CreateInstancePayload(BaseModel):
37
38
  __properties: ClassVar[List[str]] = ["description", "displayName", "planId"]
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 CreateInstancePayload(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]:
@@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
21
21
  from uuid import UUID
22
22
 
23
23
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
24
+ from pydantic_core import to_jsonable_python
24
25
  from typing_extensions import Annotated, Self
25
26
 
26
27
 
@@ -73,7 +74,8 @@ class Instance(BaseModel):
73
74
  return value
74
75
 
75
76
  model_config = ConfigDict(
76
- populate_by_name=True,
77
+ validate_by_name=True,
78
+ validate_by_alias=True,
77
79
  validate_assignment=True,
78
80
  protected_namespaces=(),
79
81
  )
@@ -84,8 +86,7 @@ class Instance(BaseModel):
84
86
 
85
87
  def to_json(self) -> str:
86
88
  """Returns the JSON representation of the model using alias"""
87
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
88
- return json.dumps(self.to_dict())
89
+ return json.dumps(to_jsonable_python(self.to_dict()))
89
90
 
90
91
  @classmethod
91
92
  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.edge.models.instance import Instance
@@ -32,7 +33,8 @@ class InstanceList(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["instances"]
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 InstanceList(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
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Self
22
23
 
23
24
 
@@ -30,7 +31,8 @@ class Kubeconfig(BaseModel):
30
31
  __properties: ClassVar[List[str]] = ["kubeconfig"]
31
32
 
32
33
  model_config = ConfigDict(
33
- populate_by_name=True,
34
+ validate_by_name=True,
35
+ validate_by_alias=True,
34
36
  validate_assignment=True,
35
37
  protected_namespaces=(),
36
38
  )
@@ -41,8 +43,7 @@ class Kubeconfig(BaseModel):
41
43
 
42
44
  def to_json(self) -> str:
43
45
  """Returns the JSON representation of the model using alias"""
44
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
45
- return json.dumps(self.to_dict())
46
+ return json.dumps(to_jsonable_python(self.to_dict()))
46
47
 
47
48
  @classmethod
48
49
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -19,6 +19,7 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
  from uuid import UUID
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
 
@@ -39,7 +40,8 @@ class Plan(BaseModel):
39
40
  __properties: ClassVar[List[str]] = ["description", "id", "maxEdgeHosts", "minEdgeHosts", "name"]
40
41
 
41
42
  model_config = ConfigDict(
42
- populate_by_name=True,
43
+ validate_by_name=True,
44
+ validate_by_alias=True,
43
45
  validate_assignment=True,
44
46
  protected_namespaces=(),
45
47
  )
@@ -50,8 +52,7 @@ class Plan(BaseModel):
50
52
 
51
53
  def to_json(self) -> str:
52
54
  """Returns the JSON representation of the model using alias"""
53
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
- return json.dumps(self.to_dict())
55
+ return json.dumps(to_jsonable_python(self.to_dict()))
55
56
 
56
57
  @classmethod
57
58
  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 Self
22
23
 
23
24
  from stackit.edge.models.plan import Plan
@@ -32,7 +33,8 @@ class PlanList(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["validPlans"]
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 PlanList(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, StrictStr
21
+ from pydantic_core import to_jsonable_python
21
22
  from typing_extensions import Self
22
23
 
23
24
 
@@ -30,7 +31,8 @@ class Token(BaseModel):
30
31
  __properties: ClassVar[List[str]] = ["token"]
31
32
 
32
33
  model_config = ConfigDict(
33
- populate_by_name=True,
34
+ validate_by_name=True,
35
+ validate_by_alias=True,
34
36
  validate_assignment=True,
35
37
  protected_namespaces=(),
36
38
  )
@@ -41,8 +43,7 @@ class Token(BaseModel):
41
43
 
42
44
  def to_json(self) -> str:
43
45
  """Returns the JSON representation of the model using alias"""
44
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
45
- return json.dumps(self.to_dict())
46
+ return json.dumps(to_jsonable_python(self.to_dict()))
46
47
 
47
48
  @classmethod
48
49
  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, 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 UnauthorizedRequest(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["code", "message"]
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 UnauthorizedRequest(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 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
  from uuid import UUID
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Annotated, Self
23
24
 
24
25
 
@@ -36,7 +37,8 @@ class UpdateInstanceByNamePayload(BaseModel):
36
37
  __properties: ClassVar[List[str]] = ["description", "planId"]
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 UpdateInstanceByNamePayload(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 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
  from uuid import UUID
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field
22
+ from pydantic_core import to_jsonable_python
22
23
  from typing_extensions import Annotated, Self
23
24
 
24
25
 
@@ -36,7 +37,8 @@ class UpdateInstancePayload(BaseModel):
36
37
  __properties: ClassVar[List[str]] = ["description", "planId"]
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 UpdateInstancePayload(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 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
19
19
  from uuid import UUID
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 User(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["email", "internalId"]
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 User(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]:
File without changes
File without changes
File without changes
File without changes