qi-compute-api-client 0.7.0__py3-none-any.whl → 0.17.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 qi-compute-api-client might be problematic. Click here for more details.

Files changed (165) hide show
  1. compute_api_client/__init__.py +22 -19
  2. compute_api_client/api/__init__.py +5 -6
  3. compute_api_client/api/algorithms_api.py +1333 -553
  4. compute_api_client/api/backend_api.py +1501 -0
  5. compute_api_client/api/backend_types_api.py +684 -0
  6. compute_api_client/api/batch_jobs_api.py +1937 -0
  7. compute_api_client/api/commits_api.py +1068 -435
  8. compute_api_client/api/files_api.py +1075 -435
  9. compute_api_client/api/final_results_api.py +736 -338
  10. compute_api_client/api/jobs_api.py +1653 -0
  11. compute_api_client/api/languages_api.py +556 -217
  12. compute_api_client/api/members_api.py +1057 -435
  13. compute_api_client/api/metadata_api.py +736 -337
  14. compute_api_client/api/permissions_api.py +1055 -421
  15. compute_api_client/api/projects_api.py +1604 -676
  16. compute_api_client/api/reservations_api.py +1124 -427
  17. compute_api_client/api/results_api.py +738 -337
  18. compute_api_client/api/teams_api.py +567 -220
  19. compute_api_client/api/transactions_api.py +679 -218
  20. compute_api_client/api/users_api.py +1090 -435
  21. compute_api_client/api_client.py +346 -304
  22. compute_api_client/api_response.py +21 -0
  23. compute_api_client/configuration.py +54 -67
  24. compute_api_client/docs/Algorithm.md +20 -3
  25. compute_api_client/docs/AlgorithmIn.md +20 -3
  26. compute_api_client/docs/AlgorithmType.md +0 -1
  27. compute_api_client/docs/AlgorithmsApi.md +78 -77
  28. compute_api_client/docs/Backend.md +33 -0
  29. compute_api_client/docs/BackendApi.md +419 -0
  30. compute_api_client/docs/BackendPatch.md +29 -0
  31. compute_api_client/docs/{RunStatus.md → BackendStatus.md} +1 -2
  32. compute_api_client/docs/BackendType.md +36 -0
  33. compute_api_client/docs/{RuntimeTypesApi.md → BackendTypesApi.md} +58 -31
  34. compute_api_client/docs/BackendWithAuthentication.md +34 -0
  35. compute_api_client/docs/BatchJob.md +38 -0
  36. compute_api_client/docs/BatchJobIn.md +29 -0
  37. compute_api_client/docs/{RuntimeStatus.md → BatchJobStatus.md} +1 -2
  38. compute_api_client/docs/{BatchRunsApi.md → BatchJobsApi.md} +170 -147
  39. compute_api_client/docs/Commit.md +18 -1
  40. compute_api_client/docs/CommitIn.md +17 -0
  41. compute_api_client/docs/CommitsApi.md +62 -71
  42. compute_api_client/docs/CompileStage.md +0 -1
  43. compute_api_client/docs/Domain.md +0 -1
  44. compute_api_client/docs/File.md +21 -4
  45. compute_api_client/docs/FileIn.md +21 -4
  46. compute_api_client/docs/FilesApi.md +65 -71
  47. compute_api_client/docs/FinalResult.md +20 -3
  48. compute_api_client/docs/FinalResultIn.md +19 -2
  49. compute_api_client/docs/FinalResultsApi.md +44 -71
  50. compute_api_client/docs/HTTPNotFoundError.md +17 -0
  51. compute_api_client/docs/HTTPValidationError.md +18 -1
  52. compute_api_client/docs/Job.md +36 -0
  53. compute_api_client/docs/JobIn.md +31 -0
  54. compute_api_client/docs/JobPatch.md +28 -0
  55. compute_api_client/docs/{BatchRunStatus.md → JobStatus.md} +1 -2
  56. compute_api_client/docs/{RunsApi.md → JobsApi.md} +137 -122
  57. compute_api_client/docs/Language.md +17 -0
  58. compute_api_client/docs/LanguagesApi.md +30 -12
  59. compute_api_client/docs/LocationInner.md +17 -0
  60. compute_api_client/docs/Member.md +19 -2
  61. compute_api_client/docs/MemberIn.md +19 -2
  62. compute_api_client/docs/MembersApi.md +59 -24
  63. compute_api_client/docs/Metadata.md +20 -3
  64. compute_api_client/docs/MetadataApi.md +49 -33
  65. compute_api_client/docs/MetadataIn.md +19 -2
  66. compute_api_client/docs/Permission.md +17 -0
  67. compute_api_client/docs/PermissionGroup.md +17 -0
  68. compute_api_client/docs/PermissionsApi.md +68 -28
  69. compute_api_client/docs/Project.md +20 -3
  70. compute_api_client/docs/ProjectIn.md +18 -1
  71. compute_api_client/docs/ProjectPatch.md +19 -2
  72. compute_api_client/docs/ProjectsApi.md +84 -36
  73. compute_api_client/docs/Reservation.md +21 -4
  74. compute_api_client/docs/ReservationIn.md +19 -2
  75. compute_api_client/docs/ReservationsApi.md +66 -24
  76. compute_api_client/docs/Result.md +23 -6
  77. compute_api_client/docs/ResultIn.md +19 -2
  78. compute_api_client/docs/ResultsApi.md +42 -26
  79. compute_api_client/docs/Role.md +0 -1
  80. compute_api_client/docs/ShareType.md +0 -1
  81. compute_api_client/docs/Team.md +18 -1
  82. compute_api_client/docs/TeamsApi.md +37 -14
  83. compute_api_client/docs/Transaction.md +21 -4
  84. compute_api_client/docs/TransactionsApi.md +50 -14
  85. compute_api_client/docs/User.md +21 -4
  86. compute_api_client/docs/UserIn.md +17 -0
  87. compute_api_client/docs/UsersApi.md +62 -24
  88. compute_api_client/docs/ValidationError.md +18 -1
  89. compute_api_client/exceptions.py +19 -16
  90. compute_api_client/models/__init__.py +16 -14
  91. compute_api_client/models/algorithm.py +78 -237
  92. compute_api_client/models/algorithm_in.py +76 -204
  93. compute_api_client/models/algorithm_type.py +21 -87
  94. compute_api_client/models/backend.py +100 -0
  95. compute_api_client/models/backend_patch.py +90 -0
  96. compute_api_client/models/backend_status.py +47 -0
  97. compute_api_client/models/backend_type.py +105 -0
  98. compute_api_client/models/backend_with_authentication.py +102 -0
  99. compute_api_client/models/batch_job.py +129 -0
  100. compute_api_client/models/batch_job_in.py +89 -0
  101. compute_api_client/models/batch_job_status.py +48 -0
  102. compute_api_client/models/commit.py +72 -230
  103. compute_api_client/models/commit_in.py +67 -169
  104. compute_api_client/models/compile_stage.py +23 -89
  105. compute_api_client/models/domain.py +22 -88
  106. compute_api_client/models/file.py +74 -288
  107. compute_api_client/models/file_in.py +72 -254
  108. compute_api_client/models/final_result.py +68 -198
  109. compute_api_client/models/final_result_in.py +63 -137
  110. compute_api_client/models/http_not_found_error.py +60 -105
  111. compute_api_client/models/http_validation_error.py +69 -105
  112. compute_api_client/models/job.py +120 -0
  113. compute_api_client/models/job_in.py +99 -0
  114. compute_api_client/models/job_patch.py +88 -0
  115. compute_api_client/models/job_status.py +48 -0
  116. compute_api_client/models/language.py +67 -172
  117. compute_api_client/models/location_inner.py +125 -84
  118. compute_api_client/models/member.py +70 -236
  119. compute_api_client/models/member_in.py +68 -203
  120. compute_api_client/models/metadata.py +68 -198
  121. compute_api_client/models/metadata_in.py +68 -137
  122. compute_api_client/models/permission.py +67 -172
  123. compute_api_client/models/permission_group.py +65 -142
  124. compute_api_client/models/project.py +74 -256
  125. compute_api_client/models/project_in.py +69 -195
  126. compute_api_client/models/project_patch.py +89 -192
  127. compute_api_client/models/reservation.py +79 -290
  128. compute_api_client/models/reservation_in.py +68 -200
  129. compute_api_client/models/result.py +101 -359
  130. compute_api_client/models/result_in.py +95 -291
  131. compute_api_client/models/role.py +21 -87
  132. compute_api_client/models/share_type.py +22 -88
  133. compute_api_client/models/team.py +69 -198
  134. compute_api_client/models/transaction.py +93 -299
  135. compute_api_client/models/user.py +75 -276
  136. compute_api_client/models/user_in.py +73 -243
  137. compute_api_client/models/validation_error.py +73 -160
  138. compute_api_client/rest.py +55 -114
  139. {qi_compute_api_client-0.7.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/METADATA +47 -40
  140. qi_compute_api_client-0.17.0.dist-info/RECORD +142 -0
  141. compute_api_client/api/batch_runs_api.py +0 -862
  142. compute_api_client/api/runs_api.py +0 -723
  143. compute_api_client/api/runtime_api.py +0 -449
  144. compute_api_client/api/runtime_types_api.py +0 -303
  145. compute_api_client/docs/BatchRun.md +0 -21
  146. compute_api_client/docs/BatchRunIn.md +0 -12
  147. compute_api_client/docs/Run.md +0 -19
  148. compute_api_client/docs/RunIn.md +0 -14
  149. compute_api_client/docs/Runtime.md +0 -16
  150. compute_api_client/docs/RuntimeApi.md +0 -229
  151. compute_api_client/docs/RuntimeType.md +0 -19
  152. compute_api_client/docs/RuntimeWithAuthentication.md +0 -17
  153. compute_api_client/models/batch_run.py +0 -423
  154. compute_api_client/models/batch_run_in.py +0 -171
  155. compute_api_client/models/batch_run_status.py +0 -114
  156. compute_api_client/models/run.py +0 -376
  157. compute_api_client/models/run_in.py +0 -233
  158. compute_api_client/models/run_status.py +0 -114
  159. compute_api_client/models/runtime.py +0 -290
  160. compute_api_client/models/runtime_status.py +0 -113
  161. compute_api_client/models/runtime_type.py +0 -357
  162. compute_api_client/models/runtime_with_authentication.py +0 -320
  163. qi_compute_api_client-0.7.0.dist-info/RECORD +0 -137
  164. {qi_compute_api_client-0.7.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/LICENSE.md +0 -0
  165. {qi_compute_api_client-0.7.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/WHEEL +0 -0
@@ -3,161 +3,87 @@
3
3
  """
4
4
  Quantum Inspire 2
5
5
 
6
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
8
8
  The version of the OpenAPI document: 0.1.0
9
- Generated by: https://openapi-generator.tech
10
- """
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
10
 
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
12
13
 
13
- try:
14
- from inspect import getfullargspec
15
- except ImportError:
16
- from inspect import getargspec as getfullargspec
14
+
15
+ from __future__ import annotations
17
16
  import pprint
18
17
  import re # noqa: F401
19
- import six
20
-
21
- from compute_api_client.configuration import Configuration
18
+ import json
22
19
 
23
20
 
24
- class FinalResultIn(object):
25
- """NOTE: This class is auto generated by OpenAPI Generator.
26
- Ref: https://openapi-generator.tech
27
-
28
- Do not edit the class manually.
29
- """
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from pydantic import BaseModel, StrictInt
23
+ try:
24
+ from typing import Self
25
+ except ImportError:
26
+ from typing_extensions import Self
30
27
 
28
+ class FinalResultIn(BaseModel):
31
29
  """
32
- Attributes:
33
- openapi_types (dict): The key is attribute name
34
- and the value is attribute type.
35
- attribute_map (dict): The key is attribute name
36
- and the value is json key in definition.
37
- """
38
- openapi_types = {
39
- 'final_result': 'object',
40
- 'run_id': 'int'
30
+ FinalResultIn
31
+ """ # noqa: E501
32
+ job_id: StrictInt
33
+ final_result: Union[str, Any]
34
+ __properties: ClassVar[List[str]] = ["job_id", "final_result"]
35
+
36
+ model_config = {
37
+ "populate_by_name": True,
38
+ "validate_assignment": True
41
39
  }
42
40
 
43
- attribute_map = {
44
- 'final_result': 'final_result',
45
- 'run_id': 'run_id'
46
- }
47
-
48
- def __init__(self, final_result=None, run_id=None, local_vars_configuration=None): # noqa: E501
49
- """FinalResultIn - a model defined in OpenAPI""" # noqa: E501
50
- if local_vars_configuration is None:
51
- local_vars_configuration = Configuration.get_default_copy()
52
- self.local_vars_configuration = local_vars_configuration
53
-
54
- self._final_result = None
55
- self._run_id = None
56
- self.discriminator = None
57
-
58
- self.final_result = final_result
59
- self.run_id = run_id
60
-
61
- @property
62
- def final_result(self):
63
- """Gets the final_result of this FinalResultIn. # noqa: E501
64
-
65
-
66
- :return: The final_result of this FinalResultIn. # noqa: E501
67
- :rtype: object
68
- """
69
- return self._final_result
70
-
71
- @final_result.setter
72
- def final_result(self, final_result):
73
- """Sets the final_result of this FinalResultIn.
74
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))
75
45
 
76
- :param final_result: The final_result of this FinalResultIn. # noqa: E501
77
- :type final_result: object
78
- """
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())
79
50
 
80
- self._final_result = final_result
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Self:
53
+ """Create an instance of FinalResultIn from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
81
55
 
82
- @property
83
- def run_id(self):
84
- """Gets the run_id of this FinalResultIn. # noqa: E501
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
85
58
 
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
86
61
 
87
- :return: The run_id of this FinalResultIn. # noqa: E501
88
- :rtype: int
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.
89
65
  """
90
- return self._run_id
91
-
92
- @run_id.setter
93
- def run_id(self, run_id):
94
- """Sets the run_id of this FinalResultIn.
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude={
69
+ },
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Dict) -> Self:
76
+ """Create an instance of FinalResultIn from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "job_id": obj.get("job_id"),
85
+ "final_result": obj.get("final_result")
86
+ })
87
+ return _obj
95
88
 
96
89
 
97
- :param run_id: The run_id of this FinalResultIn. # noqa: E501
98
- :type run_id: int
99
- """
100
- if self.local_vars_configuration.client_side_validation and run_id is None: # noqa: E501
101
- raise ValueError("Invalid value for `run_id`, must not be `None`") # noqa: E501
102
- if (self.local_vars_configuration.client_side_validation and
103
- run_id is not None and run_id > 2147483647): # noqa: E501
104
- raise ValueError("Invalid value for `run_id`, must be a value less than or equal to `2147483647`") # noqa: E501
105
- if (self.local_vars_configuration.client_side_validation and
106
- run_id is not None and run_id < 1): # noqa: E501
107
- raise ValueError("Invalid value for `run_id`, must be a value greater than or equal to `1`") # noqa: E501
108
-
109
- self._run_id = run_id
110
-
111
- def to_dict(self, serialize=False):
112
- """Returns the model properties as a dict"""
113
- result = {}
114
-
115
- def convert(x):
116
- if hasattr(x, "to_dict"):
117
- args = getfullargspec(x.to_dict).args
118
- if len(args) == 1:
119
- return x.to_dict()
120
- else:
121
- return x.to_dict(serialize)
122
- else:
123
- return x
124
-
125
- for attr, _ in six.iteritems(self.openapi_types):
126
- value = getattr(self, attr)
127
- attr = self.attribute_map.get(attr, attr) if serialize else attr
128
- if isinstance(value, list):
129
- result[attr] = list(map(
130
- lambda x: convert(x),
131
- value
132
- ))
133
- elif isinstance(value, dict):
134
- result[attr] = dict(map(
135
- lambda item: (item[0], convert(item[1])),
136
- value.items()
137
- ))
138
- else:
139
- result[attr] = convert(value)
140
-
141
- return result
142
-
143
- def to_str(self):
144
- """Returns the string representation of the model"""
145
- return pprint.pformat(self.to_dict())
146
-
147
- def __repr__(self):
148
- """For `print` and `pprint`"""
149
- return self.to_str()
150
-
151
- def __eq__(self, other):
152
- """Returns true if both objects are equal"""
153
- if not isinstance(other, FinalResultIn):
154
- return False
155
-
156
- return self.to_dict() == other.to_dict()
157
-
158
- def __ne__(self, other):
159
- """Returns true if both objects are not equal"""
160
- if not isinstance(other, FinalResultIn):
161
- return True
162
-
163
- return self.to_dict() != other.to_dict()
@@ -3,130 +3,85 @@
3
3
  """
4
4
  Quantum Inspire 2
5
5
 
6
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
8
8
  The version of the OpenAPI document: 0.1.0
9
- Generated by: https://openapi-generator.tech
10
- """
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
10
 
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
12
13
 
13
- try:
14
- from inspect import getfullargspec
15
- except ImportError:
16
- from inspect import getargspec as getfullargspec
14
+
15
+ from __future__ import annotations
17
16
  import pprint
18
17
  import re # noqa: F401
19
- import six
20
-
21
- from compute_api_client.configuration import Configuration
18
+ import json
22
19
 
23
20
 
24
- class HTTPNotFoundError(object):
25
- """NOTE: This class is auto generated by OpenAPI Generator.
26
- Ref: https://openapi-generator.tech
27
-
28
- Do not edit the class manually.
29
- """
21
+ from typing import Any, ClassVar, Dict, List
22
+ from pydantic import BaseModel, StrictStr
23
+ try:
24
+ from typing import Self
25
+ except ImportError:
26
+ from typing_extensions import Self
30
27
 
28
+ class HTTPNotFoundError(BaseModel):
31
29
  """
32
- Attributes:
33
- openapi_types (dict): The key is attribute name
34
- and the value is attribute type.
35
- attribute_map (dict): The key is attribute name
36
- and the value is json key in definition.
37
- """
38
- openapi_types = {
39
- 'detail': 'str'
30
+ HTTPNotFoundError
31
+ """ # noqa: E501
32
+ detail: StrictStr
33
+ __properties: ClassVar[List[str]] = ["detail"]
34
+
35
+ model_config = {
36
+ "populate_by_name": True,
37
+ "validate_assignment": True
40
38
  }
41
39
 
42
- attribute_map = {
43
- 'detail': 'detail'
44
- }
45
40
 
46
- def __init__(self, detail=None, local_vars_configuration=None): # noqa: E501
47
- """HTTPNotFoundError - a model defined in OpenAPI""" # noqa: E501
48
- if local_vars_configuration is None:
49
- local_vars_configuration = Configuration.get_default_copy()
50
- self.local_vars_configuration = local_vars_configuration
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
51
44
 
52
- self._detail = None
53
- self.discriminator = None
45
+ def to_json(self) -> str:
46
+ """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())
54
49
 
55
- self.detail = detail
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Self:
52
+ """Create an instance of HTTPNotFoundError from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
56
54
 
57
- @property
58
- def detail(self):
59
- """Gets the detail of this HTTPNotFoundError. # noqa: E501
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
60
57
 
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
61
60
 
62
- :return: The detail of this HTTPNotFoundError. # noqa: E501
63
- :rtype: str
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
64
  """
65
- return self._detail
65
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude={
68
+ },
69
+ exclude_none=True,
70
+ )
71
+ return _dict
66
72
 
67
- @detail.setter
68
- def detail(self, detail):
69
- """Sets the detail of this HTTPNotFoundError.
73
+ @classmethod
74
+ def from_dict(cls, obj: Dict) -> Self:
75
+ """Create an instance of HTTPNotFoundError 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
+ "detail": obj.get("detail")
84
+ })
85
+ return _obj
70
86
 
71
87
 
72
- :param detail: The detail of this HTTPNotFoundError. # noqa: E501
73
- :type detail: str
74
- """
75
- if self.local_vars_configuration.client_side_validation and detail is None: # noqa: E501
76
- raise ValueError("Invalid value for `detail`, must not be `None`") # noqa: E501
77
-
78
- self._detail = detail
79
-
80
- def to_dict(self, serialize=False):
81
- """Returns the model properties as a dict"""
82
- result = {}
83
-
84
- def convert(x):
85
- if hasattr(x, "to_dict"):
86
- args = getfullargspec(x.to_dict).args
87
- if len(args) == 1:
88
- return x.to_dict()
89
- else:
90
- return x.to_dict(serialize)
91
- else:
92
- return x
93
-
94
- for attr, _ in six.iteritems(self.openapi_types):
95
- value = getattr(self, attr)
96
- attr = self.attribute_map.get(attr, attr) if serialize else attr
97
- if isinstance(value, list):
98
- result[attr] = list(map(
99
- lambda x: convert(x),
100
- value
101
- ))
102
- elif isinstance(value, dict):
103
- result[attr] = dict(map(
104
- lambda item: (item[0], convert(item[1])),
105
- value.items()
106
- ))
107
- else:
108
- result[attr] = convert(value)
109
-
110
- return result
111
-
112
- def to_str(self):
113
- """Returns the string representation of the model"""
114
- return pprint.pformat(self.to_dict())
115
-
116
- def __repr__(self):
117
- """For `print` and `pprint`"""
118
- return self.to_str()
119
-
120
- def __eq__(self, other):
121
- """Returns true if both objects are equal"""
122
- if not isinstance(other, HTTPNotFoundError):
123
- return False
124
-
125
- return self.to_dict() == other.to_dict()
126
-
127
- def __ne__(self, other):
128
- """Returns true if both objects are not equal"""
129
- if not isinstance(other, HTTPNotFoundError):
130
- return True
131
-
132
- return self.to_dict() != other.to_dict()
@@ -3,129 +3,93 @@
3
3
  """
4
4
  Quantum Inspire 2
5
5
 
6
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
8
8
  The version of the OpenAPI document: 0.1.0
9
- Generated by: https://openapi-generator.tech
10
- """
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
10
 
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
12
13
 
13
- try:
14
- from inspect import getfullargspec
15
- except ImportError:
16
- from inspect import getargspec as getfullargspec
14
+
15
+ from __future__ import annotations
17
16
  import pprint
18
17
  import re # noqa: F401
19
- import six
20
-
21
- from compute_api_client.configuration import Configuration
18
+ import json
22
19
 
23
20
 
24
- class HTTPValidationError(object):
25
- """NOTE: This class is auto generated by OpenAPI Generator.
26
- Ref: https://openapi-generator.tech
27
-
28
- Do not edit the class manually.
29
- """
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from pydantic import BaseModel
23
+ from compute_api_client.models.validation_error import ValidationError
24
+ try:
25
+ from typing import Self
26
+ except ImportError:
27
+ from typing_extensions import Self
30
28
 
29
+ class HTTPValidationError(BaseModel):
31
30
  """
32
- Attributes:
33
- openapi_types (dict): The key is attribute name
34
- and the value is attribute type.
35
- attribute_map (dict): The key is attribute name
36
- and the value is json key in definition.
37
- """
38
- openapi_types = {
39
- 'detail': 'list[ValidationError]'
31
+ HTTPValidationError
32
+ """ # noqa: E501
33
+ detail: Optional[List[ValidationError]] = None
34
+ __properties: ClassVar[List[str]] = ["detail"]
35
+
36
+ model_config = {
37
+ "populate_by_name": True,
38
+ "validate_assignment": True
40
39
  }
41
40
 
42
- attribute_map = {
43
- 'detail': 'detail'
44
- }
45
41
 
46
- def __init__(self, detail=None, local_vars_configuration=None): # noqa: E501
47
- """HTTPValidationError - a model defined in OpenAPI""" # noqa: E501
48
- if local_vars_configuration is None:
49
- local_vars_configuration = Configuration.get_default_copy()
50
- self.local_vars_configuration = local_vars_configuration
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))
51
45
 
52
- self._detail = None
53
- self.discriminator = None
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())
54
50
 
55
- if detail is not None:
56
- self.detail = detail
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Self:
53
+ """Create an instance of HTTPValidationError from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
57
55
 
58
- @property
59
- def detail(self):
60
- """Gets the detail of this HTTPValidationError. # noqa: E501
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
61
58
 
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
62
61
 
63
- :return: The detail of this HTTPValidationError. # noqa: E501
64
- :rtype: list[ValidationError]
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
65
  """
66
- return self._detail
67
-
68
- @detail.setter
69
- def detail(self, detail):
70
- """Sets the detail of this HTTPValidationError.
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude={
69
+ },
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in detail (list)
73
+ _items = []
74
+ if self.detail:
75
+ for _item in self.detail:
76
+ if _item:
77
+ _items.append(_item.to_dict())
78
+ _dict['detail'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Dict) -> Self:
83
+ """Create an instance of HTTPValidationError 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
+ "detail": [ValidationError.from_dict(_item) for _item in obj.get("detail")] if obj.get("detail") is not None else None
92
+ })
93
+ return _obj
71
94
 
72
95
 
73
- :param detail: The detail of this HTTPValidationError. # noqa: E501
74
- :type detail: list[ValidationError]
75
- """
76
-
77
- self._detail = detail
78
-
79
- def to_dict(self, serialize=False):
80
- """Returns the model properties as a dict"""
81
- result = {}
82
-
83
- def convert(x):
84
- if hasattr(x, "to_dict"):
85
- args = getfullargspec(x.to_dict).args
86
- if len(args) == 1:
87
- return x.to_dict()
88
- else:
89
- return x.to_dict(serialize)
90
- else:
91
- return x
92
-
93
- for attr, _ in six.iteritems(self.openapi_types):
94
- value = getattr(self, attr)
95
- attr = self.attribute_map.get(attr, attr) if serialize else attr
96
- if isinstance(value, list):
97
- result[attr] = list(map(
98
- lambda x: convert(x),
99
- value
100
- ))
101
- elif isinstance(value, dict):
102
- result[attr] = dict(map(
103
- lambda item: (item[0], convert(item[1])),
104
- value.items()
105
- ))
106
- else:
107
- result[attr] = convert(value)
108
-
109
- return result
110
-
111
- def to_str(self):
112
- """Returns the string representation of the model"""
113
- return pprint.pformat(self.to_dict())
114
-
115
- def __repr__(self):
116
- """For `print` and `pprint`"""
117
- return self.to_str()
118
-
119
- def __eq__(self, other):
120
- """Returns true if both objects are equal"""
121
- if not isinstance(other, HTTPValidationError):
122
- return False
123
-
124
- return self.to_dict() == other.to_dict()
125
-
126
- def __ne__(self, other):
127
- """Returns true if both objects are not equal"""
128
- if not isinstance(other, HTTPValidationError):
129
- return True
130
-
131
- return self.to_dict() != other.to_dict()