qi-compute-api-client 0.56.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 (205) hide show
  1. compute_api_client/__init__.py +219 -0
  2. compute_api_client/api/__init__.py +23 -0
  3. compute_api_client/api/algorithms_api.py +1603 -0
  4. compute_api_client/api/auth_config_api.py +278 -0
  5. compute_api_client/api/backend_api.py +1540 -0
  6. compute_api_client/api/backend_types_api.py +1178 -0
  7. compute_api_client/api/batch_jobs_api.py +2224 -0
  8. compute_api_client/api/commits_api.py +1565 -0
  9. compute_api_client/api/files_api.py +1307 -0
  10. compute_api_client/api/final_results_api.py +847 -0
  11. compute_api_client/api/health_api.py +281 -0
  12. compute_api_client/api/jobs_api.py +1787 -0
  13. compute_api_client/api/languages_api.py +692 -0
  14. compute_api_client/api/members_api.py +1238 -0
  15. compute_api_client/api/metadata_api.py +930 -0
  16. compute_api_client/api/permissions_api.py +1295 -0
  17. compute_api_client/api/projects_api.py +1889 -0
  18. compute_api_client/api/reservations_api.py +1324 -0
  19. compute_api_client/api/results_api.py +1702 -0
  20. compute_api_client/api/teams_api.py +692 -0
  21. compute_api_client/api/transactions_api.py +805 -0
  22. compute_api_client/api/users_api.py +1305 -0
  23. compute_api_client/api_client.py +804 -0
  24. compute_api_client/api_response.py +21 -0
  25. compute_api_client/configuration.py +606 -0
  26. compute_api_client/docs/Algorithm.md +34 -0
  27. compute_api_client/docs/AlgorithmIn.md +33 -0
  28. compute_api_client/docs/AlgorithmType.md +12 -0
  29. compute_api_client/docs/AlgorithmsApi.md +428 -0
  30. compute_api_client/docs/AuthConfig.md +31 -0
  31. compute_api_client/docs/AuthConfigApi.md +71 -0
  32. compute_api_client/docs/Backend.md +35 -0
  33. compute_api_client/docs/BackendApi.md +418 -0
  34. compute_api_client/docs/BackendIn.md +34 -0
  35. compute_api_client/docs/BackendMessage.md +29 -0
  36. compute_api_client/docs/BackendPatch.md +31 -0
  37. compute_api_client/docs/BackendStatus.md +16 -0
  38. compute_api_client/docs/BackendType.md +48 -0
  39. compute_api_client/docs/BackendTypePatch.md +45 -0
  40. compute_api_client/docs/BackendTypesApi.md +289 -0
  41. compute_api_client/docs/BackendWithAuthentication.md +36 -0
  42. compute_api_client/docs/BatchJob.md +39 -0
  43. compute_api_client/docs/BatchJobIn.md +29 -0
  44. compute_api_client/docs/BatchJobStatus.md +18 -0
  45. compute_api_client/docs/BatchJobsApi.md +600 -0
  46. compute_api_client/docs/Commit.md +33 -0
  47. compute_api_client/docs/CommitIn.md +30 -0
  48. compute_api_client/docs/CommitsApi.md +425 -0
  49. compute_api_client/docs/CompilePayload.md +30 -0
  50. compute_api_client/docs/CompileStage.md +18 -0
  51. compute_api_client/docs/Domain.md +14 -0
  52. compute_api_client/docs/File.md +36 -0
  53. compute_api_client/docs/FileIn.md +35 -0
  54. compute_api_client/docs/FilesApi.md +346 -0
  55. compute_api_client/docs/FinalResult.md +32 -0
  56. compute_api_client/docs/FinalResultIn.md +30 -0
  57. compute_api_client/docs/FinalResultsApi.md +248 -0
  58. compute_api_client/docs/HTTPBadRequestError.md +29 -0
  59. compute_api_client/docs/HTTPNotFoundError.md +29 -0
  60. compute_api_client/docs/HTTPValidationError.md +29 -0
  61. compute_api_client/docs/HealthApi.md +72 -0
  62. compute_api_client/docs/Job.md +42 -0
  63. compute_api_client/docs/JobIn.md +32 -0
  64. compute_api_client/docs/JobPatch.md +34 -0
  65. compute_api_client/docs/JobStatus.md +18 -0
  66. compute_api_client/docs/JobsApi.md +460 -0
  67. compute_api_client/docs/Language.md +31 -0
  68. compute_api_client/docs/LanguagesApi.md +177 -0
  69. compute_api_client/docs/LocationInner.md +27 -0
  70. compute_api_client/docs/Member.md +33 -0
  71. compute_api_client/docs/MemberId.md +28 -0
  72. compute_api_client/docs/MemberIn.md +32 -0
  73. compute_api_client/docs/MembersApi.md +331 -0
  74. compute_api_client/docs/PageAlgorithm.md +33 -0
  75. compute_api_client/docs/PageBackend.md +33 -0
  76. compute_api_client/docs/PageBackendType.md +33 -0
  77. compute_api_client/docs/PageBatchJob.md +33 -0
  78. compute_api_client/docs/PageCommit.md +33 -0
  79. compute_api_client/docs/PageFile.md +33 -0
  80. compute_api_client/docs/PageJob.md +33 -0
  81. compute_api_client/docs/PageLanguage.md +33 -0
  82. compute_api_client/docs/PageMember.md +33 -0
  83. compute_api_client/docs/PageMetadata.md +32 -0
  84. compute_api_client/docs/PagePermission.md +33 -0
  85. compute_api_client/docs/PagePermissionGroup.md +33 -0
  86. compute_api_client/docs/PageProject.md +33 -0
  87. compute_api_client/docs/PageReservation.md +33 -0
  88. compute_api_client/docs/PageResult.md +33 -0
  89. compute_api_client/docs/PageTeam.md +33 -0
  90. compute_api_client/docs/PageTransaction.md +33 -0
  91. compute_api_client/docs/PageUser.md +33 -0
  92. compute_api_client/docs/Permission.md +31 -0
  93. compute_api_client/docs/PermissionGroup.md +30 -0
  94. compute_api_client/docs/PermissionsApi.md +340 -0
  95. compute_api_client/docs/Project.md +34 -0
  96. compute_api_client/docs/ProjectIn.md +32 -0
  97. compute_api_client/docs/ProjectPatch.md +32 -0
  98. compute_api_client/docs/ProjectsApi.md +502 -0
  99. compute_api_client/docs/Reservation.md +35 -0
  100. compute_api_client/docs/ReservationIn.md +32 -0
  101. compute_api_client/docs/ReservationsApi.md +341 -0
  102. compute_api_client/docs/Result.md +36 -0
  103. compute_api_client/docs/ResultIn.md +34 -0
  104. compute_api_client/docs/ResultsApi.md +439 -0
  105. compute_api_client/docs/Role.md +12 -0
  106. compute_api_client/docs/ShareType.md +14 -0
  107. compute_api_client/docs/Team.md +32 -0
  108. compute_api_client/docs/TeamsApi.md +177 -0
  109. compute_api_client/docs/Transaction.md +35 -0
  110. compute_api_client/docs/TransactionDomain.md +28 -0
  111. compute_api_client/docs/TransactionsApi.md +190 -0
  112. compute_api_client/docs/User.md +36 -0
  113. compute_api_client/docs/UserIn.md +35 -0
  114. compute_api_client/docs/UsersApi.md +338 -0
  115. compute_api_client/docs/ValidationError.md +31 -0
  116. compute_api_client/docs/ValidationErrorLocInner.md +28 -0
  117. compute_api_client/exceptions.py +216 -0
  118. compute_api_client/models/__init__.py +84 -0
  119. compute_api_client/models/algorithm.py +105 -0
  120. compute_api_client/models/algorithm_in.py +103 -0
  121. compute_api_client/models/algorithm_type.py +37 -0
  122. compute_api_client/models/auth_config.py +91 -0
  123. compute_api_client/models/backend.py +106 -0
  124. compute_api_client/models/backend_in.py +104 -0
  125. compute_api_client/models/backend_message.py +87 -0
  126. compute_api_client/models/backend_patch.py +112 -0
  127. compute_api_client/models/backend_status.py +39 -0
  128. compute_api_client/models/backend_type.py +145 -0
  129. compute_api_client/models/backend_type_patch.py +205 -0
  130. compute_api_client/models/backend_with_authentication.py +108 -0
  131. compute_api_client/models/batch_job.py +130 -0
  132. compute_api_client/models/batch_job_in.py +87 -0
  133. compute_api_client/models/batch_job_status.py +40 -0
  134. compute_api_client/models/commit.py +97 -0
  135. compute_api_client/models/commit_in.py +89 -0
  136. compute_api_client/models/compile_payload.py +95 -0
  137. compute_api_client/models/compile_stage.py +40 -0
  138. compute_api_client/models/domain.py +38 -0
  139. compute_api_client/models/file.py +108 -0
  140. compute_api_client/models/file_in.py +106 -0
  141. compute_api_client/models/final_result.py +94 -0
  142. compute_api_client/models/final_result_in.py +89 -0
  143. compute_api_client/models/http_bad_request_error.py +87 -0
  144. compute_api_client/models/http_not_found_error.py +87 -0
  145. compute_api_client/models/http_validation_error.py +95 -0
  146. compute_api_client/models/job.py +131 -0
  147. compute_api_client/models/job_in.py +98 -0
  148. compute_api_client/models/job_patch.py +99 -0
  149. compute_api_client/models/job_status.py +40 -0
  150. compute_api_client/models/language.py +92 -0
  151. compute_api_client/models/location_inner.py +144 -0
  152. compute_api_client/models/member.py +96 -0
  153. compute_api_client/models/member_id.py +144 -0
  154. compute_api_client/models/member_in.py +94 -0
  155. compute_api_client/models/metadata.py +93 -0
  156. compute_api_client/models/metadata_in.py +94 -0
  157. compute_api_client/models/page_algorithm.py +104 -0
  158. compute_api_client/models/page_backend.py +104 -0
  159. compute_api_client/models/page_backend_type.py +104 -0
  160. compute_api_client/models/page_batch_job.py +104 -0
  161. compute_api_client/models/page_commit.py +104 -0
  162. compute_api_client/models/page_file.py +104 -0
  163. compute_api_client/models/page_job.py +104 -0
  164. compute_api_client/models/page_language.py +104 -0
  165. compute_api_client/models/page_member.py +104 -0
  166. compute_api_client/models/page_metadata.py +125 -0
  167. compute_api_client/models/page_permission.py +104 -0
  168. compute_api_client/models/page_permission_group.py +104 -0
  169. compute_api_client/models/page_project.py +104 -0
  170. compute_api_client/models/page_reservation.py +104 -0
  171. compute_api_client/models/page_result.py +104 -0
  172. compute_api_client/models/page_team.py +104 -0
  173. compute_api_client/models/page_transaction.py +104 -0
  174. compute_api_client/models/page_user.py +104 -0
  175. compute_api_client/models/permission.py +92 -0
  176. compute_api_client/models/permission_group.py +90 -0
  177. compute_api_client/models/project.py +99 -0
  178. compute_api_client/models/project_in.py +94 -0
  179. compute_api_client/models/project_patch.py +114 -0
  180. compute_api_client/models/reservation.py +105 -0
  181. compute_api_client/models/reservation_in.py +94 -0
  182. compute_api_client/models/result.py +122 -0
  183. compute_api_client/models/result_in.py +117 -0
  184. compute_api_client/models/role.py +37 -0
  185. compute_api_client/models/share_type.py +38 -0
  186. compute_api_client/models/team.py +94 -0
  187. compute_api_client/models/transaction.py +117 -0
  188. compute_api_client/models/transaction_domain.py +142 -0
  189. compute_api_client/models/user.py +102 -0
  190. compute_api_client/models/user_in.py +100 -0
  191. compute_api_client/models/validation_error.py +99 -0
  192. compute_api_client/models/validation_error_loc_inner.py +138 -0
  193. compute_api_client/rest.py +213 -0
  194. qi2_shared/__init__.py +0 -0
  195. qi2_shared/authentication.py +66 -0
  196. qi2_shared/client.py +52 -0
  197. qi2_shared/hybrid/__init__.py +0 -0
  198. qi2_shared/hybrid/quantum_interface.py +45 -0
  199. qi2_shared/pagination.py +44 -0
  200. qi2_shared/settings.py +68 -0
  201. qi2_shared/utils.py +13 -0
  202. qi_compute_api_client-0.56.0.dist-info/METADATA +266 -0
  203. qi_compute_api_client-0.56.0.dist-info/RECORD +205 -0
  204. qi_compute_api_client-0.56.0.dist-info/WHEEL +4 -0
  205. qi_compute_api_client-0.56.0.dist-info/licenses/LICENSE.md +142 -0
@@ -0,0 +1,205 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Quantum Inspire 2
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, Field, StrictBool, StrictFloat, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class BackendTypePatch(BaseModel):
27
+ """
28
+ BackendTypePatch
29
+ """ # noqa: E501
30
+ name: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None
31
+ infrastructure: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None
32
+ description: Optional[StrictStr] = None
33
+ image_id: Optional[Annotated[str, Field(strict=True, max_length=16)]] = None
34
+ is_hardware: Optional[StrictBool] = None
35
+ supports_raw_data: Optional[StrictBool] = None
36
+ features: Optional[List[StrictStr]] = None
37
+ default_compiler_config: Optional[Dict[str, Any]] = None
38
+ gateset: Optional[List[StrictStr]] = None
39
+ topology: Optional[List[List[StrictInt]]] = None
40
+ nqubits: Optional[StrictInt] = None
41
+ default_number_of_shots: Optional[StrictInt] = None
42
+ max_number_of_shots: Optional[StrictInt] = None
43
+ enabled: Optional[StrictBool] = None
44
+ identifier: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None
45
+ protocol_version: Optional[StrictInt] = None
46
+ job_execution_time_limit: Optional[Union[StrictFloat, StrictInt]] = None
47
+ __properties: ClassVar[List[str]] = ["name", "infrastructure", "description", "image_id", "is_hardware", "supports_raw_data", "features", "default_compiler_config", "gateset", "topology", "nqubits", "default_number_of_shots", "max_number_of_shots", "enabled", "identifier", "protocol_version", "job_execution_time_limit"]
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ )
54
+
55
+
56
+ def to_str(self) -> str:
57
+ """Returns the string representation of the model using alias"""
58
+ return pprint.pformat(self.model_dump(by_alias=True))
59
+
60
+ def to_json(self) -> str:
61
+ """Returns the JSON representation of the model using alias"""
62
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
63
+ return json.dumps(self.to_dict())
64
+
65
+ @classmethod
66
+ def from_json(cls, json_str: str) -> Optional[Self]:
67
+ """Create an instance of BackendTypePatch from a JSON string"""
68
+ return cls.from_dict(json.loads(json_str))
69
+
70
+ def to_dict(self) -> Dict[str, Any]:
71
+ """Return the dictionary representation of the model using alias.
72
+
73
+ This has the following differences from calling pydantic's
74
+ `self.model_dump(by_alias=True)`:
75
+
76
+ * `None` is only added to the output dict for nullable fields that
77
+ were set at model initialization. Other fields with value `None`
78
+ are ignored.
79
+ """
80
+ excluded_fields: Set[str] = set([
81
+ ])
82
+
83
+ _dict = self.model_dump(
84
+ by_alias=True,
85
+ exclude=excluded_fields,
86
+ exclude_none=True,
87
+ )
88
+ # set to None if name (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.name is None and "name" in self.model_fields_set:
91
+ _dict['name'] = None
92
+
93
+ # set to None if infrastructure (nullable) is None
94
+ # and model_fields_set contains the field
95
+ if self.infrastructure is None and "infrastructure" in self.model_fields_set:
96
+ _dict['infrastructure'] = None
97
+
98
+ # set to None if description (nullable) is None
99
+ # and model_fields_set contains the field
100
+ if self.description is None and "description" in self.model_fields_set:
101
+ _dict['description'] = None
102
+
103
+ # set to None if image_id (nullable) is None
104
+ # and model_fields_set contains the field
105
+ if self.image_id is None and "image_id" in self.model_fields_set:
106
+ _dict['image_id'] = None
107
+
108
+ # set to None if is_hardware (nullable) is None
109
+ # and model_fields_set contains the field
110
+ if self.is_hardware is None and "is_hardware" in self.model_fields_set:
111
+ _dict['is_hardware'] = None
112
+
113
+ # set to None if supports_raw_data (nullable) is None
114
+ # and model_fields_set contains the field
115
+ if self.supports_raw_data is None and "supports_raw_data" in self.model_fields_set:
116
+ _dict['supports_raw_data'] = None
117
+
118
+ # set to None if features (nullable) is None
119
+ # and model_fields_set contains the field
120
+ if self.features is None and "features" in self.model_fields_set:
121
+ _dict['features'] = None
122
+
123
+ # set to None if default_compiler_config (nullable) is None
124
+ # and model_fields_set contains the field
125
+ if self.default_compiler_config is None and "default_compiler_config" in self.model_fields_set:
126
+ _dict['default_compiler_config'] = None
127
+
128
+ # set to None if gateset (nullable) is None
129
+ # and model_fields_set contains the field
130
+ if self.gateset is None and "gateset" in self.model_fields_set:
131
+ _dict['gateset'] = None
132
+
133
+ # set to None if topology (nullable) is None
134
+ # and model_fields_set contains the field
135
+ if self.topology is None and "topology" in self.model_fields_set:
136
+ _dict['topology'] = None
137
+
138
+ # set to None if nqubits (nullable) is None
139
+ # and model_fields_set contains the field
140
+ if self.nqubits is None and "nqubits" in self.model_fields_set:
141
+ _dict['nqubits'] = None
142
+
143
+ # set to None if default_number_of_shots (nullable) is None
144
+ # and model_fields_set contains the field
145
+ if self.default_number_of_shots is None and "default_number_of_shots" in self.model_fields_set:
146
+ _dict['default_number_of_shots'] = None
147
+
148
+ # set to None if max_number_of_shots (nullable) is None
149
+ # and model_fields_set contains the field
150
+ if self.max_number_of_shots is None and "max_number_of_shots" in self.model_fields_set:
151
+ _dict['max_number_of_shots'] = None
152
+
153
+ # set to None if enabled (nullable) is None
154
+ # and model_fields_set contains the field
155
+ if self.enabled is None and "enabled" in self.model_fields_set:
156
+ _dict['enabled'] = None
157
+
158
+ # set to None if identifier (nullable) is None
159
+ # and model_fields_set contains the field
160
+ if self.identifier is None and "identifier" in self.model_fields_set:
161
+ _dict['identifier'] = None
162
+
163
+ # set to None if protocol_version (nullable) is None
164
+ # and model_fields_set contains the field
165
+ if self.protocol_version is None and "protocol_version" in self.model_fields_set:
166
+ _dict['protocol_version'] = None
167
+
168
+ # set to None if job_execution_time_limit (nullable) is None
169
+ # and model_fields_set contains the field
170
+ if self.job_execution_time_limit is None and "job_execution_time_limit" in self.model_fields_set:
171
+ _dict['job_execution_time_limit'] = None
172
+
173
+ return _dict
174
+
175
+ @classmethod
176
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
177
+ """Create an instance of BackendTypePatch from a dict"""
178
+ if obj is None:
179
+ return None
180
+
181
+ if not isinstance(obj, dict):
182
+ return cls.model_validate(obj)
183
+
184
+ _obj = cls.model_validate({
185
+ "name": obj.get("name"),
186
+ "infrastructure": obj.get("infrastructure"),
187
+ "description": obj.get("description"),
188
+ "image_id": obj.get("image_id"),
189
+ "is_hardware": obj.get("is_hardware"),
190
+ "supports_raw_data": obj.get("supports_raw_data"),
191
+ "features": obj.get("features"),
192
+ "default_compiler_config": obj.get("default_compiler_config"),
193
+ "gateset": obj.get("gateset"),
194
+ "topology": obj.get("topology"),
195
+ "nqubits": obj.get("nqubits"),
196
+ "default_number_of_shots": obj.get("default_number_of_shots"),
197
+ "max_number_of_shots": obj.get("max_number_of_shots"),
198
+ "enabled": obj.get("enabled"),
199
+ "identifier": obj.get("identifier"),
200
+ "protocol_version": obj.get("protocol_version"),
201
+ "job_execution_time_limit": obj.get("job_execution_time_limit")
202
+ })
203
+ return _obj
204
+
205
+
@@ -0,0 +1,108 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Quantum Inspire 2
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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
+ from compute_api_client.models.backend_message import BackendMessage
25
+ from compute_api_client.models.backend_status import BackendStatus
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class BackendWithAuthentication(BaseModel):
30
+ """
31
+ BackendWithAuthentication
32
+ """ # noqa: E501
33
+ id: StrictInt = Field(description="The id of the backend")
34
+ name: Annotated[str, Field(strict=True, max_length=32)] = Field(description="The name of the backend")
35
+ location: Annotated[str, Field(strict=True, max_length=32)] = Field(description="The location of the backend")
36
+ backend_type_id: StrictInt = Field(description="The id of the backend type")
37
+ status: BackendStatus = Field(description="Status of the backend")
38
+ message: Optional[BackendMessage] = Field(default=None, description="The message obj for a backend")
39
+ last_heartbeat: datetime = Field(description="Time of last heartbeat")
40
+ authentication_hash: Annotated[str, Field(strict=True, max_length=32)] = Field(description="The authentication hash of the backend")
41
+ __properties: ClassVar[List[str]] = ["id", "name", "location", "backend_type_id", "status", "message", "last_heartbeat", "authentication_hash"]
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of BackendWithAuthentication from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ # override the default output from pydantic by calling `to_dict()` of message
83
+ if self.message:
84
+ _dict['message'] = self.message.to_dict()
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of BackendWithAuthentication from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "id": obj.get("id"),
98
+ "name": obj.get("name"),
99
+ "location": obj.get("location"),
100
+ "backend_type_id": obj.get("backend_type_id"),
101
+ "status": obj.get("status"),
102
+ "message": BackendMessage.from_dict(obj["message"]) if obj.get("message") is not None else None,
103
+ "last_heartbeat": obj.get("last_heartbeat"),
104
+ "authentication_hash": obj.get("authentication_hash")
105
+ })
106
+ return _obj
107
+
108
+
@@ -0,0 +1,130 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Quantum Inspire 2
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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from compute_api_client.models.algorithm_type import AlgorithmType
24
+ from compute_api_client.models.batch_job_status import BatchJobStatus
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class BatchJob(BaseModel):
29
+ """
30
+ BatchJob
31
+ """ # noqa: E501
32
+ id: StrictInt = Field(description="ID of the batch job")
33
+ created_on: datetime = Field(description="Time of batchjob creation")
34
+ status: BatchJobStatus = Field(description="Status of the batchjob")
35
+ user_id: StrictInt = Field(description="ID of the user to whom this job belongs")
36
+ backend_type_id: StrictInt = Field(description="ID of the backendtype")
37
+ backend_id: Optional[StrictInt]
38
+ queued_at: Optional[datetime]
39
+ reserved_at: Optional[datetime]
40
+ finished_at: Optional[datetime]
41
+ job_ids: List[StrictInt] = Field(description="Job ids in the batch job")
42
+ aggregated_algorithm_type: AlgorithmType = Field(description="Algorithm type submitted")
43
+ __properties: ClassVar[List[str]] = ["id", "created_on", "status", "user_id", "backend_type_id", "backend_id", "queued_at", "reserved_at", "finished_at", "job_ids", "aggregated_algorithm_type"]
44
+
45
+ model_config = ConfigDict(
46
+ populate_by_name=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Optional[Self]:
63
+ """Create an instance of BatchJob from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ # set to None if backend_id (nullable) is None
85
+ # and model_fields_set contains the field
86
+ if self.backend_id is None and "backend_id" in self.model_fields_set:
87
+ _dict['backend_id'] = None
88
+
89
+ # set to None if queued_at (nullable) is None
90
+ # and model_fields_set contains the field
91
+ if self.queued_at is None and "queued_at" in self.model_fields_set:
92
+ _dict['queued_at'] = None
93
+
94
+ # set to None if reserved_at (nullable) is None
95
+ # and model_fields_set contains the field
96
+ if self.reserved_at is None and "reserved_at" in self.model_fields_set:
97
+ _dict['reserved_at'] = None
98
+
99
+ # set to None if finished_at (nullable) is None
100
+ # and model_fields_set contains the field
101
+ if self.finished_at is None and "finished_at" in self.model_fields_set:
102
+ _dict['finished_at'] = None
103
+
104
+ return _dict
105
+
106
+ @classmethod
107
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
108
+ """Create an instance of BatchJob from a dict"""
109
+ if obj is None:
110
+ return None
111
+
112
+ if not isinstance(obj, dict):
113
+ return cls.model_validate(obj)
114
+
115
+ _obj = cls.model_validate({
116
+ "id": obj.get("id"),
117
+ "created_on": obj.get("created_on"),
118
+ "status": obj.get("status"),
119
+ "user_id": obj.get("user_id"),
120
+ "backend_type_id": obj.get("backend_type_id"),
121
+ "backend_id": obj.get("backend_id"),
122
+ "queued_at": obj.get("queued_at"),
123
+ "reserved_at": obj.get("reserved_at"),
124
+ "finished_at": obj.get("finished_at"),
125
+ "job_ids": obj.get("job_ids"),
126
+ "aggregated_algorithm_type": obj.get("aggregated_algorithm_type")
127
+ })
128
+ return _obj
129
+
130
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Quantum Inspire 2
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, Field, StrictInt
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class BatchJobIn(BaseModel):
26
+ """
27
+ BatchJobIn
28
+ """ # noqa: E501
29
+ backend_type_id: StrictInt = Field(description="ID of the batch job")
30
+ __properties: ClassVar[List[str]] = ["backend_type_id"]
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 BatchJobIn 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 BatchJobIn 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
+ "backend_type_id": obj.get("backend_type_id")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,40 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Quantum Inspire 2
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 BatchJobStatus(str, Enum):
22
+ """
23
+ BatchJobStatus
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ PLANNED = 'planned'
30
+ QUEUED = 'queued'
31
+ RESERVED = 'reserved'
32
+ RUNNING = 'running'
33
+ FINISHED = 'finished'
34
+
35
+ @classmethod
36
+ def from_json(cls, json_str: str) -> Self:
37
+ """Create an instance of BatchJobStatus from a JSON string"""
38
+ return cls(json.loads(json_str))
39
+
40
+
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Quantum Inspire 2
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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class Commit(BaseModel):
28
+ """
29
+ Commit
30
+ """ # noqa: E501
31
+ id: StrictInt = Field(description="ID of the commit")
32
+ created_on: datetime = Field(description="Time of creation of the commit")
33
+ hash: Annotated[str, Field(strict=True, max_length=32)] = Field(description="Unique hash assigned to the commit")
34
+ description: StrictStr = Field(description="Desriptive message of the commit")
35
+ algorithm_id: StrictInt = Field(description="ID of the algorithm")
36
+ __properties: ClassVar[List[str]] = ["id", "created_on", "hash", "description", "algorithm_id"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of Commit from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of Commit 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
+ "id": obj.get("id"),
90
+ "created_on": obj.get("created_on"),
91
+ "hash": obj.get("hash"),
92
+ "description": obj.get("description"),
93
+ "algorithm_id": obj.get("algorithm_id")
94
+ })
95
+ return _obj
96
+
97
+