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,21 @@
1
+ """API response object."""
2
+
3
+ from __future__ import annotations
4
+ from typing import Optional, Generic, Mapping, TypeVar
5
+ from pydantic import Field, StrictInt, StrictBytes, BaseModel
6
+
7
+ T = TypeVar("T")
8
+
9
+ class ApiResponse(BaseModel, Generic[T]):
10
+ """
11
+ API response object
12
+ """
13
+
14
+ status_code: StrictInt = Field(description="HTTP status code")
15
+ headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
16
+ data: T = Field(description="Deserialized data given the data type")
17
+ raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
18
+
19
+ model_config = {
20
+ "arbitrary_types_allowed": True
21
+ }
@@ -0,0 +1,606 @@
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
+ import copy
16
+ import http.client as httplib
17
+ import logging
18
+ from logging import FileHandler
19
+ import sys
20
+ from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
21
+ from typing_extensions import NotRequired, Self
22
+
23
+ import urllib3
24
+
25
+
26
+ JSON_SCHEMA_VALIDATION_KEYWORDS = {
27
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
28
+ 'minimum', 'exclusiveMinimum', 'maxLength',
29
+ 'minLength', 'pattern', 'maxItems', 'minItems'
30
+ }
31
+
32
+ ServerVariablesT = Dict[str, str]
33
+
34
+ GenericAuthSetting = TypedDict(
35
+ "GenericAuthSetting",
36
+ {
37
+ "type": str,
38
+ "in": str,
39
+ "key": str,
40
+ "value": str,
41
+ },
42
+ )
43
+
44
+
45
+ OAuth2AuthSetting = TypedDict(
46
+ "OAuth2AuthSetting",
47
+ {
48
+ "type": Literal["oauth2"],
49
+ "in": Literal["header"],
50
+ "key": Literal["Authorization"],
51
+ "value": str,
52
+ },
53
+ )
54
+
55
+
56
+ APIKeyAuthSetting = TypedDict(
57
+ "APIKeyAuthSetting",
58
+ {
59
+ "type": Literal["api_key"],
60
+ "in": str,
61
+ "key": str,
62
+ "value": Optional[str],
63
+ },
64
+ )
65
+
66
+
67
+ BasicAuthSetting = TypedDict(
68
+ "BasicAuthSetting",
69
+ {
70
+ "type": Literal["basic"],
71
+ "in": Literal["header"],
72
+ "key": Literal["Authorization"],
73
+ "value": Optional[str],
74
+ },
75
+ )
76
+
77
+
78
+ BearerFormatAuthSetting = TypedDict(
79
+ "BearerFormatAuthSetting",
80
+ {
81
+ "type": Literal["bearer"],
82
+ "in": Literal["header"],
83
+ "format": Literal["JWT"],
84
+ "key": Literal["Authorization"],
85
+ "value": str,
86
+ },
87
+ )
88
+
89
+
90
+ BearerAuthSetting = TypedDict(
91
+ "BearerAuthSetting",
92
+ {
93
+ "type": Literal["bearer"],
94
+ "in": Literal["header"],
95
+ "key": Literal["Authorization"],
96
+ "value": str,
97
+ },
98
+ )
99
+
100
+
101
+ HTTPSignatureAuthSetting = TypedDict(
102
+ "HTTPSignatureAuthSetting",
103
+ {
104
+ "type": Literal["http-signature"],
105
+ "in": Literal["header"],
106
+ "key": Literal["Authorization"],
107
+ "value": None,
108
+ },
109
+ )
110
+
111
+
112
+ AuthSettings = TypedDict(
113
+ "AuthSettings",
114
+ {
115
+ "user_bearer": OAuth2AuthSetting,
116
+ "backend": APIKeyAuthSetting,
117
+ },
118
+ total=False,
119
+ )
120
+
121
+
122
+ class HostSettingVariable(TypedDict):
123
+ description: str
124
+ default_value: str
125
+ enum_values: List[str]
126
+
127
+
128
+ class HostSetting(TypedDict):
129
+ url: str
130
+ description: str
131
+ variables: NotRequired[Dict[str, HostSettingVariable]]
132
+
133
+
134
+ class Configuration:
135
+ """This class contains various settings of the API client.
136
+
137
+ :param host: Base url.
138
+ :param ignore_operation_servers
139
+ Boolean to ignore operation servers for the API client.
140
+ Config will use `host` as the base url regardless of the operation servers.
141
+ :param api_key: Dict to store API key(s).
142
+ Each entry in the dict specifies an API key.
143
+ The dict key is the name of the security scheme in the OAS specification.
144
+ The dict value is the API key secret.
145
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
146
+ The dict key is the name of the security scheme in the OAS specification.
147
+ The dict value is an API key prefix when generating the auth data.
148
+ :param username: Username for HTTP basic authentication.
149
+ :param password: Password for HTTP basic authentication.
150
+ :param access_token: Access token.
151
+ :param server_index: Index to servers configuration.
152
+ :param server_variables: Mapping with string values to replace variables in
153
+ templated server configuration. The validation of enums is performed for
154
+ variables with defined enum values before.
155
+ :param server_operation_index: Mapping from operation ID to an index to server
156
+ configuration.
157
+ :param server_operation_variables: Mapping from operation ID to a mapping with
158
+ string values to replace variables in templated server configuration.
159
+ The validation of enums is performed for variables with defined enum
160
+ values before.
161
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
162
+ in PEM format.
163
+ :param retries: Number of retries for API requests.
164
+ :param ca_cert_data: verify the peer using concatenated CA certificate data
165
+ in PEM (str) or DER (bytes) format.
166
+
167
+ :Example:
168
+
169
+ API Key Authentication Example.
170
+ Given the following security scheme in the OpenAPI specification:
171
+ components:
172
+ securitySchemes:
173
+ cookieAuth: # name for the security scheme
174
+ type: apiKey
175
+ in: cookie
176
+ name: JSESSIONID # cookie name
177
+
178
+ You can programmatically set the cookie:
179
+
180
+ conf = compute_api_client.Configuration(
181
+ api_key={'cookieAuth': 'abc123'}
182
+ api_key_prefix={'cookieAuth': 'JSESSIONID'}
183
+ )
184
+
185
+ The following cookie will be added to the HTTP request:
186
+ Cookie: JSESSIONID abc123
187
+ """
188
+
189
+ _default: ClassVar[Optional[Self]] = None
190
+
191
+ def __init__(
192
+ self,
193
+ host: Optional[str]=None,
194
+ api_key: Optional[Dict[str, str]]=None,
195
+ api_key_prefix: Optional[Dict[str, str]]=None,
196
+ username: Optional[str]=None,
197
+ password: Optional[str]=None,
198
+ access_token: Optional[str]=None,
199
+ server_index: Optional[int]=None,
200
+ server_variables: Optional[ServerVariablesT]=None,
201
+ server_operation_index: Optional[Dict[int, int]]=None,
202
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
203
+ ignore_operation_servers: bool=False,
204
+ ssl_ca_cert: Optional[str]=None,
205
+ retries: Optional[int] = None,
206
+ ca_cert_data: Optional[Union[str, bytes]] = None,
207
+ *,
208
+ debug: Optional[bool] = None,
209
+ ) -> None:
210
+ """Constructor
211
+ """
212
+ self._base_path = "http://localhost" if host is None else host
213
+ """Default Base url
214
+ """
215
+ self.server_index = 0 if server_index is None and host is None else server_index
216
+ self.server_operation_index = server_operation_index or {}
217
+ """Default server index
218
+ """
219
+ self.server_variables = server_variables or {}
220
+ self.server_operation_variables = server_operation_variables or {}
221
+ """Default server variables
222
+ """
223
+ self.ignore_operation_servers = ignore_operation_servers
224
+ """Ignore operation servers
225
+ """
226
+ self.temp_folder_path = None
227
+ """Temp file folder for downloading files
228
+ """
229
+ # Authentication Settings
230
+ self.api_key = {}
231
+ if api_key:
232
+ self.api_key = api_key
233
+ """dict to store API key(s)
234
+ """
235
+ self.api_key_prefix = {}
236
+ if api_key_prefix:
237
+ self.api_key_prefix = api_key_prefix
238
+ """dict to store API prefix (e.g. Bearer)
239
+ """
240
+ self.refresh_api_key_hook = None
241
+ """function hook to refresh API key if expired
242
+ """
243
+ self.username = username
244
+ """Username for HTTP basic authentication
245
+ """
246
+ self.password = password
247
+ """Password for HTTP basic authentication
248
+ """
249
+ self.access_token = access_token
250
+ """Access token
251
+ """
252
+ self.logger = {}
253
+ """Logging Settings
254
+ """
255
+ self.logger["package_logger"] = logging.getLogger("compute_api_client")
256
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
257
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
258
+ """Log format
259
+ """
260
+ self.logger_stream_handler = None
261
+ """Log stream handler
262
+ """
263
+ self.logger_file_handler: Optional[FileHandler] = None
264
+ """Log file handler
265
+ """
266
+ self.logger_file = None
267
+ """Debug file location
268
+ """
269
+ if debug is not None:
270
+ self.debug = debug
271
+ else:
272
+ self.__debug = False
273
+ """Debug switch
274
+ """
275
+
276
+ self.verify_ssl = True
277
+ """SSL/TLS verification
278
+ Set this to false to skip verifying SSL certificate when calling API
279
+ from https server.
280
+ """
281
+ self.ssl_ca_cert = ssl_ca_cert
282
+ """Set this to customize the certificate file to verify the peer.
283
+ """
284
+ self.ca_cert_data = ca_cert_data
285
+ """Set this to verify the peer using PEM (str) or DER (bytes)
286
+ certificate data.
287
+ """
288
+ self.cert_file = None
289
+ """client certificate file
290
+ """
291
+ self.key_file = None
292
+ """client key file
293
+ """
294
+ self.assert_hostname = None
295
+ """Set this to True/False to enable/disable SSL hostname verification.
296
+ """
297
+ self.tls_server_name = None
298
+ """SSL/TLS Server Name Indication (SNI)
299
+ Set this to the SNI value expected by the server.
300
+ """
301
+
302
+ self.connection_pool_maxsize = 100
303
+ """This value is passed to the aiohttp to limit simultaneous connections.
304
+ Default values is 100, None means no-limit.
305
+ """
306
+
307
+ self.proxy: Optional[str] = None
308
+ """Proxy URL
309
+ """
310
+ self.proxy_headers = None
311
+ """Proxy headers
312
+ """
313
+ self.safe_chars_for_path_param = ''
314
+ """Safe chars for path_param
315
+ """
316
+ self.retries = retries
317
+ """Adding retries to override urllib3 default value 3
318
+ """
319
+ # Enable client side validation
320
+ self.client_side_validation = True
321
+
322
+ self.socket_options = None
323
+ """Options to pass down to the underlying urllib3 socket
324
+ """
325
+
326
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
327
+ """datetime format
328
+ """
329
+
330
+ self.date_format = "%Y-%m-%d"
331
+ """date format
332
+ """
333
+
334
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
335
+ cls = self.__class__
336
+ result = cls.__new__(cls)
337
+ memo[id(self)] = result
338
+ for k, v in self.__dict__.items():
339
+ if k not in ('logger', 'logger_file_handler'):
340
+ setattr(result, k, copy.deepcopy(v, memo))
341
+ # shallow copy of loggers
342
+ result.logger = copy.copy(self.logger)
343
+ # use setters to configure loggers
344
+ result.logger_file = self.logger_file
345
+ result.debug = self.debug
346
+ return result
347
+
348
+ def __setattr__(self, name: str, value: Any) -> None:
349
+ object.__setattr__(self, name, value)
350
+
351
+ @classmethod
352
+ def set_default(cls, default: Optional[Self]) -> None:
353
+ """Set default instance of configuration.
354
+
355
+ It stores default configuration, which can be
356
+ returned by get_default_copy method.
357
+
358
+ :param default: object of Configuration
359
+ """
360
+ cls._default = default
361
+
362
+ @classmethod
363
+ def get_default_copy(cls) -> Self:
364
+ """Deprecated. Please use `get_default` instead.
365
+
366
+ Deprecated. Please use `get_default` instead.
367
+
368
+ :return: The configuration object.
369
+ """
370
+ return cls.get_default()
371
+
372
+ @classmethod
373
+ def get_default(cls) -> Self:
374
+ """Return the default configuration.
375
+
376
+ This method returns newly created, based on default constructor,
377
+ object of Configuration class or returns a copy of default
378
+ configuration.
379
+
380
+ :return: The configuration object.
381
+ """
382
+ if cls._default is None:
383
+ cls._default = cls()
384
+ return cls._default
385
+
386
+ @property
387
+ def logger_file(self) -> Optional[str]:
388
+ """The logger file.
389
+
390
+ If the logger_file is None, then add stream handler and remove file
391
+ handler. Otherwise, add file handler and remove stream handler.
392
+
393
+ :param value: The logger_file path.
394
+ :type: str
395
+ """
396
+ return self.__logger_file
397
+
398
+ @logger_file.setter
399
+ def logger_file(self, value: Optional[str]) -> None:
400
+ """The logger file.
401
+
402
+ If the logger_file is None, then add stream handler and remove file
403
+ handler. Otherwise, add file handler and remove stream handler.
404
+
405
+ :param value: The logger_file path.
406
+ :type: str
407
+ """
408
+ self.__logger_file = value
409
+ if self.__logger_file:
410
+ # If set logging file,
411
+ # then add file handler and remove stream handler.
412
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
413
+ self.logger_file_handler.setFormatter(self.logger_formatter)
414
+ for _, logger in self.logger.items():
415
+ logger.addHandler(self.logger_file_handler)
416
+
417
+ @property
418
+ def debug(self) -> bool:
419
+ """Debug status
420
+
421
+ :param value: The debug status, True or False.
422
+ :type: bool
423
+ """
424
+ return self.__debug
425
+
426
+ @debug.setter
427
+ def debug(self, value: bool) -> None:
428
+ """Debug status
429
+
430
+ :param value: The debug status, True or False.
431
+ :type: bool
432
+ """
433
+ self.__debug = value
434
+ if self.__debug:
435
+ # if debug status is True, turn on debug logging
436
+ for _, logger in self.logger.items():
437
+ logger.setLevel(logging.DEBUG)
438
+ # turn on httplib debug
439
+ httplib.HTTPConnection.debuglevel = 1
440
+ else:
441
+ # if debug status is False, turn off debug logging,
442
+ # setting log level to default `logging.WARNING`
443
+ for _, logger in self.logger.items():
444
+ logger.setLevel(logging.WARNING)
445
+ # turn off httplib debug
446
+ httplib.HTTPConnection.debuglevel = 0
447
+
448
+ @property
449
+ def logger_format(self) -> str:
450
+ """The logger format.
451
+
452
+ The logger_formatter will be updated when sets logger_format.
453
+
454
+ :param value: The format string.
455
+ :type: str
456
+ """
457
+ return self.__logger_format
458
+
459
+ @logger_format.setter
460
+ def logger_format(self, value: str) -> None:
461
+ """The logger format.
462
+
463
+ The logger_formatter will be updated when sets logger_format.
464
+
465
+ :param value: The format string.
466
+ :type: str
467
+ """
468
+ self.__logger_format = value
469
+ self.logger_formatter = logging.Formatter(self.__logger_format)
470
+
471
+ def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
472
+ """Gets API key (with prefix if set).
473
+
474
+ :param identifier: The identifier of apiKey.
475
+ :param alias: The alternative identifier of apiKey.
476
+ :return: The token for api key authentication.
477
+ """
478
+ if self.refresh_api_key_hook is not None:
479
+ self.refresh_api_key_hook(self)
480
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
481
+ if key:
482
+ prefix = self.api_key_prefix.get(identifier)
483
+ if prefix:
484
+ return "%s %s" % (prefix, key)
485
+ else:
486
+ return key
487
+
488
+ return None
489
+
490
+ def get_basic_auth_token(self) -> Optional[str]:
491
+ """Gets HTTP basic authentication header (string).
492
+
493
+ :return: The token for basic HTTP authentication.
494
+ """
495
+ username = ""
496
+ if self.username is not None:
497
+ username = self.username
498
+ password = ""
499
+ if self.password is not None:
500
+ password = self.password
501
+ return urllib3.util.make_headers(
502
+ basic_auth=username + ':' + password
503
+ ).get('authorization')
504
+
505
+ def auth_settings(self)-> AuthSettings:
506
+ """Gets Auth Settings dict for api client.
507
+
508
+ :return: The Auth Settings information dict.
509
+ """
510
+ auth: AuthSettings = {}
511
+ if self.access_token is not None:
512
+ auth['user_bearer'] = {
513
+ 'type': 'oauth2',
514
+ 'in': 'header',
515
+ 'key': 'Authorization',
516
+ 'value': 'Bearer ' + self.access_token
517
+ }
518
+ if 'backend' in self.api_key:
519
+ auth['backend'] = {
520
+ 'type': 'api_key',
521
+ 'in': 'header',
522
+ 'key': 'Authorization',
523
+ 'value': self.get_api_key_with_prefix(
524
+ 'backend',
525
+ ),
526
+ }
527
+ return auth
528
+
529
+ def to_debug_report(self) -> str:
530
+ """Gets the essential information for debugging.
531
+
532
+ :return: The report for debugging.
533
+ """
534
+ return "Python SDK Debug Report:\n"\
535
+ "OS: {env}\n"\
536
+ "Python Version: {pyversion}\n"\
537
+ "Version of the API: 0.1.0\n"\
538
+ "SDK Package Version: 1.0.0".\
539
+ format(env=sys.platform, pyversion=sys.version)
540
+
541
+ def get_host_settings(self) -> List[HostSetting]:
542
+ """Gets an array of host settings
543
+
544
+ :return: An array of host settings
545
+ """
546
+ return [
547
+ {
548
+ 'url': "",
549
+ 'description': "No description provided",
550
+ }
551
+ ]
552
+
553
+ def get_host_from_settings(
554
+ self,
555
+ index: Optional[int],
556
+ variables: Optional[ServerVariablesT]=None,
557
+ servers: Optional[List[HostSetting]]=None,
558
+ ) -> str:
559
+ """Gets host URL based on the index and variables
560
+ :param index: array index of the host settings
561
+ :param variables: hash of variable and the corresponding value
562
+ :param servers: an array of host settings or None
563
+ :return: URL based on host settings
564
+ """
565
+ if index is None:
566
+ return self._base_path
567
+
568
+ variables = {} if variables is None else variables
569
+ servers = self.get_host_settings() if servers is None else servers
570
+
571
+ try:
572
+ server = servers[index]
573
+ except IndexError:
574
+ raise ValueError(
575
+ "Invalid index {0} when selecting the host settings. "
576
+ "Must be less than {1}".format(index, len(servers)))
577
+
578
+ url = server['url']
579
+
580
+ # go through variables and replace placeholders
581
+ for variable_name, variable in server.get('variables', {}).items():
582
+ used_value = variables.get(
583
+ variable_name, variable['default_value'])
584
+
585
+ if 'enum_values' in variable \
586
+ and used_value not in variable['enum_values']:
587
+ raise ValueError(
588
+ "The variable `{0}` in the host URL has invalid value "
589
+ "{1}. Must be {2}.".format(
590
+ variable_name, variables[variable_name],
591
+ variable['enum_values']))
592
+
593
+ url = url.replace("{" + variable_name + "}", used_value)
594
+
595
+ return url
596
+
597
+ @property
598
+ def host(self) -> str:
599
+ """Return generated host."""
600
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
601
+
602
+ @host.setter
603
+ def host(self, value: str) -> None:
604
+ """Fix base path."""
605
+ self._base_path = value
606
+ self.server_index = None
@@ -0,0 +1,34 @@
1
+ # Algorithm
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **id** | **int** | ID of the algorithm |
9
+ **project_id** | **int** | ID of the project |
10
+ **type** | [**AlgorithmType**](AlgorithmType.md) | The type of algorithm i.e. hybrid or quantum |
11
+ **shared** | [**ShareType**](ShareType.md) | The sharing scope of the algorithm |
12
+ **link** | **str** | |
13
+ **name** | **str** | Name of the algorithm |
14
+
15
+ ## Example
16
+
17
+ ```python
18
+ from compute_api_client.models.algorithm import Algorithm
19
+
20
+ # TODO update the JSON string below
21
+ json = "{}"
22
+ # create an instance of Algorithm from a JSON string
23
+ algorithm_instance = Algorithm.from_json(json)
24
+ # print the JSON string representation of the object
25
+ print(Algorithm.to_json())
26
+
27
+ # convert the object into a dict
28
+ algorithm_dict = algorithm_instance.to_dict()
29
+ # create an instance of Algorithm from a dict
30
+ algorithm_from_dict = Algorithm.from_dict(algorithm_dict)
31
+ ```
32
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
33
+
34
+
@@ -0,0 +1,33 @@
1
+ # AlgorithmIn
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **project_id** | **int** | ID of the project |
9
+ **type** | [**AlgorithmType**](AlgorithmType.md) | The type of algorithm i.e. hybrid or quantum |
10
+ **shared** | [**ShareType**](ShareType.md) | The sharing scope of the algorithm |
11
+ **link** | **str** | | [optional]
12
+ **name** | **str** | The name of the algorithm |
13
+
14
+ ## Example
15
+
16
+ ```python
17
+ from compute_api_client.models.algorithm_in import AlgorithmIn
18
+
19
+ # TODO update the JSON string below
20
+ json = "{}"
21
+ # create an instance of AlgorithmIn from a JSON string
22
+ algorithm_in_instance = AlgorithmIn.from_json(json)
23
+ # print the JSON string representation of the object
24
+ print(AlgorithmIn.to_json())
25
+
26
+ # convert the object into a dict
27
+ algorithm_in_dict = algorithm_in_instance.to_dict()
28
+ # create an instance of AlgorithmIn from a dict
29
+ algorithm_in_from_dict = AlgorithmIn.from_dict(algorithm_in_dict)
30
+ ```
31
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
32
+
33
+
@@ -0,0 +1,12 @@
1
+ # AlgorithmType
2
+
3
+
4
+ ## Enum
5
+
6
+ * `HYBRID` (value: `'hybrid'`)
7
+
8
+ * `QUANTUM` (value: `'quantum'`)
9
+
10
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11
+
12
+