qi-compute-api-client 0.49.0__py3-none-any.whl → 0.50.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.
- compute_api_client/__init__.py +1 -4
- compute_api_client/api/__init__.py +0 -1
- compute_api_client/api/backend_types_api.py +302 -3
- compute_api_client/api/results_api.py +0 -17
- compute_api_client/docs/BackendType.md +2 -1
- compute_api_client/docs/BackendTypePatch.md +41 -0
- compute_api_client/docs/BackendTypesApi.md +87 -3
- compute_api_client/docs/File.md +1 -1
- compute_api_client/docs/FileIn.md +1 -1
- compute_api_client/docs/FinalResult.md +1 -1
- compute_api_client/docs/FinalResultIn.md +1 -1
- compute_api_client/docs/Result.md +1 -2
- compute_api_client/docs/ResultIn.md +1 -2
- compute_api_client/docs/ResultsApi.md +2 -4
- compute_api_client/models/__init__.py +1 -3
- compute_api_client/models/backend_type.py +6 -4
- compute_api_client/models/backend_type_patch.py +185 -0
- compute_api_client/models/file.py +2 -2
- compute_api_client/models/file_in.py +2 -2
- compute_api_client/models/final_result.py +2 -2
- compute_api_client/models/final_result_in.py +2 -2
- compute_api_client/models/result.py +2 -4
- compute_api_client/models/result_in.py +2 -9
- {qi_compute_api_client-0.49.0.dist-info → qi_compute_api_client-0.50.0.dist-info}/METADATA +4 -8
- {qi_compute_api_client-0.49.0.dist-info → qi_compute_api_client-0.50.0.dist-info}/RECORD +27 -28
- {qi_compute_api_client-0.49.0.dist-info → qi_compute_api_client-0.50.0.dist-info}/WHEEL +1 -1
- compute_api_client/docs/Metadata.md +0 -31
- compute_api_client/docs/MetadataApi.md +0 -250
- compute_api_client/docs/MetadataIn.md +0 -29
- {qi_compute_api_client-0.49.0.dist-info → qi_compute_api_client-0.50.0.dist-info}/LICENSE.md +0 -0
|
@@ -6,6 +6,7 @@ Method | HTTP request | Description
|
|
|
6
6
|
------------- | ------------- | -------------
|
|
7
7
|
[**read_backend_type_backend_types_id_get**](BackendTypesApi.md#read_backend_type_backend_types_id_get) | **GET** /backend_types/{id} | Retrieve backend type
|
|
8
8
|
[**read_backend_types_backend_types_get**](BackendTypesApi.md#read_backend_types_backend_types_get) | **GET** /backend_types/ | List backend types
|
|
9
|
+
[**update_backend_type_backend_types_me_patch**](BackendTypesApi.md#update_backend_type_backend_types_me_patch) | **PATCH** /backend_types/me | Update backend type
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
# **read_backend_type_backend_types_id_get**
|
|
@@ -92,11 +93,11 @@ Name | Type | Description | Notes
|
|
|
92
93
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
93
94
|
|
|
94
95
|
# **read_backend_types_backend_types_get**
|
|
95
|
-
> PageBackendType read_backend_types_backend_types_get(id=id, name=name, infrastructure=infrastructure, description=description, image_id=image_id, is_hardware=is_hardware, supports_raw_data=supports_raw_data, nqubits=nqubits, status=status, default_number_of_shots=default_number_of_shots, max_number_of_shots=max_number_of_shots, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
96
|
+
> PageBackendType read_backend_types_backend_types_get(id=id, name=name, infrastructure=infrastructure, description=description, image_id=image_id, is_hardware=is_hardware, supports_raw_data=supports_raw_data, nqubits=nqubits, status=status, default_number_of_shots=default_number_of_shots, max_number_of_shots=max_number_of_shots, enabled=enabled, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
96
97
|
|
|
97
98
|
List backend types
|
|
98
99
|
|
|
99
|
-
Read backend types.
|
|
100
|
+
Read backend types. Only enabled backend types are returned.
|
|
100
101
|
|
|
101
102
|
### Example
|
|
102
103
|
|
|
@@ -131,6 +132,7 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
131
132
|
status = compute_api_client.BackendStatus() # BackendStatus | (optional)
|
|
132
133
|
default_number_of_shots = 56 # int | (optional)
|
|
133
134
|
max_number_of_shots = 56 # int | (optional)
|
|
135
|
+
enabled = True # bool | (optional)
|
|
134
136
|
sort_by = 'sort_by_example' # str | The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'. (optional)
|
|
135
137
|
latest = True # bool | If True gets the most recently created object. (optional)
|
|
136
138
|
page = 1 # int | Page number (optional) (default to 1)
|
|
@@ -138,7 +140,7 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
138
140
|
|
|
139
141
|
try:
|
|
140
142
|
# List backend types
|
|
141
|
-
api_response = await api_instance.read_backend_types_backend_types_get(id=id, name=name, infrastructure=infrastructure, description=description, image_id=image_id, is_hardware=is_hardware, supports_raw_data=supports_raw_data, nqubits=nqubits, status=status, default_number_of_shots=default_number_of_shots, max_number_of_shots=max_number_of_shots, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
143
|
+
api_response = await api_instance.read_backend_types_backend_types_get(id=id, name=name, infrastructure=infrastructure, description=description, image_id=image_id, is_hardware=is_hardware, supports_raw_data=supports_raw_data, nqubits=nqubits, status=status, default_number_of_shots=default_number_of_shots, max_number_of_shots=max_number_of_shots, enabled=enabled, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
142
144
|
print("The response of BackendTypesApi->read_backend_types_backend_types_get:\n")
|
|
143
145
|
pprint(api_response)
|
|
144
146
|
except Exception as e:
|
|
@@ -162,6 +164,7 @@ Name | Type | Description | Notes
|
|
|
162
164
|
**status** | [**BackendStatus**](.md)| | [optional]
|
|
163
165
|
**default_number_of_shots** | **int**| | [optional]
|
|
164
166
|
**max_number_of_shots** | **int**| | [optional]
|
|
167
|
+
**enabled** | **bool**| | [optional]
|
|
165
168
|
**sort_by** | **str**| The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'. | [optional]
|
|
166
169
|
**latest** | **bool**| If True gets the most recently created object. | [optional]
|
|
167
170
|
**page** | **int**| Page number | [optional] [default to 1]
|
|
@@ -188,3 +191,84 @@ No authorization required
|
|
|
188
191
|
|
|
189
192
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
190
193
|
|
|
194
|
+
# **update_backend_type_backend_types_me_patch**
|
|
195
|
+
> BackendType update_backend_type_backend_types_me_patch(backend_type_patch)
|
|
196
|
+
|
|
197
|
+
Update backend type
|
|
198
|
+
|
|
199
|
+
Update backend type by ID. This endpoint allows for partial updates of backend type properties.
|
|
200
|
+
|
|
201
|
+
### Example
|
|
202
|
+
|
|
203
|
+
* Api Key Authentication (backend):
|
|
204
|
+
```python
|
|
205
|
+
import time
|
|
206
|
+
import os
|
|
207
|
+
import compute_api_client
|
|
208
|
+
from compute_api_client.models.backend_type import BackendType
|
|
209
|
+
from compute_api_client.models.backend_type_patch import BackendTypePatch
|
|
210
|
+
from compute_api_client.rest import ApiException
|
|
211
|
+
from pprint import pprint
|
|
212
|
+
|
|
213
|
+
# Defining the host is optional and defaults to http://localhost
|
|
214
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
215
|
+
configuration = compute_api_client.Configuration(
|
|
216
|
+
host = "http://localhost"
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
# The client must configure the authentication and authorization parameters
|
|
220
|
+
# in accordance with the API server security policy.
|
|
221
|
+
# Examples for each auth method are provided below, use the example that
|
|
222
|
+
# satisfies your auth use case.
|
|
223
|
+
|
|
224
|
+
# Configure API key authorization: backend
|
|
225
|
+
configuration.api_key['backend'] = os.environ["API_KEY"]
|
|
226
|
+
|
|
227
|
+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
228
|
+
# configuration.api_key_prefix['backend'] = 'Bearer'
|
|
229
|
+
|
|
230
|
+
# Enter a context with an instance of the API client
|
|
231
|
+
async with compute_api_client.ApiClient(configuration) as api_client:
|
|
232
|
+
# Create an instance of the API class
|
|
233
|
+
api_instance = compute_api_client.BackendTypesApi(api_client)
|
|
234
|
+
backend_type_patch = compute_api_client.BackendTypePatch() # BackendTypePatch |
|
|
235
|
+
|
|
236
|
+
try:
|
|
237
|
+
# Update backend type
|
|
238
|
+
api_response = await api_instance.update_backend_type_backend_types_me_patch(backend_type_patch)
|
|
239
|
+
print("The response of BackendTypesApi->update_backend_type_backend_types_me_patch:\n")
|
|
240
|
+
pprint(api_response)
|
|
241
|
+
except Exception as e:
|
|
242
|
+
print("Exception when calling BackendTypesApi->update_backend_type_backend_types_me_patch: %s\n" % e)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
### Parameters
|
|
248
|
+
|
|
249
|
+
Name | Type | Description | Notes
|
|
250
|
+
------------- | ------------- | ------------- | -------------
|
|
251
|
+
**backend_type_patch** | [**BackendTypePatch**](BackendTypePatch.md)| |
|
|
252
|
+
|
|
253
|
+
### Return type
|
|
254
|
+
|
|
255
|
+
[**BackendType**](BackendType.md)
|
|
256
|
+
|
|
257
|
+
### Authorization
|
|
258
|
+
|
|
259
|
+
[backend](../README.md#backend)
|
|
260
|
+
|
|
261
|
+
### HTTP request headers
|
|
262
|
+
|
|
263
|
+
- **Content-Type**: application/json
|
|
264
|
+
- **Accept**: application/json
|
|
265
|
+
|
|
266
|
+
### HTTP response details
|
|
267
|
+
| Status code | Description | Response headers |
|
|
268
|
+
|-------------|-------------|------------------|
|
|
269
|
+
**200** | Successful Response | - |
|
|
270
|
+
**404** | Not Found | - |
|
|
271
|
+
**422** | Validation Error | - |
|
|
272
|
+
|
|
273
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
274
|
+
|
compute_api_client/docs/File.md
CHANGED
|
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
|
|
|
9
9
|
**content** | **str** | |
|
|
10
10
|
**language_id** | **int** | |
|
|
11
11
|
**compile_stage** | [**CompileStage**](CompileStage.md) | |
|
|
12
|
-
**compile_properties** | **object** | |
|
|
12
|
+
**compile_properties** | **Dict[str, object]** | |
|
|
13
13
|
**generated** | **bool** | |
|
|
14
14
|
**name** | **str** | | [optional]
|
|
15
15
|
|
|
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
|
|
|
8
8
|
**content** | **str** | |
|
|
9
9
|
**language_id** | **int** | |
|
|
10
10
|
**compile_stage** | [**CompileStage**](CompileStage.md) | |
|
|
11
|
-
**compile_properties** | **object** | |
|
|
11
|
+
**compile_properties** | **Dict[str, object]** | |
|
|
12
12
|
**generated** | **bool** | | [optional] [default to False]
|
|
13
13
|
**name** | **str** | | [optional]
|
|
14
14
|
|
|
@@ -7,11 +7,10 @@ Name | Type | Description | Notes
|
|
|
7
7
|
**id** | **int** | |
|
|
8
8
|
**created_on** | **datetime** | |
|
|
9
9
|
**job_id** | **int** | |
|
|
10
|
-
**metadata_id** | **int** | |
|
|
11
10
|
**execution_time_in_seconds** | **float** | |
|
|
12
11
|
**shots_requested** | **int** | |
|
|
13
12
|
**shots_done** | **int** | |
|
|
14
|
-
**results** | **object** | |
|
|
13
|
+
**results** | **Dict[str, object]** | |
|
|
15
14
|
**raw_data** | **List[str]** | |
|
|
16
15
|
|
|
17
16
|
## Example
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
Name | Type | Description | Notes
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
|
7
7
|
**job_id** | **int** | |
|
|
8
|
-
**metadata_id** | **int** | | [optional]
|
|
9
8
|
**execution_time_in_seconds** | **float** | |
|
|
10
9
|
**shots_requested** | **int** | | [optional]
|
|
11
10
|
**shots_done** | **int** | | [optional]
|
|
12
|
-
**results** | **object** | | [optional]
|
|
11
|
+
**results** | **Dict[str, object]** | | [optional]
|
|
13
12
|
**raw_data** | **List[str]** | | [optional]
|
|
14
13
|
|
|
15
14
|
## Example
|
|
@@ -245,7 +245,7 @@ Name | Type | Description | Notes
|
|
|
245
245
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
246
246
|
|
|
247
247
|
# **read_results_by_algorithm_id_results_algorithm_algorithm_id_get**
|
|
248
|
-
> PageResult read_results_by_algorithm_id_results_algorithm_algorithm_id_get(algorithm_id, id=id, created_on=created_on, job_id=job_id,
|
|
248
|
+
> PageResult read_results_by_algorithm_id_results_algorithm_algorithm_id_get(algorithm_id, id=id, created_on=created_on, job_id=job_id, execution_time_in_seconds=execution_time_in_seconds, shots_requested__isnull=shots_requested__isnull, shots_requested=shots_requested, shots_done__isnull=shots_done__isnull, shots_done=shots_done, results__isnull=results__isnull, raw_data__isnull=raw_data__isnull, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
249
249
|
|
|
250
250
|
Retrieve results by algorithm ID
|
|
251
251
|
|
|
@@ -283,7 +283,6 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
283
283
|
id = 56 # int | (optional)
|
|
284
284
|
created_on = '2013-10-20T19:20:30+01:00' # datetime | (optional)
|
|
285
285
|
job_id = 56 # int | (optional)
|
|
286
|
-
metadata_id = 56 # int | (optional)
|
|
287
286
|
execution_time_in_seconds = 3.4 # float | (optional)
|
|
288
287
|
shots_requested__isnull = True # bool | (optional)
|
|
289
288
|
shots_requested = 56 # int | (optional)
|
|
@@ -298,7 +297,7 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
298
297
|
|
|
299
298
|
try:
|
|
300
299
|
# Retrieve results by algorithm ID
|
|
301
|
-
api_response = await api_instance.read_results_by_algorithm_id_results_algorithm_algorithm_id_get(algorithm_id, id=id, created_on=created_on, job_id=job_id,
|
|
300
|
+
api_response = await api_instance.read_results_by_algorithm_id_results_algorithm_algorithm_id_get(algorithm_id, id=id, created_on=created_on, job_id=job_id, execution_time_in_seconds=execution_time_in_seconds, shots_requested__isnull=shots_requested__isnull, shots_requested=shots_requested, shots_done__isnull=shots_done__isnull, shots_done=shots_done, results__isnull=results__isnull, raw_data__isnull=raw_data__isnull, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
302
301
|
print("The response of ResultsApi->read_results_by_algorithm_id_results_algorithm_algorithm_id_get:\n")
|
|
303
302
|
pprint(api_response)
|
|
304
303
|
except Exception as e:
|
|
@@ -315,7 +314,6 @@ Name | Type | Description | Notes
|
|
|
315
314
|
**id** | **int**| | [optional]
|
|
316
315
|
**created_on** | **datetime**| | [optional]
|
|
317
316
|
**job_id** | **int**| | [optional]
|
|
318
|
-
**metadata_id** | **int**| | [optional]
|
|
319
317
|
**execution_time_in_seconds** | **float**| | [optional]
|
|
320
318
|
**shots_requested__isnull** | **bool**| | [optional]
|
|
321
319
|
**shots_requested** | **int**| | [optional]
|
|
@@ -23,6 +23,7 @@ from compute_api_client.models.backend_in import BackendIn
|
|
|
23
23
|
from compute_api_client.models.backend_patch import BackendPatch
|
|
24
24
|
from compute_api_client.models.backend_status import BackendStatus
|
|
25
25
|
from compute_api_client.models.backend_type import BackendType
|
|
26
|
+
from compute_api_client.models.backend_type_patch import BackendTypePatch
|
|
26
27
|
from compute_api_client.models.backend_with_authentication import BackendWithAuthentication
|
|
27
28
|
from compute_api_client.models.batch_job import BatchJob
|
|
28
29
|
from compute_api_client.models.batch_job_in import BatchJobIn
|
|
@@ -47,8 +48,6 @@ from compute_api_client.models.language import Language
|
|
|
47
48
|
from compute_api_client.models.location_inner import LocationInner
|
|
48
49
|
from compute_api_client.models.member import Member
|
|
49
50
|
from compute_api_client.models.member_in import MemberIn
|
|
50
|
-
from compute_api_client.models.metadata import Metadata
|
|
51
|
-
from compute_api_client.models.metadata_in import MetadataIn
|
|
52
51
|
from compute_api_client.models.page_algorithm import PageAlgorithm
|
|
53
52
|
from compute_api_client.models.page_backend import PageBackend
|
|
54
53
|
from compute_api_client.models.page_backend_type import PageBackendType
|
|
@@ -58,7 +57,6 @@ from compute_api_client.models.page_file import PageFile
|
|
|
58
57
|
from compute_api_client.models.page_job import PageJob
|
|
59
58
|
from compute_api_client.models.page_language import PageLanguage
|
|
60
59
|
from compute_api_client.models.page_member import PageMember
|
|
61
|
-
from compute_api_client.models.page_metadata import PageMetadata
|
|
62
60
|
from compute_api_client.models.page_permission import PagePermission
|
|
63
61
|
from compute_api_client.models.page_permission_group import PagePermissionGroup
|
|
64
62
|
from compute_api_client.models.page_project import PageProject
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
|
|
23
23
|
from pydantic import Field
|
|
24
24
|
from typing_extensions import Annotated
|
|
@@ -40,14 +40,15 @@ class BackendType(BaseModel):
|
|
|
40
40
|
is_hardware: StrictBool
|
|
41
41
|
supports_raw_data: StrictBool
|
|
42
42
|
features: List[StrictStr]
|
|
43
|
-
default_compiler_config:
|
|
43
|
+
default_compiler_config: Dict[str, Any]
|
|
44
44
|
gateset: List[StrictStr]
|
|
45
45
|
topology: List[List[StrictInt]]
|
|
46
46
|
nqubits: StrictInt
|
|
47
47
|
status: BackendStatus
|
|
48
48
|
default_number_of_shots: StrictInt
|
|
49
49
|
max_number_of_shots: StrictInt
|
|
50
|
-
|
|
50
|
+
enabled: StrictBool
|
|
51
|
+
__properties: ClassVar[List[str]] = ["id", "name", "infrastructure", "description", "image_id", "is_hardware", "supports_raw_data", "features", "default_compiler_config", "gateset", "topology", "nqubits", "status", "default_number_of_shots", "max_number_of_shots", "enabled"]
|
|
51
52
|
|
|
52
53
|
model_config = {
|
|
53
54
|
"populate_by_name": True,
|
|
@@ -111,7 +112,8 @@ class BackendType(BaseModel):
|
|
|
111
112
|
"nqubits": obj.get("nqubits"),
|
|
112
113
|
"status": obj.get("status"),
|
|
113
114
|
"default_number_of_shots": obj.get("default_number_of_shots"),
|
|
114
|
-
"max_number_of_shots": obj.get("max_number_of_shots")
|
|
115
|
+
"max_number_of_shots": obj.get("max_number_of_shots"),
|
|
116
|
+
"enabled": obj.get("enabled")
|
|
115
117
|
})
|
|
116
118
|
return _obj
|
|
117
119
|
|
|
@@ -0,0 +1,185 @@
|
|
|
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
|
+
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
|
|
23
|
+
from pydantic import Field
|
|
24
|
+
from typing_extensions import Annotated
|
|
25
|
+
try:
|
|
26
|
+
from typing import Self
|
|
27
|
+
except ImportError:
|
|
28
|
+
from typing_extensions import Self
|
|
29
|
+
|
|
30
|
+
class BackendTypePatch(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
BackendTypePatch
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
name: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None
|
|
35
|
+
infrastructure: Optional[Annotated[str, Field(strict=True, max_length=32)]] = None
|
|
36
|
+
description: Optional[StrictStr] = None
|
|
37
|
+
image_id: Optional[Annotated[str, Field(strict=True, max_length=16)]] = None
|
|
38
|
+
is_hardware: Optional[StrictBool] = None
|
|
39
|
+
supports_raw_data: Optional[StrictBool] = None
|
|
40
|
+
features: Optional[List[StrictStr]] = None
|
|
41
|
+
default_compiler_config: Optional[Dict[str, Any]] = None
|
|
42
|
+
gateset: Optional[List[StrictStr]] = None
|
|
43
|
+
topology: Optional[List[List[StrictInt]]] = None
|
|
44
|
+
nqubits: Optional[StrictInt] = None
|
|
45
|
+
default_number_of_shots: Optional[StrictInt] = None
|
|
46
|
+
max_number_of_shots: Optional[StrictInt] = None
|
|
47
|
+
enabled: Optional[StrictBool] = None
|
|
48
|
+
__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"]
|
|
49
|
+
|
|
50
|
+
model_config = {
|
|
51
|
+
"populate_by_name": True,
|
|
52
|
+
"validate_assignment": True
|
|
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) -> 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
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude={
|
|
83
|
+
},
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
# set to None if name (nullable) is None
|
|
87
|
+
# and model_fields_set contains the field
|
|
88
|
+
if self.name is None and "name" in self.model_fields_set:
|
|
89
|
+
_dict['name'] = None
|
|
90
|
+
|
|
91
|
+
# set to None if infrastructure (nullable) is None
|
|
92
|
+
# and model_fields_set contains the field
|
|
93
|
+
if self.infrastructure is None and "infrastructure" in self.model_fields_set:
|
|
94
|
+
_dict['infrastructure'] = None
|
|
95
|
+
|
|
96
|
+
# set to None if description (nullable) is None
|
|
97
|
+
# and model_fields_set contains the field
|
|
98
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
99
|
+
_dict['description'] = None
|
|
100
|
+
|
|
101
|
+
# set to None if image_id (nullable) is None
|
|
102
|
+
# and model_fields_set contains the field
|
|
103
|
+
if self.image_id is None and "image_id" in self.model_fields_set:
|
|
104
|
+
_dict['image_id'] = None
|
|
105
|
+
|
|
106
|
+
# set to None if is_hardware (nullable) is None
|
|
107
|
+
# and model_fields_set contains the field
|
|
108
|
+
if self.is_hardware is None and "is_hardware" in self.model_fields_set:
|
|
109
|
+
_dict['is_hardware'] = None
|
|
110
|
+
|
|
111
|
+
# set to None if supports_raw_data (nullable) is None
|
|
112
|
+
# and model_fields_set contains the field
|
|
113
|
+
if self.supports_raw_data is None and "supports_raw_data" in self.model_fields_set:
|
|
114
|
+
_dict['supports_raw_data'] = None
|
|
115
|
+
|
|
116
|
+
# set to None if features (nullable) is None
|
|
117
|
+
# and model_fields_set contains the field
|
|
118
|
+
if self.features is None and "features" in self.model_fields_set:
|
|
119
|
+
_dict['features'] = None
|
|
120
|
+
|
|
121
|
+
# set to None if default_compiler_config (nullable) is None
|
|
122
|
+
# and model_fields_set contains the field
|
|
123
|
+
if self.default_compiler_config is None and "default_compiler_config" in self.model_fields_set:
|
|
124
|
+
_dict['default_compiler_config'] = None
|
|
125
|
+
|
|
126
|
+
# set to None if gateset (nullable) is None
|
|
127
|
+
# and model_fields_set contains the field
|
|
128
|
+
if self.gateset is None and "gateset" in self.model_fields_set:
|
|
129
|
+
_dict['gateset'] = None
|
|
130
|
+
|
|
131
|
+
# set to None if topology (nullable) is None
|
|
132
|
+
# and model_fields_set contains the field
|
|
133
|
+
if self.topology is None and "topology" in self.model_fields_set:
|
|
134
|
+
_dict['topology'] = None
|
|
135
|
+
|
|
136
|
+
# set to None if nqubits (nullable) is None
|
|
137
|
+
# and model_fields_set contains the field
|
|
138
|
+
if self.nqubits is None and "nqubits" in self.model_fields_set:
|
|
139
|
+
_dict['nqubits'] = None
|
|
140
|
+
|
|
141
|
+
# set to None if default_number_of_shots (nullable) is None
|
|
142
|
+
# and model_fields_set contains the field
|
|
143
|
+
if self.default_number_of_shots is None and "default_number_of_shots" in self.model_fields_set:
|
|
144
|
+
_dict['default_number_of_shots'] = None
|
|
145
|
+
|
|
146
|
+
# set to None if max_number_of_shots (nullable) is None
|
|
147
|
+
# and model_fields_set contains the field
|
|
148
|
+
if self.max_number_of_shots is None and "max_number_of_shots" in self.model_fields_set:
|
|
149
|
+
_dict['max_number_of_shots'] = None
|
|
150
|
+
|
|
151
|
+
# set to None if enabled (nullable) is None
|
|
152
|
+
# and model_fields_set contains the field
|
|
153
|
+
if self.enabled is None and "enabled" in self.model_fields_set:
|
|
154
|
+
_dict['enabled'] = None
|
|
155
|
+
|
|
156
|
+
return _dict
|
|
157
|
+
|
|
158
|
+
@classmethod
|
|
159
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
160
|
+
"""Create an instance of BackendTypePatch from a dict"""
|
|
161
|
+
if obj is None:
|
|
162
|
+
return None
|
|
163
|
+
|
|
164
|
+
if not isinstance(obj, dict):
|
|
165
|
+
return cls.model_validate(obj)
|
|
166
|
+
|
|
167
|
+
_obj = cls.model_validate({
|
|
168
|
+
"name": obj.get("name"),
|
|
169
|
+
"infrastructure": obj.get("infrastructure"),
|
|
170
|
+
"description": obj.get("description"),
|
|
171
|
+
"image_id": obj.get("image_id"),
|
|
172
|
+
"is_hardware": obj.get("is_hardware"),
|
|
173
|
+
"supports_raw_data": obj.get("supports_raw_data"),
|
|
174
|
+
"features": obj.get("features"),
|
|
175
|
+
"default_compiler_config": obj.get("default_compiler_config"),
|
|
176
|
+
"gateset": obj.get("gateset"),
|
|
177
|
+
"topology": obj.get("topology"),
|
|
178
|
+
"nqubits": obj.get("nqubits"),
|
|
179
|
+
"default_number_of_shots": obj.get("default_number_of_shots"),
|
|
180
|
+
"max_number_of_shots": obj.get("max_number_of_shots"),
|
|
181
|
+
"enabled": obj.get("enabled")
|
|
182
|
+
})
|
|
183
|
+
return _obj
|
|
184
|
+
|
|
185
|
+
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
|
|
23
23
|
from pydantic import Field
|
|
24
24
|
from typing_extensions import Annotated
|
|
@@ -37,7 +37,7 @@ class File(BaseModel):
|
|
|
37
37
|
content: StrictStr
|
|
38
38
|
language_id: StrictInt
|
|
39
39
|
compile_stage: CompileStage
|
|
40
|
-
compile_properties:
|
|
40
|
+
compile_properties: Dict[str, Any]
|
|
41
41
|
generated: StrictBool
|
|
42
42
|
name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None
|
|
43
43
|
__properties: ClassVar[List[str]] = ["id", "commit_id", "content", "language_id", "compile_stage", "compile_properties", "generated", "name"]
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
|
|
23
23
|
from pydantic import Field
|
|
24
24
|
from typing_extensions import Annotated
|
|
@@ -36,7 +36,7 @@ class FileIn(BaseModel):
|
|
|
36
36
|
content: StrictStr
|
|
37
37
|
language_id: StrictInt
|
|
38
38
|
compile_stage: CompileStage
|
|
39
|
-
compile_properties:
|
|
39
|
+
compile_properties: Dict[str, Any]
|
|
40
40
|
generated: Optional[StrictBool] = False
|
|
41
41
|
name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None
|
|
42
42
|
__properties: ClassVar[List[str]] = ["commit_id", "content", "language_id", "compile_stage", "compile_properties", "generated", "name"]
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from pydantic import BaseModel, StrictInt
|
|
23
23
|
try:
|
|
24
24
|
from typing import Self
|
|
@@ -32,7 +32,7 @@ class FinalResult(BaseModel):
|
|
|
32
32
|
id: StrictInt
|
|
33
33
|
created_on: datetime
|
|
34
34
|
job_id: StrictInt
|
|
35
|
-
final_result:
|
|
35
|
+
final_result: Dict[str, Any]
|
|
36
36
|
__properties: ClassVar[List[str]] = ["id", "created_on", "job_id", "final_result"]
|
|
37
37
|
|
|
38
38
|
model_config = {
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from pydantic import BaseModel, StrictInt
|
|
23
23
|
try:
|
|
24
24
|
from typing import Self
|
|
@@ -30,7 +30,7 @@ class FinalResultIn(BaseModel):
|
|
|
30
30
|
FinalResultIn
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
job_id: StrictInt
|
|
33
|
-
final_result:
|
|
33
|
+
final_result: Dict[str, Any]
|
|
34
34
|
__properties: ClassVar[List[str]] = ["job_id", "final_result"]
|
|
35
35
|
|
|
36
36
|
model_config = {
|
|
@@ -32,13 +32,12 @@ class Result(BaseModel):
|
|
|
32
32
|
id: StrictInt
|
|
33
33
|
created_on: datetime
|
|
34
34
|
job_id: StrictInt
|
|
35
|
-
metadata_id: StrictInt
|
|
36
35
|
execution_time_in_seconds: Union[StrictFloat, StrictInt]
|
|
37
36
|
shots_requested: Optional[StrictInt]
|
|
38
37
|
shots_done: Optional[StrictInt]
|
|
39
|
-
results: Optional[
|
|
38
|
+
results: Optional[Dict[str, Any]]
|
|
40
39
|
raw_data: Optional[List[StrictStr]]
|
|
41
|
-
__properties: ClassVar[List[str]] = ["id", "created_on", "job_id", "
|
|
40
|
+
__properties: ClassVar[List[str]] = ["id", "created_on", "job_id", "execution_time_in_seconds", "shots_requested", "shots_done", "results", "raw_data"]
|
|
42
41
|
|
|
43
42
|
model_config = {
|
|
44
43
|
"populate_by_name": True,
|
|
@@ -111,7 +110,6 @@ class Result(BaseModel):
|
|
|
111
110
|
"id": obj.get("id"),
|
|
112
111
|
"created_on": obj.get("created_on"),
|
|
113
112
|
"job_id": obj.get("job_id"),
|
|
114
|
-
"metadata_id": obj.get("metadata_id"),
|
|
115
113
|
"execution_time_in_seconds": obj.get("execution_time_in_seconds"),
|
|
116
114
|
"shots_requested": obj.get("shots_requested"),
|
|
117
115
|
"shots_done": obj.get("shots_done"),
|
|
@@ -30,13 +30,12 @@ class ResultIn(BaseModel):
|
|
|
30
30
|
ResultIn
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
job_id: StrictInt
|
|
33
|
-
metadata_id: Optional[StrictInt] = None
|
|
34
33
|
execution_time_in_seconds: Union[StrictFloat, StrictInt]
|
|
35
34
|
shots_requested: Optional[StrictInt] = None
|
|
36
35
|
shots_done: Optional[StrictInt] = None
|
|
37
|
-
results: Optional[
|
|
36
|
+
results: Optional[Dict[str, Any]] = None
|
|
38
37
|
raw_data: Optional[List[StrictStr]] = None
|
|
39
|
-
__properties: ClassVar[List[str]] = ["job_id", "
|
|
38
|
+
__properties: ClassVar[List[str]] = ["job_id", "execution_time_in_seconds", "shots_requested", "shots_done", "results", "raw_data"]
|
|
40
39
|
|
|
41
40
|
model_config = {
|
|
42
41
|
"populate_by_name": True,
|
|
@@ -74,11 +73,6 @@ class ResultIn(BaseModel):
|
|
|
74
73
|
},
|
|
75
74
|
exclude_none=True,
|
|
76
75
|
)
|
|
77
|
-
# set to None if metadata_id (nullable) is None
|
|
78
|
-
# and model_fields_set contains the field
|
|
79
|
-
if self.metadata_id is None and "metadata_id" in self.model_fields_set:
|
|
80
|
-
_dict['metadata_id'] = None
|
|
81
|
-
|
|
82
76
|
# set to None if shots_requested (nullable) is None
|
|
83
77
|
# and model_fields_set contains the field
|
|
84
78
|
if self.shots_requested is None and "shots_requested" in self.model_fields_set:
|
|
@@ -112,7 +106,6 @@ class ResultIn(BaseModel):
|
|
|
112
106
|
|
|
113
107
|
_obj = cls.model_validate({
|
|
114
108
|
"job_id": obj.get("job_id"),
|
|
115
|
-
"metadata_id": obj.get("metadata_id"),
|
|
116
109
|
"execution_time_in_seconds": obj.get("execution_time_in_seconds"),
|
|
117
110
|
"shots_requested": obj.get("shots_requested"),
|
|
118
111
|
"shots_done": obj.get("shots_done"),
|