qi-compute-api-client 0.4.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 (166) hide show
  1. compute_api_client/__init__.py +23 -20
  2. compute_api_client/api/__init__.py +5 -6
  3. compute_api_client/api/algorithms_api.py +1334 -554
  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 +1069 -436
  8. compute_api_client/api/files_api.py +1076 -436
  9. compute_api_client/api/final_results_api.py +737 -339
  10. compute_api_client/api/jobs_api.py +1653 -0
  11. compute_api_client/api/languages_api.py +557 -218
  12. compute_api_client/api/members_api.py +1058 -436
  13. compute_api_client/api/metadata_api.py +737 -338
  14. compute_api_client/api/permissions_api.py +1056 -422
  15. compute_api_client/api/projects_api.py +1605 -677
  16. compute_api_client/api/reservations_api.py +1125 -428
  17. compute_api_client/api/results_api.py +739 -338
  18. compute_api_client/api/teams_api.py +568 -221
  19. compute_api_client/api/transactions_api.py +680 -219
  20. compute_api_client/api/users_api.py +1091 -436
  21. compute_api_client/api_client.py +347 -305
  22. compute_api_client/api_response.py +21 -0
  23. compute_api_client/configuration.py +55 -68
  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/BatchJobsApi.md +524 -0
  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 +40 -74
  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 +20 -17
  90. compute_api_client/models/__init__.py +17 -15
  91. compute_api_client/models/algorithm.py +79 -238
  92. compute_api_client/models/algorithm_in.py +77 -205
  93. compute_api_client/models/algorithm_type.py +22 -88
  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 +73 -231
  103. compute_api_client/models/commit_in.py +68 -170
  104. compute_api_client/models/compile_stage.py +24 -90
  105. compute_api_client/models/domain.py +23 -89
  106. compute_api_client/models/file.py +75 -289
  107. compute_api_client/models/file_in.py +73 -255
  108. compute_api_client/models/final_result.py +69 -199
  109. compute_api_client/models/final_result_in.py +64 -138
  110. compute_api_client/models/http_not_found_error.py +61 -106
  111. compute_api_client/models/http_validation_error.py +70 -106
  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 +68 -173
  117. compute_api_client/models/location_inner.py +126 -85
  118. compute_api_client/models/member.py +71 -237
  119. compute_api_client/models/member_in.py +69 -204
  120. compute_api_client/models/metadata.py +69 -199
  121. compute_api_client/models/metadata_in.py +69 -138
  122. compute_api_client/models/permission.py +68 -173
  123. compute_api_client/models/permission_group.py +66 -143
  124. compute_api_client/models/project.py +75 -257
  125. compute_api_client/models/project_in.py +70 -196
  126. compute_api_client/models/project_patch.py +90 -193
  127. compute_api_client/models/reservation.py +80 -291
  128. compute_api_client/models/reservation_in.py +69 -201
  129. compute_api_client/models/result.py +102 -360
  130. compute_api_client/models/result_in.py +96 -293
  131. compute_api_client/models/role.py +22 -88
  132. compute_api_client/models/share_type.py +23 -89
  133. compute_api_client/models/team.py +70 -199
  134. compute_api_client/models/transaction.py +94 -300
  135. compute_api_client/models/user.py +76 -277
  136. compute_api_client/models/user_in.py +74 -244
  137. compute_api_client/models/validation_error.py +74 -161
  138. compute_api_client/rest.py +56 -115
  139. {qi_compute_api_client-0.4.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/BatchRunsApi.md +0 -600
  148. compute_api_client/docs/Run.md +0 -18
  149. compute_api_client/docs/RunIn.md +0 -13
  150. compute_api_client/docs/Runtime.md +0 -16
  151. compute_api_client/docs/RuntimeApi.md +0 -229
  152. compute_api_client/docs/RuntimeType.md +0 -19
  153. compute_api_client/docs/RuntimeWithAuthentication.md +0 -17
  154. compute_api_client/models/batch_run.py +0 -423
  155. compute_api_client/models/batch_run_in.py +0 -171
  156. compute_api_client/models/batch_run_status.py +0 -114
  157. compute_api_client/models/run.py +0 -345
  158. compute_api_client/models/run_in.py +0 -202
  159. compute_api_client/models/run_status.py +0 -114
  160. compute_api_client/models/runtime.py +0 -290
  161. compute_api_client/models/runtime_status.py +0 -113
  162. compute_api_client/models/runtime_type.py +0 -357
  163. compute_api_client/models/runtime_with_authentication.py +0 -320
  164. qi_compute_api_client-0.4.0.dist-info/RECORD +0 -137
  165. {qi_compute_api_client-0.4.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/LICENSE.md +0 -0
  166. {qi_compute_api_client-0.4.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/WHEEL +0 -0
@@ -1,280 +1,98 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Compute Job Manager
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
18
+ import json
20
19
 
21
- from compute_api_client.configuration import Configuration
22
20
 
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
23
+ from compute_api_client.models.compile_stage import CompileStage
24
+ try:
25
+ from typing import Self
26
+ except ImportError:
27
+ from typing_extensions import Self
23
28
 
24
- class FileIn(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
- """
30
-
31
- """
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.
29
+ class FileIn(BaseModel):
37
30
  """
38
- openapi_types = {
39
- 'content': 'str',
40
- 'compile_stage': 'CompileStage',
41
- 'compile_properties': 'object',
42
- 'generated': 'bool',
43
- 'commit_id': 'int',
44
- 'language_id': 'int'
45
- }
46
-
47
- attribute_map = {
48
- 'content': 'content',
49
- 'compile_stage': 'compile_stage',
50
- 'compile_properties': 'compile_properties',
51
- 'generated': 'generated',
52
- 'commit_id': 'commit_id',
53
- 'language_id': 'language_id'
31
+ FileIn
32
+ """ # noqa: E501
33
+ commit_id: StrictInt
34
+ content: StrictStr
35
+ language_id: StrictInt
36
+ compile_stage: CompileStage
37
+ compile_properties: Union[str, Any]
38
+ generated: Optional[StrictBool] = False
39
+ __properties: ClassVar[List[str]] = ["commit_id", "content", "language_id", "compile_stage", "compile_properties", "generated"]
40
+
41
+ model_config = {
42
+ "populate_by_name": True,
43
+ "validate_assignment": True
54
44
  }
55
45
 
56
- def __init__(self, content=None, compile_stage=None, compile_properties=None, generated=False, commit_id=None, language_id=None, local_vars_configuration=None): # noqa: E501
57
- """FileIn - a model defined in OpenAPI""" # noqa: E501
58
- if local_vars_configuration is None:
59
- local_vars_configuration = Configuration.get_default_copy()
60
- self.local_vars_configuration = local_vars_configuration
61
-
62
- self._content = None
63
- self._compile_stage = None
64
- self._compile_properties = None
65
- self._generated = None
66
- self._commit_id = None
67
- self._language_id = None
68
- self.discriminator = None
69
-
70
- self.content = content
71
- if compile_stage is not None:
72
- self.compile_stage = compile_stage
73
- self.compile_properties = compile_properties
74
- if generated is not None:
75
- self.generated = generated
76
- self.commit_id = commit_id
77
- self.language_id = language_id
78
-
79
- @property
80
- def content(self):
81
- """Gets the content of this FileIn. # noqa: E501
82
-
83
46
 
84
- :return: The content of this FileIn. # noqa: E501
85
- :rtype: str
86
- """
87
- return self._content
88
-
89
- @content.setter
90
- def content(self, content):
91
- """Sets the content of this FileIn.
92
-
93
-
94
- :param content: The content of this FileIn. # noqa: E501
95
- :type content: str
96
- """
97
- if self.local_vars_configuration.client_side_validation and content is None: # noqa: E501
98
- raise ValueError("Invalid value for `content`, must not be `None`") # noqa: E501
99
-
100
- self._content = content
101
-
102
- @property
103
- def compile_stage(self):
104
- """Gets the compile_stage of this FileIn. # noqa: E501
105
-
106
- NONE: none<br/>MAPPED: mapped<br/>NATIVE_GATESET: native_gateset<br/>SCHEDULED: scheduled # noqa: E501
107
-
108
- :return: The compile_stage of this FileIn. # noqa: E501
109
- :rtype: CompileStage
110
- """
111
- return self._compile_stage
112
-
113
- @compile_stage.setter
114
- def compile_stage(self, compile_stage):
115
- """Sets the compile_stage of this FileIn.
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
116
50
 
117
- NONE: none<br/>MAPPED: mapped<br/>NATIVE_GATESET: native_gateset<br/>SCHEDULED: scheduled # noqa: E501
51
+ def to_json(self) -> str:
52
+ """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())
118
55
 
119
- :param compile_stage: The compile_stage of this FileIn. # noqa: E501
120
- :type compile_stage: CompileStage
121
- """
122
- if (self.local_vars_configuration.client_side_validation and
123
- compile_stage is not None and len(compile_stage) > 14):
124
- raise ValueError("Invalid value for `compile_stage`, length must be less than or equal to `14`") # noqa: E501
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Self:
58
+ """Create an instance of FileIn from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
125
60
 
126
- self._compile_stage = compile_stage
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
127
63
 
128
- @property
129
- def compile_properties(self):
130
- """Gets the compile_properties of this FileIn. # noqa: E501
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
131
66
 
132
-
133
- :return: The compile_properties of this FileIn. # noqa: E501
134
- :rtype: object
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
135
70
  """
136
- return self._compile_properties
137
-
138
- @compile_properties.setter
139
- def compile_properties(self, compile_properties):
140
- """Sets the compile_properties of this FileIn.
141
-
142
-
143
- :param compile_properties: The compile_properties of this FileIn. # noqa: E501
144
- :type compile_properties: object
145
- """
146
-
147
- self._compile_properties = compile_properties
148
-
149
- @property
150
- def generated(self):
151
- """Gets the generated of this FileIn. # noqa: E501
152
-
153
-
154
- :return: The generated of this FileIn. # noqa: E501
155
- :rtype: bool
156
- """
157
- return self._generated
158
-
159
- @generated.setter
160
- def generated(self, generated):
161
- """Sets the generated of this FileIn.
162
-
163
-
164
- :param generated: The generated of this FileIn. # noqa: E501
165
- :type generated: bool
166
- """
167
-
168
- self._generated = generated
169
-
170
- @property
171
- def commit_id(self):
172
- """Gets the commit_id of this FileIn. # noqa: E501
173
-
174
-
175
- :return: The commit_id of this FileIn. # noqa: E501
176
- :rtype: int
177
- """
178
- return self._commit_id
179
-
180
- @commit_id.setter
181
- def commit_id(self, commit_id):
182
- """Sets the commit_id of this FileIn.
183
-
184
-
185
- :param commit_id: The commit_id of this FileIn. # noqa: E501
186
- :type commit_id: int
187
- """
188
- if self.local_vars_configuration.client_side_validation and commit_id is None: # noqa: E501
189
- raise ValueError("Invalid value for `commit_id`, must not be `None`") # noqa: E501
190
- if (self.local_vars_configuration.client_side_validation and
191
- commit_id is not None and commit_id > 2147483647): # noqa: E501
192
- raise ValueError("Invalid value for `commit_id`, must be a value less than or equal to `2147483647`") # noqa: E501
193
- if (self.local_vars_configuration.client_side_validation and
194
- commit_id is not None and commit_id < 1): # noqa: E501
195
- raise ValueError("Invalid value for `commit_id`, must be a value greater than or equal to `1`") # noqa: E501
196
-
197
- self._commit_id = commit_id
198
-
199
- @property
200
- def language_id(self):
201
- """Gets the language_id of this FileIn. # noqa: E501
202
-
203
-
204
- :return: The language_id of this FileIn. # noqa: E501
205
- :rtype: int
206
- """
207
- return self._language_id
208
-
209
- @language_id.setter
210
- def language_id(self, language_id):
211
- """Sets the language_id of this FileIn.
212
-
213
-
214
- :param language_id: The language_id of this FileIn. # noqa: E501
215
- :type language_id: int
216
- """
217
- if self.local_vars_configuration.client_side_validation and language_id is None: # noqa: E501
218
- raise ValueError("Invalid value for `language_id`, must not be `None`") # noqa: E501
219
- if (self.local_vars_configuration.client_side_validation and
220
- language_id is not None and language_id > 2147483647): # noqa: E501
221
- raise ValueError("Invalid value for `language_id`, must be a value less than or equal to `2147483647`") # noqa: E501
222
- if (self.local_vars_configuration.client_side_validation and
223
- language_id is not None and language_id < 1): # noqa: E501
224
- raise ValueError("Invalid value for `language_id`, must be a value greater than or equal to `1`") # noqa: E501
225
-
226
- self._language_id = language_id
227
-
228
- def to_dict(self, serialize=False):
229
- """Returns the model properties as a dict"""
230
- result = {}
231
-
232
- def convert(x):
233
- if hasattr(x, "to_dict"):
234
- args = getfullargspec(x.to_dict).args
235
- if len(args) == 1:
236
- return x.to_dict()
237
- else:
238
- return x.to_dict(serialize)
239
- else:
240
- return x
241
-
242
- for attr, _ in six.iteritems(self.openapi_types):
243
- value = getattr(self, attr)
244
- attr = self.attribute_map.get(attr, attr) if serialize else attr
245
- if isinstance(value, list):
246
- result[attr] = list(map(
247
- lambda x: convert(x),
248
- value
249
- ))
250
- elif isinstance(value, dict):
251
- result[attr] = dict(map(
252
- lambda item: (item[0], convert(item[1])),
253
- value.items()
254
- ))
255
- else:
256
- result[attr] = convert(value)
257
-
258
- return result
259
-
260
- def to_str(self):
261
- """Returns the string representation of the model"""
262
- return pprint.pformat(self.to_dict())
263
-
264
- def __repr__(self):
265
- """For `print` and `pprint`"""
266
- return self.to_str()
267
-
268
- def __eq__(self, other):
269
- """Returns true if both objects are equal"""
270
- if not isinstance(other, FileIn):
271
- return False
272
-
273
- return self.to_dict() == other.to_dict()
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude={
74
+ },
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Dict) -> Self:
81
+ """Create an instance of FileIn from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "commit_id": obj.get("commit_id"),
90
+ "content": obj.get("content"),
91
+ "language_id": obj.get("language_id"),
92
+ "compile_stage": obj.get("compile_stage"),
93
+ "compile_properties": obj.get("compile_properties"),
94
+ "generated": obj.get("generated") if obj.get("generated") is not None else False
95
+ })
96
+ return _obj
274
97
 
275
- def __ne__(self, other):
276
- """Returns true if both objects are not equal"""
277
- if not isinstance(other, FileIn):
278
- return True
279
98
 
280
- return self.to_dict() != other.to_dict()
@@ -1,223 +1,93 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Compute Job Manager
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
 
20
+ from datetime import datetime
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
23
27
 
24
- class FinalResult(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
- """
30
-
31
- """
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.
28
+ class FinalResult(BaseModel):
37
29
  """
38
- openapi_types = {
39
- 'created_on': 'datetime',
40
- 'id': 'int',
41
- 'final_result': 'object',
42
- 'run_id': 'int'
30
+ FinalResult
31
+ """ # noqa: E501
32
+ id: StrictInt
33
+ created_on: datetime
34
+ job_id: StrictInt
35
+ final_result: Union[str, Any]
36
+ __properties: ClassVar[List[str]] = ["id", "created_on", "job_id", "final_result"]
37
+
38
+ model_config = {
39
+ "populate_by_name": True,
40
+ "validate_assignment": True
43
41
  }
44
42
 
45
- attribute_map = {
46
- 'created_on': 'created_on',
47
- 'id': 'id',
48
- 'final_result': 'final_result',
49
- 'run_id': 'run_id'
50
- }
51
43
 
52
- def __init__(self, created_on=None, id=None, final_result=None, run_id=None, local_vars_configuration=None): # noqa: E501
53
- """FinalResult - a model defined in OpenAPI""" # noqa: E501
54
- if local_vars_configuration is None:
55
- local_vars_configuration = Configuration.get_default_copy()
56
- self.local_vars_configuration = local_vars_configuration
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
57
47
 
58
- self._created_on = None
59
- self._id = None
60
- self._final_result = None
61
- self._run_id = None
62
- self.discriminator = None
48
+ def to_json(self) -> str:
49
+ """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())
63
52
 
64
- self.created_on = created_on
65
- self.id = id
66
- self.final_result = final_result
67
- self.run_id = run_id
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Self:
55
+ """Create an instance of FinalResult from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
68
57
 
69
- @property
70
- def created_on(self):
71
- """Gets the created_on of this FinalResult. # noqa: E501
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
72
60
 
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
73
63
 
74
- :return: The created_on of this FinalResult. # noqa: E501
75
- :rtype: datetime
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
76
67
  """
77
- return self._created_on
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude={
71
+ },
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Dict) -> Self:
78
+ """Create an instance of FinalResult from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "id": obj.get("id"),
87
+ "created_on": obj.get("created_on"),
88
+ "job_id": obj.get("job_id"),
89
+ "final_result": obj.get("final_result")
90
+ })
91
+ return _obj
78
92
 
79
- @created_on.setter
80
- def created_on(self, created_on):
81
- """Sets the created_on of this FinalResult.
82
-
83
-
84
- :param created_on: The created_on of this FinalResult. # noqa: E501
85
- :type created_on: datetime
86
- """
87
- if self.local_vars_configuration.client_side_validation and created_on is None: # noqa: E501
88
- raise ValueError("Invalid value for `created_on`, must not be `None`") # noqa: E501
89
-
90
- self._created_on = created_on
91
-
92
- @property
93
- def id(self):
94
- """Gets the id of this FinalResult. # noqa: E501
95
-
96
-
97
- :return: The id of this FinalResult. # noqa: E501
98
- :rtype: int
99
- """
100
- return self._id
101
93
 
102
- @id.setter
103
- def id(self, id):
104
- """Sets the id of this FinalResult.
105
-
106
-
107
- :param id: The id of this FinalResult. # noqa: E501
108
- :type id: int
109
- """
110
- if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501
111
- raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
112
- if (self.local_vars_configuration.client_side_validation and
113
- id is not None and id > 2147483647): # noqa: E501
114
- raise ValueError("Invalid value for `id`, must be a value less than or equal to `2147483647`") # noqa: E501
115
- if (self.local_vars_configuration.client_side_validation and
116
- id is not None and id < 1): # noqa: E501
117
- raise ValueError("Invalid value for `id`, must be a value greater than or equal to `1`") # noqa: E501
118
-
119
- self._id = id
120
-
121
- @property
122
- def final_result(self):
123
- """Gets the final_result of this FinalResult. # noqa: E501
124
-
125
-
126
- :return: The final_result of this FinalResult. # noqa: E501
127
- :rtype: object
128
- """
129
- return self._final_result
130
-
131
- @final_result.setter
132
- def final_result(self, final_result):
133
- """Sets the final_result of this FinalResult.
134
-
135
-
136
- :param final_result: The final_result of this FinalResult. # noqa: E501
137
- :type final_result: object
138
- """
139
-
140
- self._final_result = final_result
141
-
142
- @property
143
- def run_id(self):
144
- """Gets the run_id of this FinalResult. # noqa: E501
145
-
146
-
147
- :return: The run_id of this FinalResult. # noqa: E501
148
- :rtype: int
149
- """
150
- return self._run_id
151
-
152
- @run_id.setter
153
- def run_id(self, run_id):
154
- """Sets the run_id of this FinalResult.
155
-
156
-
157
- :param run_id: The run_id of this FinalResult. # noqa: E501
158
- :type run_id: int
159
- """
160
- if self.local_vars_configuration.client_side_validation and run_id is None: # noqa: E501
161
- raise ValueError("Invalid value for `run_id`, must not be `None`") # noqa: E501
162
- if (self.local_vars_configuration.client_side_validation and
163
- run_id is not None and run_id > 2147483647): # noqa: E501
164
- raise ValueError("Invalid value for `run_id`, must be a value less than or equal to `2147483647`") # noqa: E501
165
- if (self.local_vars_configuration.client_side_validation and
166
- run_id is not None and run_id < 1): # noqa: E501
167
- raise ValueError("Invalid value for `run_id`, must be a value greater than or equal to `1`") # noqa: E501
168
-
169
- self._run_id = run_id
170
-
171
- def to_dict(self, serialize=False):
172
- """Returns the model properties as a dict"""
173
- result = {}
174
-
175
- def convert(x):
176
- if hasattr(x, "to_dict"):
177
- args = getfullargspec(x.to_dict).args
178
- if len(args) == 1:
179
- return x.to_dict()
180
- else:
181
- return x.to_dict(serialize)
182
- else:
183
- return x
184
-
185
- for attr, _ in six.iteritems(self.openapi_types):
186
- value = getattr(self, attr)
187
- attr = self.attribute_map.get(attr, attr) if serialize else attr
188
- if isinstance(value, list):
189
- result[attr] = list(map(
190
- lambda x: convert(x),
191
- value
192
- ))
193
- elif isinstance(value, dict):
194
- result[attr] = dict(map(
195
- lambda item: (item[0], convert(item[1])),
196
- value.items()
197
- ))
198
- else:
199
- result[attr] = convert(value)
200
-
201
- return result
202
-
203
- def to_str(self):
204
- """Returns the string representation of the model"""
205
- return pprint.pformat(self.to_dict())
206
-
207
- def __repr__(self):
208
- """For `print` and `pprint`"""
209
- return self.to_str()
210
-
211
- def __eq__(self, other):
212
- """Returns true if both objects are equal"""
213
- if not isinstance(other, FinalResult):
214
- return False
215
-
216
- return self.to_dict() == other.to_dict()
217
-
218
- def __ne__(self, other):
219
- """Returns true if both objects are not equal"""
220
- if not isinstance(other, FinalResult):
221
- return True
222
-
223
- return self.to_dict() != other.to_dict()