qi-compute-api-client 0.38.2__py3-none-any.whl → 0.42.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 +3 -0
- compute_api_client/api/__init__.py +1 -0
- compute_api_client/api/auth_config_api.py +286 -0
- compute_api_client/api/backend_types_api.py +19 -1
- compute_api_client/api/jobs_api.py +17 -0
- compute_api_client/api/results_api.py +17 -0
- compute_api_client/docs/AuthConfig.md +30 -0
- compute_api_client/docs/AuthConfigApi.md +70 -0
- compute_api_client/docs/BackendType.md +1 -0
- compute_api_client/docs/BackendTypesApi.md +12 -3
- compute_api_client/docs/CommitsApi.md +1 -0
- compute_api_client/docs/HTTPBadRequestError.md +28 -0
- compute_api_client/docs/Job.md +1 -0
- compute_api_client/docs/JobIn.md +1 -0
- compute_api_client/docs/JobsApi.md +4 -2
- compute_api_client/docs/Result.md +1 -0
- compute_api_client/docs/ResultIn.md +1 -0
- compute_api_client/docs/ResultsApi.md +4 -2
- compute_api_client/models/__init__.py +2 -0
- compute_api_client/models/auth_config.py +91 -0
- compute_api_client/models/backend_type.py +3 -1
- compute_api_client/models/http_bad_request_error.py +87 -0
- compute_api_client/models/job.py +5 -3
- compute_api_client/models/job_in.py +5 -3
- compute_api_client/models/result.py +10 -3
- compute_api_client/models/result_in.py +10 -3
- {qi_compute_api_client-0.38.2.dist-info → qi_compute_api_client-0.42.0.dist-info}/METADATA +5 -2
- {qi_compute_api_client-0.38.2.dist-info → qi_compute_api_client-0.42.0.dist-info}/RECORD +30 -24
- {qi_compute_api_client-0.38.2.dist-info → qi_compute_api_client-0.42.0.dist-info}/LICENSE.md +0 -0
- {qi_compute_api_client-0.38.2.dist-info → qi_compute_api_client-0.42.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# compute_api_client.AuthConfigApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**auth_config_auth_config_get**](AuthConfigApi.md#auth_config_auth_config_get) | **GET** /auth_config | Get suggested authentication configuration
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# **auth_config_auth_config_get**
|
|
11
|
+
> AuthConfig auth_config_auth_config_get()
|
|
12
|
+
|
|
13
|
+
Get suggested authentication configuration
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import time
|
|
19
|
+
import os
|
|
20
|
+
import compute_api_client
|
|
21
|
+
from compute_api_client.models.auth_config import AuthConfig
|
|
22
|
+
from compute_api_client.rest import ApiException
|
|
23
|
+
from pprint import pprint
|
|
24
|
+
|
|
25
|
+
# Defining the host is optional and defaults to http://localhost
|
|
26
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
27
|
+
configuration = compute_api_client.Configuration(
|
|
28
|
+
host = "http://localhost"
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Enter a context with an instance of the API client
|
|
33
|
+
async with compute_api_client.ApiClient(configuration) as api_client:
|
|
34
|
+
# Create an instance of the API class
|
|
35
|
+
api_instance = compute_api_client.AuthConfigApi(api_client)
|
|
36
|
+
|
|
37
|
+
try:
|
|
38
|
+
# Get suggested authentication configuration
|
|
39
|
+
api_response = await api_instance.auth_config_auth_config_get()
|
|
40
|
+
print("The response of AuthConfigApi->auth_config_auth_config_get:\n")
|
|
41
|
+
pprint(api_response)
|
|
42
|
+
except Exception as e:
|
|
43
|
+
print("Exception when calling AuthConfigApi->auth_config_auth_config_get: %s\n" % e)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Parameters
|
|
49
|
+
This endpoint does not need any parameter.
|
|
50
|
+
|
|
51
|
+
### Return type
|
|
52
|
+
|
|
53
|
+
[**AuthConfig**](AuthConfig.md)
|
|
54
|
+
|
|
55
|
+
### Authorization
|
|
56
|
+
|
|
57
|
+
No authorization required
|
|
58
|
+
|
|
59
|
+
### HTTP request headers
|
|
60
|
+
|
|
61
|
+
- **Content-Type**: Not defined
|
|
62
|
+
- **Accept**: application/json
|
|
63
|
+
|
|
64
|
+
### HTTP response details
|
|
65
|
+
| Status code | Description | Response headers |
|
|
66
|
+
|-------------|-------------|------------------|
|
|
67
|
+
**200** | Successful Response | - |
|
|
68
|
+
|
|
69
|
+
[[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)
|
|
70
|
+
|
|
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
|
|
10
10
|
**description** | **str** | |
|
|
11
11
|
**image_id** | **str** | |
|
|
12
12
|
**is_hardware** | **bool** | |
|
|
13
|
+
**supports_raw_data** | **bool** | |
|
|
13
14
|
**features** | **List[str]** | |
|
|
14
15
|
**default_compiler_config** | **object** | |
|
|
15
16
|
**gateset** | **List[str]** | |
|
|
@@ -18,6 +18,7 @@ Get backend type by ID.
|
|
|
18
18
|
### Example
|
|
19
19
|
|
|
20
20
|
* OAuth Authentication (user_bearer):
|
|
21
|
+
* Api Key Authentication (backend):
|
|
21
22
|
```python
|
|
22
23
|
import time
|
|
23
24
|
import os
|
|
@@ -39,6 +40,12 @@ configuration = compute_api_client.Configuration(
|
|
|
39
40
|
|
|
40
41
|
configuration.access_token = os.environ["ACCESS_TOKEN"]
|
|
41
42
|
|
|
43
|
+
# Configure API key authorization: backend
|
|
44
|
+
configuration.api_key['backend'] = os.environ["API_KEY"]
|
|
45
|
+
|
|
46
|
+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
47
|
+
# configuration.api_key_prefix['backend'] = 'Bearer'
|
|
48
|
+
|
|
42
49
|
# Enter a context with an instance of the API client
|
|
43
50
|
async with compute_api_client.ApiClient(configuration) as api_client:
|
|
44
51
|
# Create an instance of the API class
|
|
@@ -68,7 +75,7 @@ Name | Type | Description | Notes
|
|
|
68
75
|
|
|
69
76
|
### Authorization
|
|
70
77
|
|
|
71
|
-
[user_bearer](../README.md#user_bearer)
|
|
78
|
+
[user_bearer](../README.md#user_bearer), [backend](../README.md#backend)
|
|
72
79
|
|
|
73
80
|
### HTTP request headers
|
|
74
81
|
|
|
@@ -85,7 +92,7 @@ Name | Type | Description | Notes
|
|
|
85
92
|
[[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)
|
|
86
93
|
|
|
87
94
|
# **read_backend_types_backend_types_get**
|
|
88
|
-
> PageBackendType read_backend_types_backend_types_get(id=id, name=name, infrastructure=infrastructure, description=description, image_id=image_id, is_hardware=is_hardware, 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)
|
|
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)
|
|
89
96
|
|
|
90
97
|
List backend types
|
|
91
98
|
|
|
@@ -119,6 +126,7 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
119
126
|
description = 'description_example' # str | (optional)
|
|
120
127
|
image_id = 'image_id_example' # str | (optional)
|
|
121
128
|
is_hardware = True # bool | (optional)
|
|
129
|
+
supports_raw_data = True # bool | (optional)
|
|
122
130
|
nqubits = 56 # int | (optional)
|
|
123
131
|
status = compute_api_client.BackendStatus() # BackendStatus | (optional)
|
|
124
132
|
default_number_of_shots = 56 # int | (optional)
|
|
@@ -130,7 +138,7 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
130
138
|
|
|
131
139
|
try:
|
|
132
140
|
# List backend types
|
|
133
|
-
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, 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)
|
|
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)
|
|
134
142
|
print("The response of BackendTypesApi->read_backend_types_backend_types_get:\n")
|
|
135
143
|
pprint(api_response)
|
|
136
144
|
except Exception as e:
|
|
@@ -149,6 +157,7 @@ Name | Type | Description | Notes
|
|
|
149
157
|
**description** | **str**| | [optional]
|
|
150
158
|
**image_id** | **str**| | [optional]
|
|
151
159
|
**is_hardware** | **bool**| | [optional]
|
|
160
|
+
**supports_raw_data** | **bool**| | [optional]
|
|
152
161
|
**nqubits** | **int**| | [optional]
|
|
153
162
|
**status** | [**BackendStatus**](.md)| | [optional]
|
|
154
163
|
**default_number_of_shots** | **int**| | [optional]
|
|
@@ -90,6 +90,7 @@ void (empty response body)
|
|
|
90
90
|
|-------------|-------------|------------------|
|
|
91
91
|
**204** | Compiled | - |
|
|
92
92
|
**404** | Not Found | - |
|
|
93
|
+
**400** | Bad Request | - |
|
|
93
94
|
**422** | Validation Error | - |
|
|
94
95
|
|
|
95
96
|
[[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)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# HTTPBadRequestError
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**detail** | **str** | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
from compute_api_client.models.http_bad_request_error import HTTPBadRequestError
|
|
13
|
+
|
|
14
|
+
# TODO update the JSON string below
|
|
15
|
+
json = "{}"
|
|
16
|
+
# create an instance of HTTPBadRequestError from a JSON string
|
|
17
|
+
http_bad_request_error_instance = HTTPBadRequestError.from_json(json)
|
|
18
|
+
# print the JSON string representation of the object
|
|
19
|
+
print HTTPBadRequestError.to_json()
|
|
20
|
+
|
|
21
|
+
# convert the object into a dict
|
|
22
|
+
http_bad_request_error_dict = http_bad_request_error_instance.to_dict()
|
|
23
|
+
# create an instance of HTTPBadRequestError from a dict
|
|
24
|
+
http_bad_request_error_form_dict = http_bad_request_error.from_dict(http_bad_request_error_dict)
|
|
25
|
+
```
|
|
26
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
27
|
+
|
|
28
|
+
|
compute_api_client/docs/Job.md
CHANGED
compute_api_client/docs/JobIn.md
CHANGED
|
@@ -244,7 +244,7 @@ Name | Type | Description | Notes
|
|
|
244
244
|
[[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)
|
|
245
245
|
|
|
246
246
|
# **read_jobs_jobs_get**
|
|
247
|
-
> PageJob read_jobs_jobs_get(id=id, created_on=created_on, file_id=file_id, algorithm_type=algorithm_type, status=status, batch_job_id=batch_job_id, queued_at__isnull=queued_at__isnull, queued_at=queued_at, finished_at__isnull=finished_at__isnull, finished_at=finished_at, number_of_shots__isnull=number_of_shots__isnull, number_of_shots=number_of_shots, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
247
|
+
> PageJob read_jobs_jobs_get(id=id, created_on=created_on, file_id=file_id, algorithm_type=algorithm_type, status=status, batch_job_id=batch_job_id, queued_at__isnull=queued_at__isnull, queued_at=queued_at, finished_at__isnull=finished_at__isnull, finished_at=finished_at, number_of_shots__isnull=number_of_shots__isnull, number_of_shots=number_of_shots, raw_data_enabled=raw_data_enabled, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
248
248
|
|
|
249
249
|
List jobs
|
|
250
250
|
|
|
@@ -299,6 +299,7 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
299
299
|
finished_at = '2013-10-20T19:20:30+01:00' # datetime | (optional)
|
|
300
300
|
number_of_shots__isnull = True # bool | (optional)
|
|
301
301
|
number_of_shots = 56 # int | (optional)
|
|
302
|
+
raw_data_enabled = True # bool | (optional)
|
|
302
303
|
sort_by = 'sort_by_example' # str | The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'. (optional)
|
|
303
304
|
latest = True # bool | If True gets the most recently created object. (optional)
|
|
304
305
|
page = 1 # int | Page number (optional) (default to 1)
|
|
@@ -306,7 +307,7 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
306
307
|
|
|
307
308
|
try:
|
|
308
309
|
# List jobs
|
|
309
|
-
api_response = await api_instance.read_jobs_jobs_get(id=id, created_on=created_on, file_id=file_id, algorithm_type=algorithm_type, status=status, batch_job_id=batch_job_id, queued_at__isnull=queued_at__isnull, queued_at=queued_at, finished_at__isnull=finished_at__isnull, finished_at=finished_at, number_of_shots__isnull=number_of_shots__isnull, number_of_shots=number_of_shots, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
310
|
+
api_response = await api_instance.read_jobs_jobs_get(id=id, created_on=created_on, file_id=file_id, algorithm_type=algorithm_type, status=status, batch_job_id=batch_job_id, queued_at__isnull=queued_at__isnull, queued_at=queued_at, finished_at__isnull=finished_at__isnull, finished_at=finished_at, number_of_shots__isnull=number_of_shots__isnull, number_of_shots=number_of_shots, raw_data_enabled=raw_data_enabled, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
310
311
|
print("The response of JobsApi->read_jobs_jobs_get:\n")
|
|
311
312
|
pprint(api_response)
|
|
312
313
|
except Exception as e:
|
|
@@ -331,6 +332,7 @@ Name | Type | Description | Notes
|
|
|
331
332
|
**finished_at** | **datetime**| | [optional]
|
|
332
333
|
**number_of_shots__isnull** | **bool**| | [optional]
|
|
333
334
|
**number_of_shots** | **int**| | [optional]
|
|
335
|
+
**raw_data_enabled** | **bool**| | [optional]
|
|
334
336
|
**sort_by** | **str**| The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'. | [optional]
|
|
335
337
|
**latest** | **bool**| If True gets the most recently created object. | [optional]
|
|
336
338
|
**page** | **int**| Page number | [optional] [default to 1]
|
|
@@ -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, metadata_id=metadata_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, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
248
|
+
> PageResult read_results_by_algorithm_id_results_algorithm_algorithm_id_get(algorithm_id, id=id, created_on=created_on, job_id=job_id, metadata_id=metadata_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
|
|
|
@@ -290,6 +290,7 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
290
290
|
shots_done__isnull = True # bool | (optional)
|
|
291
291
|
shots_done = 56 # int | (optional)
|
|
292
292
|
results__isnull = True # bool | (optional)
|
|
293
|
+
raw_data__isnull = True # bool | (optional)
|
|
293
294
|
sort_by = 'sort_by_example' # str | The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'. (optional)
|
|
294
295
|
latest = True # bool | If True gets the most recently created object. (optional)
|
|
295
296
|
page = 1 # int | Page number (optional) (default to 1)
|
|
@@ -297,7 +298,7 @@ async with compute_api_client.ApiClient(configuration) as api_client:
|
|
|
297
298
|
|
|
298
299
|
try:
|
|
299
300
|
# Retrieve results by algorithm 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, metadata_id=metadata_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, sort_by=sort_by, latest=latest, page=page, size=size)
|
|
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, metadata_id=metadata_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)
|
|
301
302
|
print("The response of ResultsApi->read_results_by_algorithm_id_results_algorithm_algorithm_id_get:\n")
|
|
302
303
|
pprint(api_response)
|
|
303
304
|
except Exception as e:
|
|
@@ -321,6 +322,7 @@ Name | Type | Description | Notes
|
|
|
321
322
|
**shots_done__isnull** | **bool**| | [optional]
|
|
322
323
|
**shots_done** | **int**| | [optional]
|
|
323
324
|
**results__isnull** | **bool**| | [optional]
|
|
325
|
+
**raw_data__isnull** | **bool**| | [optional]
|
|
324
326
|
**sort_by** | **str**| The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'. | [optional]
|
|
325
327
|
**latest** | **bool**| If True gets the most recently created object. | [optional]
|
|
326
328
|
**page** | **int**| Page number | [optional] [default to 1]
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
from compute_api_client.models.algorithm import Algorithm
|
|
18
18
|
from compute_api_client.models.algorithm_in import AlgorithmIn
|
|
19
19
|
from compute_api_client.models.algorithm_type import AlgorithmType
|
|
20
|
+
from compute_api_client.models.auth_config import AuthConfig
|
|
20
21
|
from compute_api_client.models.backend import Backend
|
|
21
22
|
from compute_api_client.models.backend_in import BackendIn
|
|
22
23
|
from compute_api_client.models.backend_patch import BackendPatch
|
|
@@ -35,6 +36,7 @@ from compute_api_client.models.file import File
|
|
|
35
36
|
from compute_api_client.models.file_in import FileIn
|
|
36
37
|
from compute_api_client.models.final_result import FinalResult
|
|
37
38
|
from compute_api_client.models.final_result_in import FinalResultIn
|
|
39
|
+
from compute_api_client.models.http_bad_request_error import HTTPBadRequestError
|
|
38
40
|
from compute_api_client.models.http_not_found_error import HTTPNotFoundError
|
|
39
41
|
from compute_api_client.models.http_validation_error import HTTPValidationError
|
|
40
42
|
from compute_api_client.models.job import Job
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
|
22
|
+
from pydantic import BaseModel, StrictStr
|
|
23
|
+
try:
|
|
24
|
+
from typing import Self
|
|
25
|
+
except ImportError:
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class AuthConfig(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
AuthConfig
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
client_id: StrictStr
|
|
33
|
+
audience: StrictStr
|
|
34
|
+
well_known_endpoint: StrictStr
|
|
35
|
+
__properties: ClassVar[List[str]] = ["client_id", "audience", "well_known_endpoint"]
|
|
36
|
+
|
|
37
|
+
model_config = {
|
|
38
|
+
"populate_by_name": True,
|
|
39
|
+
"validate_assignment": True
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Self:
|
|
54
|
+
"""Create an instance of AuthConfig from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude={
|
|
70
|
+
},
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
77
|
+
"""Create an instance of AuthConfig from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"client_id": obj.get("client_id"),
|
|
86
|
+
"audience": obj.get("audience"),
|
|
87
|
+
"well_known_endpoint": obj.get("well_known_endpoint")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -38,6 +38,7 @@ class BackendType(BaseModel):
|
|
|
38
38
|
description: StrictStr
|
|
39
39
|
image_id: Annotated[str, Field(strict=True, max_length=16)]
|
|
40
40
|
is_hardware: StrictBool
|
|
41
|
+
supports_raw_data: StrictBool
|
|
41
42
|
features: List[StrictStr]
|
|
42
43
|
default_compiler_config: Union[str, Any]
|
|
43
44
|
gateset: List[StrictStr]
|
|
@@ -46,7 +47,7 @@ class BackendType(BaseModel):
|
|
|
46
47
|
status: BackendStatus
|
|
47
48
|
default_number_of_shots: StrictInt
|
|
48
49
|
max_number_of_shots: StrictInt
|
|
49
|
-
__properties: ClassVar[List[str]] = ["id", "name", "infrastructure", "description", "image_id", "is_hardware", "features", "default_compiler_config", "gateset", "topology", "nqubits", "status", "default_number_of_shots", "max_number_of_shots"]
|
|
50
|
+
__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"]
|
|
50
51
|
|
|
51
52
|
model_config = {
|
|
52
53
|
"populate_by_name": True,
|
|
@@ -102,6 +103,7 @@ class BackendType(BaseModel):
|
|
|
102
103
|
"description": obj.get("description"),
|
|
103
104
|
"image_id": obj.get("image_id"),
|
|
104
105
|
"is_hardware": obj.get("is_hardware"),
|
|
106
|
+
"supports_raw_data": obj.get("supports_raw_data"),
|
|
105
107
|
"features": obj.get("features"),
|
|
106
108
|
"default_compiler_config": obj.get("default_compiler_config"),
|
|
107
109
|
"gateset": obj.get("gateset"),
|
|
@@ -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
|
+
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from pydantic import BaseModel, StrictStr
|
|
23
|
+
try:
|
|
24
|
+
from typing import Self
|
|
25
|
+
except ImportError:
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class HTTPBadRequestError(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
HTTPBadRequestError
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
detail: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["detail"]
|
|
34
|
+
|
|
35
|
+
model_config = {
|
|
36
|
+
"populate_by_name": True,
|
|
37
|
+
"validate_assignment": True
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Self:
|
|
52
|
+
"""Create an instance of HTTPBadRequestError from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
_dict = self.model_dump(
|
|
66
|
+
by_alias=True,
|
|
67
|
+
exclude={
|
|
68
|
+
},
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Dict) -> Self:
|
|
75
|
+
"""Create an instance of HTTPBadRequestError from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"detail": obj.get("detail")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
compute_api_client/models/job.py
CHANGED
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from pydantic import BaseModel, StrictInt
|
|
22
|
+
from pydantic import BaseModel, StrictBool, StrictInt
|
|
23
23
|
from compute_api_client.models.algorithm_type import AlgorithmType
|
|
24
24
|
from compute_api_client.models.job_status import JobStatus
|
|
25
25
|
try:
|
|
@@ -40,7 +40,8 @@ class Job(BaseModel):
|
|
|
40
40
|
queued_at: Optional[datetime]
|
|
41
41
|
finished_at: Optional[datetime]
|
|
42
42
|
number_of_shots: Optional[StrictInt]
|
|
43
|
-
|
|
43
|
+
raw_data_enabled: StrictBool
|
|
44
|
+
__properties: ClassVar[List[str]] = ["id", "created_on", "file_id", "algorithm_type", "status", "batch_job_id", "queued_at", "finished_at", "number_of_shots", "raw_data_enabled"]
|
|
44
45
|
|
|
45
46
|
model_config = {
|
|
46
47
|
"populate_by_name": True,
|
|
@@ -113,7 +114,8 @@ class Job(BaseModel):
|
|
|
113
114
|
"batch_job_id": obj.get("batch_job_id"),
|
|
114
115
|
"queued_at": obj.get("queued_at"),
|
|
115
116
|
"finished_at": obj.get("finished_at"),
|
|
116
|
-
"number_of_shots": obj.get("number_of_shots")
|
|
117
|
+
"number_of_shots": obj.get("number_of_shots"),
|
|
118
|
+
"raw_data_enabled": obj.get("raw_data_enabled")
|
|
117
119
|
})
|
|
118
120
|
return _obj
|
|
119
121
|
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from pydantic import BaseModel, StrictInt
|
|
22
|
+
from pydantic import BaseModel, StrictBool, StrictInt
|
|
23
23
|
try:
|
|
24
24
|
from typing import Self
|
|
25
25
|
except ImportError:
|
|
@@ -32,7 +32,8 @@ class JobIn(BaseModel):
|
|
|
32
32
|
file_id: StrictInt
|
|
33
33
|
batch_job_id: StrictInt
|
|
34
34
|
number_of_shots: Optional[StrictInt] = None
|
|
35
|
-
|
|
35
|
+
raw_data_enabled: Optional[StrictBool] = False
|
|
36
|
+
__properties: ClassVar[List[str]] = ["file_id", "batch_job_id", "number_of_shots", "raw_data_enabled"]
|
|
36
37
|
|
|
37
38
|
model_config = {
|
|
38
39
|
"populate_by_name": True,
|
|
@@ -89,7 +90,8 @@ class JobIn(BaseModel):
|
|
|
89
90
|
_obj = cls.model_validate({
|
|
90
91
|
"file_id": obj.get("file_id"),
|
|
91
92
|
"batch_job_id": obj.get("batch_job_id"),
|
|
92
|
-
"number_of_shots": obj.get("number_of_shots")
|
|
93
|
+
"number_of_shots": obj.get("number_of_shots"),
|
|
94
|
+
"raw_data_enabled": obj.get("raw_data_enabled") if obj.get("raw_data_enabled") is not None else False
|
|
93
95
|
})
|
|
94
96
|
return _obj
|
|
95
97
|
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
-
from pydantic import BaseModel, StrictFloat, StrictInt
|
|
22
|
+
from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr
|
|
23
23
|
try:
|
|
24
24
|
from typing import Self
|
|
25
25
|
except ImportError:
|
|
@@ -37,7 +37,8 @@ class Result(BaseModel):
|
|
|
37
37
|
shots_requested: Optional[StrictInt]
|
|
38
38
|
shots_done: Optional[StrictInt]
|
|
39
39
|
results: Optional[Union[str, Any]]
|
|
40
|
-
|
|
40
|
+
raw_data: Optional[List[StrictStr]]
|
|
41
|
+
__properties: ClassVar[List[str]] = ["id", "created_on", "job_id", "metadata_id", "execution_time_in_seconds", "shots_requested", "shots_done", "results", "raw_data"]
|
|
41
42
|
|
|
42
43
|
model_config = {
|
|
43
44
|
"populate_by_name": True,
|
|
@@ -90,6 +91,11 @@ class Result(BaseModel):
|
|
|
90
91
|
if self.results is None and "results" in self.model_fields_set:
|
|
91
92
|
_dict['results'] = None
|
|
92
93
|
|
|
94
|
+
# set to None if raw_data (nullable) is None
|
|
95
|
+
# and model_fields_set contains the field
|
|
96
|
+
if self.raw_data is None and "raw_data" in self.model_fields_set:
|
|
97
|
+
_dict['raw_data'] = None
|
|
98
|
+
|
|
93
99
|
return _dict
|
|
94
100
|
|
|
95
101
|
@classmethod
|
|
@@ -109,7 +115,8 @@ class Result(BaseModel):
|
|
|
109
115
|
"execution_time_in_seconds": obj.get("execution_time_in_seconds"),
|
|
110
116
|
"shots_requested": obj.get("shots_requested"),
|
|
111
117
|
"shots_done": obj.get("shots_done"),
|
|
112
|
-
"results": obj.get("results")
|
|
118
|
+
"results": obj.get("results"),
|
|
119
|
+
"raw_data": obj.get("raw_data")
|
|
113
120
|
})
|
|
114
121
|
return _obj
|
|
115
122
|
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
-
from pydantic import BaseModel, StrictFloat, StrictInt
|
|
22
|
+
from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr
|
|
23
23
|
try:
|
|
24
24
|
from typing import Self
|
|
25
25
|
except ImportError:
|
|
@@ -35,7 +35,8 @@ class ResultIn(BaseModel):
|
|
|
35
35
|
shots_requested: Optional[StrictInt] = None
|
|
36
36
|
shots_done: Optional[StrictInt] = None
|
|
37
37
|
results: Optional[Union[str, Any]] = None
|
|
38
|
-
|
|
38
|
+
raw_data: Optional[List[StrictStr]] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["job_id", "metadata_id", "execution_time_in_seconds", "shots_requested", "shots_done", "results", "raw_data"]
|
|
39
40
|
|
|
40
41
|
model_config = {
|
|
41
42
|
"populate_by_name": True,
|
|
@@ -93,6 +94,11 @@ class ResultIn(BaseModel):
|
|
|
93
94
|
if self.results is None and "results" in self.model_fields_set:
|
|
94
95
|
_dict['results'] = None
|
|
95
96
|
|
|
97
|
+
# set to None if raw_data (nullable) is None
|
|
98
|
+
# and model_fields_set contains the field
|
|
99
|
+
if self.raw_data is None and "raw_data" in self.model_fields_set:
|
|
100
|
+
_dict['raw_data'] = None
|
|
101
|
+
|
|
96
102
|
return _dict
|
|
97
103
|
|
|
98
104
|
@classmethod
|
|
@@ -110,7 +116,8 @@ class ResultIn(BaseModel):
|
|
|
110
116
|
"execution_time_in_seconds": obj.get("execution_time_in_seconds"),
|
|
111
117
|
"shots_requested": obj.get("shots_requested"),
|
|
112
118
|
"shots_done": obj.get("shots_done"),
|
|
113
|
-
"results": obj.get("results")
|
|
119
|
+
"results": obj.get("results"),
|
|
120
|
+
"raw_data": obj.get("raw_data")
|
|
114
121
|
})
|
|
115
122
|
return _obj
|
|
116
123
|
|