qubitclient 0.0.0.1__py3-none-any.whl → 0.0.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.

Potentially problematic release.


This version of qubitclient might be problematic. Click here for more details.

Files changed (53) hide show
  1. qubitclient/__init__.py +6 -1
  2. qubitclient/nnscope/nnscope.py +51 -0
  3. qubitclient/{QubitSeg.py → nnscope/nnscope_api/QubitSeg.py} +7 -7
  4. qubitclient/nnscope/nnscope_api/curve/__init__.py +0 -0
  5. qubitclient/nnscope/nnscope_api/curve/curve_type.py +15 -0
  6. qubitclient/nnscope/task.py +130 -0
  7. qubitclient/nnscope/utils/data_convert.py +114 -0
  8. qubitclient/nnscope/utils/data_parser.py +41 -0
  9. qubitclient/nnscope/utils/request_tool.py +41 -0
  10. qubitclient/nnscope/utils/result_parser.py +55 -0
  11. qubitclient/scope/scope.py +51 -0
  12. qubitclient/scope/scope_api/__init__.py +8 -0
  13. qubitclient/scope/scope_api/api/__init__.py +1 -0
  14. qubitclient/scope/scope_api/api/defined_tasks/__init__.py +1 -0
  15. qubitclient/scope/scope_api/api/defined_tasks/get_task_result_api_v1_tasks_demo_pk_get.py +155 -0
  16. qubitclient/scope/scope_api/api/defined_tasks/get_task_result_api_v1_tasks_scope_pk_get.py +155 -0
  17. qubitclient/scope/scope_api/api/defined_tasks/optpipulse_api_v1_tasks_scope_optpipulse_post.py +218 -0
  18. qubitclient/scope/scope_api/api/defined_tasks/rabi_api_v1_tasks_scope_rabi_post.py +218 -0
  19. qubitclient/scope/scope_api/api/defined_tasks/rabicos_api_v1_tasks_scope_rabicospeak_post.py +218 -0
  20. qubitclient/scope/scope_api/api/defined_tasks/s21peak_api_v1_tasks_scope_s21peak_post.py +218 -0
  21. qubitclient/scope/scope_api/api/defined_tasks/s21vflux_api_v1_tasks_scope_s21vflux_post.py +218 -0
  22. qubitclient/scope/scope_api/api/defined_tasks/singleshot_api_v1_tasks_scope_singleshot_post.py +218 -0
  23. qubitclient/scope/scope_api/api/defined_tasks/spectrum2d_api_v1_tasks_scope_spectrum2d_post.py +218 -0
  24. qubitclient/scope/scope_api/api/defined_tasks/spectrum_api_v1_tasks_scope_spectrum_post.py +218 -0
  25. qubitclient/scope/scope_api/api/defined_tasks/t1fit_api_v1_tasks_scope_t1fit_post.py +218 -0
  26. qubitclient/scope/scope_api/api/defined_tasks/t1fit_api_v1_tasks_scope_t2fit_post.py +218 -0
  27. qubitclient/scope/scope_api/client.py +268 -0
  28. qubitclient/scope/scope_api/errors.py +16 -0
  29. qubitclient/scope/scope_api/models/__init__.py +29 -0
  30. qubitclient/scope/scope_api/models/body_optpipulse_api_v1_tasks_scope_optpipulse_post.py +83 -0
  31. qubitclient/scope/scope_api/models/body_rabi_api_v1_tasks_scope_rabi_post.py +83 -0
  32. qubitclient/scope/scope_api/models/body_rabicos_api_v1_tasks_scope_rabicospeak_post.py +83 -0
  33. qubitclient/scope/scope_api/models/body_s21_peak_api_v1_tasks_scope_s21_peak_post.py +83 -0
  34. qubitclient/scope/scope_api/models/body_s21_vflux_api_v1_tasks_scope_s21_vflux_post.py +83 -0
  35. qubitclient/scope/scope_api/models/body_singleshot_api_v1_tasks_scope_singleshot_post.py +83 -0
  36. qubitclient/scope/scope_api/models/body_spectrum_2d_api_v1_tasks_scope_spectrum_2d_post.py +83 -0
  37. qubitclient/scope/scope_api/models/body_spectrum_api_v1_tasks_scope_spectrum_post.py +83 -0
  38. qubitclient/scope/scope_api/models/body_t1_fit_api_v1_tasks_scope_t1_fit_post.py +83 -0
  39. qubitclient/scope/scope_api/models/body_t1_fit_api_v1_tasks_scope_t2_fit_post.py +83 -0
  40. qubitclient/scope/scope_api/models/http_validation_error.py +75 -0
  41. qubitclient/scope/scope_api/models/validation_error.py +88 -0
  42. qubitclient/scope/scope_api/types.py +54 -0
  43. qubitclient/scope/task.py +147 -0
  44. qubitclient/scope/utils/__init__.py +0 -0
  45. qubitclient/scope/utils/data_parser.py +20 -0
  46. qubitclient-0.0.3.0.dist-info/METADATA +112 -0
  47. qubitclient-0.0.3.0.dist-info/RECORD +51 -0
  48. qubitclient-0.0.0.1.dist-info/METADATA +0 -35
  49. qubitclient-0.0.0.1.dist-info/RECORD +0 -8
  50. {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/WHEEL +0 -0
  51. {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/licenses/LICENSE +0 -0
  52. {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/top_level.txt +0 -0
  53. {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/zip-safe +0 -0
@@ -0,0 +1,83 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from .. import types
9
+ from ..types import File
10
+
11
+ T = TypeVar("T", bound="BodyS21VfluxApiV1TasksScopeS21VfluxPost")
12
+
13
+
14
+ @_attrs_define
15
+ class BodyS21VfluxApiV1TasksScopeS21VfluxPost:
16
+ """
17
+ Attributes:
18
+ files (list[File]):
19
+ """
20
+
21
+ files: list[File]
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ files = []
26
+ for files_item_data in self.files:
27
+ files_item = files_item_data.to_tuple()
28
+
29
+ files.append(files_item)
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "files": files,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ def to_multipart(self) -> types.RequestFiles:
42
+ files: types.RequestFiles = []
43
+
44
+ for files_item_element in self.files:
45
+ files.append(("files", files_item_element.to_tuple()))
46
+
47
+ for prop_name, prop in self.additional_properties.items():
48
+ files.append((prop_name, (None, str(prop).encode(), "text/plain")))
49
+
50
+ return files
51
+
52
+ @classmethod
53
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
54
+ d = dict(src_dict)
55
+ files = []
56
+ _files = d.pop("files")
57
+ for files_item_data in _files:
58
+ files_item = File(payload=BytesIO(files_item_data))
59
+
60
+ files.append(files_item)
61
+
62
+ body_s21_vflux_api_v1_tasks_scope_s21_vflux_post = cls(
63
+ files=files,
64
+ )
65
+
66
+ body_s21_vflux_api_v1_tasks_scope_s21_vflux_post.additional_properties = d
67
+ return body_s21_vflux_api_v1_tasks_scope_s21_vflux_post
68
+
69
+ @property
70
+ def additional_keys(self) -> list[str]:
71
+ return list(self.additional_properties.keys())
72
+
73
+ def __getitem__(self, key: str) -> Any:
74
+ return self.additional_properties[key]
75
+
76
+ def __setitem__(self, key: str, value: Any) -> None:
77
+ self.additional_properties[key] = value
78
+
79
+ def __delitem__(self, key: str) -> None:
80
+ del self.additional_properties[key]
81
+
82
+ def __contains__(self, key: str) -> bool:
83
+ return key in self.additional_properties
@@ -0,0 +1,83 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from .. import types
9
+ from ..types import File
10
+
11
+ T = TypeVar("T", bound="BodySingleshotApiV1TasksScopeSingleshotPost")
12
+
13
+
14
+ @_attrs_define
15
+ class BodySingleshotApiV1TasksScopeSingleshotPost:
16
+ """
17
+ Attributes:
18
+ files (list[File]):
19
+ """
20
+
21
+ files: list[File]
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ files = []
26
+ for files_item_data in self.files:
27
+ files_item = files_item_data.to_tuple()
28
+
29
+ files.append(files_item)
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "files": files,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ def to_multipart(self) -> types.RequestFiles:
42
+ files: types.RequestFiles = []
43
+
44
+ for files_item_element in self.files:
45
+ files.append(("files", files_item_element.to_tuple()))
46
+
47
+ for prop_name, prop in self.additional_properties.items():
48
+ files.append((prop_name, (None, str(prop).encode(), "text/plain")))
49
+
50
+ return files
51
+
52
+ @classmethod
53
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
54
+ d = dict(src_dict)
55
+ files = []
56
+ _files = d.pop("files")
57
+ for files_item_data in _files:
58
+ files_item = File(payload=BytesIO(files_item_data))
59
+
60
+ files.append(files_item)
61
+
62
+ body_singleshot_api_v1_tasks_scope_singleshot_post = cls(
63
+ files=files,
64
+ )
65
+
66
+ body_singleshot_api_v1_tasks_scope_singleshot_post.additional_properties = d
67
+ return body_singleshot_api_v1_tasks_scope_singleshot_post
68
+
69
+ @property
70
+ def additional_keys(self) -> list[str]:
71
+ return list(self.additional_properties.keys())
72
+
73
+ def __getitem__(self, key: str) -> Any:
74
+ return self.additional_properties[key]
75
+
76
+ def __setitem__(self, key: str, value: Any) -> None:
77
+ self.additional_properties[key] = value
78
+
79
+ def __delitem__(self, key: str) -> None:
80
+ del self.additional_properties[key]
81
+
82
+ def __contains__(self, key: str) -> bool:
83
+ return key in self.additional_properties
@@ -0,0 +1,83 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from .. import types
9
+ from ..types import File
10
+
11
+ T = TypeVar("T", bound="BodySpectrum2DApiV1TasksScopeSpectrum2DPost")
12
+
13
+
14
+ @_attrs_define
15
+ class BodySpectrum2DApiV1TasksScopeSpectrum2DPost:
16
+ """
17
+ Attributes:
18
+ files (list[File]):
19
+ """
20
+
21
+ files: list[File]
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ files = []
26
+ for files_item_data in self.files:
27
+ files_item = files_item_data.to_tuple()
28
+
29
+ files.append(files_item)
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "files": files,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ def to_multipart(self) -> types.RequestFiles:
42
+ files: types.RequestFiles = []
43
+
44
+ for files_item_element in self.files:
45
+ files.append(("files", files_item_element.to_tuple()))
46
+
47
+ for prop_name, prop in self.additional_properties.items():
48
+ files.append((prop_name, (None, str(prop).encode(), "text/plain")))
49
+
50
+ return files
51
+
52
+ @classmethod
53
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
54
+ d = dict(src_dict)
55
+ files = []
56
+ _files = d.pop("files")
57
+ for files_item_data in _files:
58
+ files_item = File(payload=BytesIO(files_item_data))
59
+
60
+ files.append(files_item)
61
+
62
+ body_spectrum_2d_api_v1_tasks_scope_spectrum_2d_post = cls(
63
+ files=files,
64
+ )
65
+
66
+ body_spectrum_2d_api_v1_tasks_scope_spectrum_2d_post.additional_properties = d
67
+ return body_spectrum_2d_api_v1_tasks_scope_spectrum_2d_post
68
+
69
+ @property
70
+ def additional_keys(self) -> list[str]:
71
+ return list(self.additional_properties.keys())
72
+
73
+ def __getitem__(self, key: str) -> Any:
74
+ return self.additional_properties[key]
75
+
76
+ def __setitem__(self, key: str, value: Any) -> None:
77
+ self.additional_properties[key] = value
78
+
79
+ def __delitem__(self, key: str) -> None:
80
+ del self.additional_properties[key]
81
+
82
+ def __contains__(self, key: str) -> bool:
83
+ return key in self.additional_properties
@@ -0,0 +1,83 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from .. import types
9
+ from ..types import File
10
+
11
+ T = TypeVar("T", bound="BodySpectrumApiV1TasksScopeSpectrumPost")
12
+
13
+
14
+ @_attrs_define
15
+ class BodySpectrumApiV1TasksScopeSpectrumPost:
16
+ """
17
+ Attributes:
18
+ files (list[File]):
19
+ """
20
+
21
+ files: list[File]
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ files = []
26
+ for files_item_data in self.files:
27
+ files_item = files_item_data.to_tuple()
28
+
29
+ files.append(files_item)
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "files": files,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ def to_multipart(self) -> types.RequestFiles:
42
+ files: types.RequestFiles = []
43
+
44
+ for files_item_element in self.files:
45
+ files.append(("files", files_item_element.to_tuple()))
46
+
47
+ for prop_name, prop in self.additional_properties.items():
48
+ files.append((prop_name, (None, str(prop).encode(), "text/plain")))
49
+
50
+ return files
51
+
52
+ @classmethod
53
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
54
+ d = dict(src_dict)
55
+ files = []
56
+ _files = d.pop("files")
57
+ for files_item_data in _files:
58
+ files_item = File(payload=BytesIO(files_item_data))
59
+
60
+ files.append(files_item)
61
+
62
+ body_spectrum_api_v1_tasks_scope_spectrum_post = cls(
63
+ files=files,
64
+ )
65
+
66
+ body_spectrum_api_v1_tasks_scope_spectrum_post.additional_properties = d
67
+ return body_spectrum_api_v1_tasks_scope_spectrum_post
68
+
69
+ @property
70
+ def additional_keys(self) -> list[str]:
71
+ return list(self.additional_properties.keys())
72
+
73
+ def __getitem__(self, key: str) -> Any:
74
+ return self.additional_properties[key]
75
+
76
+ def __setitem__(self, key: str, value: Any) -> None:
77
+ self.additional_properties[key] = value
78
+
79
+ def __delitem__(self, key: str) -> None:
80
+ del self.additional_properties[key]
81
+
82
+ def __contains__(self, key: str) -> bool:
83
+ return key in self.additional_properties
@@ -0,0 +1,83 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from .. import types
9
+ from ..types import File
10
+
11
+ T = TypeVar("T", bound="BodyT1FitApiV1TasksScopeT1FitPost")
12
+
13
+
14
+ @_attrs_define
15
+ class BodyT1FitApiV1TasksScopeT1FitPost:
16
+ """
17
+ Attributes:
18
+ files (list[File]):
19
+ """
20
+
21
+ files: list[File]
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ files = []
26
+ for files_item_data in self.files:
27
+ files_item = files_item_data.to_tuple()
28
+
29
+ files.append(files_item)
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "files": files,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ def to_multipart(self) -> types.RequestFiles:
42
+ files: types.RequestFiles = []
43
+
44
+ for files_item_element in self.files:
45
+ files.append(("files", files_item_element.to_tuple()))
46
+
47
+ for prop_name, prop in self.additional_properties.items():
48
+ files.append((prop_name, (None, str(prop).encode(), "text/plain")))
49
+
50
+ return files
51
+
52
+ @classmethod
53
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
54
+ d = dict(src_dict)
55
+ files = []
56
+ _files = d.pop("files")
57
+ for files_item_data in _files:
58
+ files_item = File(payload=BytesIO(files_item_data))
59
+
60
+ files.append(files_item)
61
+
62
+ body_t1_fit_api_v1_tasks_scope_t1_fit_post = cls(
63
+ files=files,
64
+ )
65
+
66
+ body_t1_fit_api_v1_tasks_scope_t1_fit_post.additional_properties = d
67
+ return body_t1_fit_api_v1_tasks_scope_t1_fit_post
68
+
69
+ @property
70
+ def additional_keys(self) -> list[str]:
71
+ return list(self.additional_properties.keys())
72
+
73
+ def __getitem__(self, key: str) -> Any:
74
+ return self.additional_properties[key]
75
+
76
+ def __setitem__(self, key: str, value: Any) -> None:
77
+ self.additional_properties[key] = value
78
+
79
+ def __delitem__(self, key: str) -> None:
80
+ del self.additional_properties[key]
81
+
82
+ def __contains__(self, key: str) -> bool:
83
+ return key in self.additional_properties
@@ -0,0 +1,83 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from .. import types
9
+ from ..types import File
10
+
11
+ T = TypeVar("T", bound="BodyT1FitApiV1TasksScopeT2FitPost")
12
+
13
+
14
+ @_attrs_define
15
+ class BodyT1FitApiV1TasksScopeT2FitPost:
16
+ """
17
+ Attributes:
18
+ files (list[File]):
19
+ """
20
+
21
+ files: list[File]
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ files = []
26
+ for files_item_data in self.files:
27
+ files_item = files_item_data.to_tuple()
28
+
29
+ files.append(files_item)
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update(
34
+ {
35
+ "files": files,
36
+ }
37
+ )
38
+
39
+ return field_dict
40
+
41
+ def to_multipart(self) -> types.RequestFiles:
42
+ files: types.RequestFiles = []
43
+
44
+ for files_item_element in self.files:
45
+ files.append(("files", files_item_element.to_tuple()))
46
+
47
+ for prop_name, prop in self.additional_properties.items():
48
+ files.append((prop_name, (None, str(prop).encode(), "text/plain")))
49
+
50
+ return files
51
+
52
+ @classmethod
53
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
54
+ d = dict(src_dict)
55
+ files = []
56
+ _files = d.pop("files")
57
+ for files_item_data in _files:
58
+ files_item = File(payload=BytesIO(files_item_data))
59
+
60
+ files.append(files_item)
61
+
62
+ body_t1_fit_api_v1_tasks_scope_t2_fit_post = cls(
63
+ files=files,
64
+ )
65
+
66
+ body_t1_fit_api_v1_tasks_scope_t2_fit_post.additional_properties = d
67
+ return body_t1_fit_api_v1_tasks_scope_t2_fit_post
68
+
69
+ @property
70
+ def additional_keys(self) -> list[str]:
71
+ return list(self.additional_properties.keys())
72
+
73
+ def __getitem__(self, key: str) -> Any:
74
+ return self.additional_properties[key]
75
+
76
+ def __setitem__(self, key: str, value: Any) -> None:
77
+ self.additional_properties[key] = value
78
+
79
+ def __delitem__(self, key: str) -> None:
80
+ del self.additional_properties[key]
81
+
82
+ def __contains__(self, key: str) -> bool:
83
+ return key in self.additional_properties
@@ -0,0 +1,75 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.validation_error import ValidationError
11
+
12
+
13
+ T = TypeVar("T", bound="HTTPValidationError")
14
+
15
+
16
+ @_attrs_define
17
+ class HTTPValidationError:
18
+ """
19
+ Attributes:
20
+ detail (Union[Unset, list['ValidationError']]):
21
+ """
22
+
23
+ detail: Union[Unset, list["ValidationError"]] = UNSET
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ detail: Union[Unset, list[dict[str, Any]]] = UNSET
28
+ if not isinstance(self.detail, Unset):
29
+ detail = []
30
+ for detail_item_data in self.detail:
31
+ detail_item = detail_item_data.to_dict()
32
+ detail.append(detail_item)
33
+
34
+ field_dict: dict[str, Any] = {}
35
+ field_dict.update(self.additional_properties)
36
+ field_dict.update({})
37
+ if detail is not UNSET:
38
+ field_dict["detail"] = detail
39
+
40
+ return field_dict
41
+
42
+ @classmethod
43
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
44
+ from ..models.validation_error import ValidationError
45
+
46
+ d = dict(src_dict)
47
+ detail = []
48
+ _detail = d.pop("detail", UNSET)
49
+ for detail_item_data in _detail or []:
50
+ detail_item = ValidationError.from_dict(detail_item_data)
51
+
52
+ detail.append(detail_item)
53
+
54
+ http_validation_error = cls(
55
+ detail=detail,
56
+ )
57
+
58
+ http_validation_error.additional_properties = d
59
+ return http_validation_error
60
+
61
+ @property
62
+ def additional_keys(self) -> list[str]:
63
+ return list(self.additional_properties.keys())
64
+
65
+ def __getitem__(self, key: str) -> Any:
66
+ return self.additional_properties[key]
67
+
68
+ def __setitem__(self, key: str, value: Any) -> None:
69
+ self.additional_properties[key] = value
70
+
71
+ def __delitem__(self, key: str) -> None:
72
+ del self.additional_properties[key]
73
+
74
+ def __contains__(self, key: str) -> bool:
75
+ return key in self.additional_properties
@@ -0,0 +1,88 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ T = TypeVar("T", bound="ValidationError")
8
+
9
+
10
+ @_attrs_define
11
+ class ValidationError:
12
+ """
13
+ Attributes:
14
+ loc (list[Union[int, str]]):
15
+ msg (str):
16
+ type_ (str):
17
+ """
18
+
19
+ loc: list[Union[int, str]]
20
+ msg: str
21
+ type_: str
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ loc = []
26
+ for loc_item_data in self.loc:
27
+ loc_item: Union[int, str]
28
+ loc_item = loc_item_data
29
+ loc.append(loc_item)
30
+
31
+ msg = self.msg
32
+
33
+ type_ = self.type_
34
+
35
+ field_dict: dict[str, Any] = {}
36
+ field_dict.update(self.additional_properties)
37
+ field_dict.update(
38
+ {
39
+ "loc": loc,
40
+ "msg": msg,
41
+ "type": type_,
42
+ }
43
+ )
44
+
45
+ return field_dict
46
+
47
+ @classmethod
48
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
49
+ d = dict(src_dict)
50
+ loc = []
51
+ _loc = d.pop("loc")
52
+ for loc_item_data in _loc:
53
+
54
+ def _parse_loc_item(data: object) -> Union[int, str]:
55
+ return cast(Union[int, str], data)
56
+
57
+ loc_item = _parse_loc_item(loc_item_data)
58
+
59
+ loc.append(loc_item)
60
+
61
+ msg = d.pop("msg")
62
+
63
+ type_ = d.pop("type")
64
+
65
+ validation_error = cls(
66
+ loc=loc,
67
+ msg=msg,
68
+ type_=type_,
69
+ )
70
+
71
+ validation_error.additional_properties = d
72
+ return validation_error
73
+
74
+ @property
75
+ def additional_keys(self) -> list[str]:
76
+ return list(self.additional_properties.keys())
77
+
78
+ def __getitem__(self, key: str) -> Any:
79
+ return self.additional_properties[key]
80
+
81
+ def __setitem__(self, key: str, value: Any) -> None:
82
+ self.additional_properties[key] = value
83
+
84
+ def __delitem__(self, key: str) -> None:
85
+ del self.additional_properties[key]
86
+
87
+ def __contains__(self, key: str) -> bool:
88
+ return key in self.additional_properties