platform-api-python-client 0.1.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 (59) hide show
  1. platform_api_python_client/__init__.py +78 -0
  2. platform_api_python_client/api/__init__.py +5 -0
  3. platform_api_python_client/api/external_api.py +7341 -0
  4. platform_api_python_client/api_client.py +797 -0
  5. platform_api_python_client/api_response.py +21 -0
  6. platform_api_python_client/configuration.py +458 -0
  7. platform_api_python_client/exceptions.py +199 -0
  8. platform_api_python_client/models/__init__.py +61 -0
  9. platform_api_python_client/models/add_hardware_request.py +87 -0
  10. platform_api_python_client/models/api_key_request.py +87 -0
  11. platform_api_python_client/models/api_key_response.py +92 -0
  12. platform_api_python_client/models/c_serve_recipe_input.py +166 -0
  13. platform_api_python_client/models/c_serve_recipe_output.py +166 -0
  14. platform_api_python_client/models/c_serve_recipe_perf.py +98 -0
  15. platform_api_python_client/models/c_serve_recipe_response.py +105 -0
  16. platform_api_python_client/models/client_secret_response.py +87 -0
  17. platform_api_python_client/models/create_c_serve_deployment_request.py +117 -0
  18. platform_api_python_client/models/create_c_serve_deployment_response.py +92 -0
  19. platform_api_python_client/models/create_compute_deployment_response.py +94 -0
  20. platform_api_python_client/models/create_compute_deployment_v2_request.py +107 -0
  21. platform_api_python_client/models/create_inference_deployment_response.py +92 -0
  22. platform_api_python_client/models/create_inference_deployment_v2_request.py +141 -0
  23. platform_api_python_client/models/create_payment_request.py +89 -0
  24. platform_api_python_client/models/credits_response.py +87 -0
  25. platform_api_python_client/models/daily_bill_response.py +90 -0
  26. platform_api_python_client/models/deployment_status.py +38 -0
  27. platform_api_python_client/models/deployment_status_request.py +88 -0
  28. platform_api_python_client/models/deployment_status_response_v2.py +115 -0
  29. platform_api_python_client/models/deployment_type.py +43 -0
  30. platform_api_python_client/models/deployment_usage_value.py +89 -0
  31. platform_api_python_client/models/feedback_request.py +91 -0
  32. platform_api_python_client/models/get_c_serve_deployment_response.py +210 -0
  33. platform_api_python_client/models/get_cluster_response.py +89 -0
  34. platform_api_python_client/models/get_compute_v2_deployment_response.py +134 -0
  35. platform_api_python_client/models/get_deployment_log_response.py +94 -0
  36. platform_api_python_client/models/get_deployment_usage_response.py +95 -0
  37. platform_api_python_client/models/get_deployment_v2_response.py +111 -0
  38. platform_api_python_client/models/get_inference_v2_deployment_response.py +145 -0
  39. platform_api_python_client/models/hardware_instance_response.py +99 -0
  40. platform_api_python_client/models/health_status.py +40 -0
  41. platform_api_python_client/models/http_validation_error.py +95 -0
  42. platform_api_python_client/models/list_api_key_response.py +95 -0
  43. platform_api_python_client/models/list_c_serve_recipe_response.py +95 -0
  44. platform_api_python_client/models/list_daily_bill_response.py +95 -0
  45. platform_api_python_client/models/list_get_cluster_response.py +95 -0
  46. platform_api_python_client/models/list_get_deployment_v2_response.py +95 -0
  47. platform_api_python_client/models/list_hardware_instance_response.py +95 -0
  48. platform_api_python_client/models/list_payment_method_response.py +87 -0
  49. platform_api_python_client/models/list_prebuilt_image_response.py +95 -0
  50. platform_api_python_client/models/metric.py +38 -0
  51. platform_api_python_client/models/prebuilt_image_response.py +94 -0
  52. platform_api_python_client/models/validation_error.py +99 -0
  53. platform_api_python_client/models/validation_error_loc_inner.py +138 -0
  54. platform_api_python_client/py.typed +0 -0
  55. platform_api_python_client/rest.py +257 -0
  56. platform_api_python_client-0.1.0.dist-info/METADATA +16 -0
  57. platform_api_python_client-0.1.0.dist-info/RECORD +59 -0
  58. platform_api_python_client-0.1.0.dist-info/WHEEL +5 -0
  59. platform_api_python_client-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List
22
+ from platform_api_python_client.models.get_deployment_v2_response import GetDeploymentV2Response
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ListGetDeploymentV2Response(BaseModel):
27
+ """
28
+ ListGetDeploymentV2Response
29
+ """ # noqa: E501
30
+ results: List[GetDeploymentV2Response]
31
+ __properties: ClassVar[List[str]] = ["results"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """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
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of ListGetDeploymentV2Response from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
73
+ _items = []
74
+ if self.results:
75
+ for _item_results in self.results:
76
+ if _item_results:
77
+ _items.append(_item_results.to_dict())
78
+ _dict['results'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ListGetDeploymentV2Response from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "results": [GetDeploymentV2Response.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List
22
+ from platform_api_python_client.models.hardware_instance_response import HardwareInstanceResponse
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ListHardwareInstanceResponse(BaseModel):
27
+ """
28
+ ListHardwareInstanceResponse
29
+ """ # noqa: E501
30
+ results: List[HardwareInstanceResponse]
31
+ __properties: ClassVar[List[str]] = ["results"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """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
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of ListHardwareInstanceResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
73
+ _items = []
74
+ if self.results:
75
+ for _item_results in self.results:
76
+ if _item_results:
77
+ _items.append(_item_results.to_dict())
78
+ _dict['results'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ListHardwareInstanceResponse from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "results": [HardwareInstanceResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ListPaymentMethodResponse(BaseModel):
26
+ """
27
+ ListPaymentMethodResponse
28
+ """ # noqa: E501
29
+ results: List[Dict[str, Any]]
30
+ __properties: ClassVar[List[str]] = ["results"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """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
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of ListPaymentMethodResponse from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of ListPaymentMethodResponse from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "results": obj.get("results")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List
22
+ from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ListPrebuiltImageResponse(BaseModel):
27
+ """
28
+ ListPrebuiltImageResponse
29
+ """ # noqa: E501
30
+ results: List[PrebuiltImageResponse]
31
+ __properties: ClassVar[List[str]] = ["results"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """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
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of ListPrebuiltImageResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
73
+ _items = []
74
+ if self.results:
75
+ for _item_results in self.results:
76
+ if _item_results:
77
+ _items.append(_item_results.to_dict())
78
+ _dict['results'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ListPrebuiltImageResponse from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "results": [PrebuiltImageResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class Metric(str, Enum):
22
+ """
23
+ Metric
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ CPU = 'cpu'
30
+ MEMORY = 'memory'
31
+ GPU = 'gpu'
32
+
33
+ @classmethod
34
+ def from_json(cls, json_str: str) -> Self:
35
+ """Create an instance of Metric from a JSON string"""
36
+ return cls(json.loads(json_str))
37
+
38
+
@@ -0,0 +1,94 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from platform_api_python_client.models.deployment_type import DeploymentType
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class PrebuiltImageResponse(BaseModel):
27
+ """
28
+ PrebuiltImageResponse
29
+ """ # noqa: E501
30
+ image_name: StrictStr
31
+ label: StrictStr
32
+ tags: List[StrictStr]
33
+ type: DeploymentType
34
+ __properties: ClassVar[List[str]] = ["image_name", "label", "tags", "type"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """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
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of PrebuiltImageResponse from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of PrebuiltImageResponse from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "image_name": obj.get("image_name"),
88
+ "label": obj.get("label"),
89
+ "tags": obj.get("tags"),
90
+ "type": obj.get("type")
91
+ })
92
+ return _obj
93
+
94
+
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from platform_api_python_client.models.validation_error_loc_inner import ValidationErrorLocInner
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ValidationError(BaseModel):
27
+ """
28
+ ValidationError
29
+ """ # noqa: E501
30
+ loc: List[ValidationErrorLocInner]
31
+ msg: StrictStr
32
+ type: StrictStr
33
+ __properties: ClassVar[List[str]] = ["loc", "msg", "type"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """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
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ValidationError from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in loc (list)
75
+ _items = []
76
+ if self.loc:
77
+ for _item_loc in self.loc:
78
+ if _item_loc:
79
+ _items.append(_item_loc.to_dict())
80
+ _dict['loc'] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of ValidationError from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "loc": [ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]] if obj.get("loc") is not None else None,
94
+ "msg": obj.get("msg"),
95
+ "type": obj.get("type")
96
+ })
97
+ return _obj
98
+
99
+