azure-quantum 1.1.1__py3-none-any.whl → 1.1.2.dev0__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.
- azure/quantum/_authentication/_chained.py +21 -23
- azure/quantum/_authentication/_default.py +97 -159
- azure/quantum/_authentication/_token.py +41 -38
- azure/quantum/_client/_client.py +35 -9
- azure/quantum/_client/_configuration.py +12 -12
- azure/quantum/_client/_serialization.py +46 -37
- azure/quantum/_client/_version.py +1 -1
- azure/quantum/_client/models/_models.py +8 -8
- azure/quantum/_client/operations/_operations.py +261 -167
- azure/quantum/_constants.py +91 -0
- azure/quantum/_workspace_connection_params.py +544 -0
- azure/quantum/version.py +1 -1
- azure/quantum/workspace.py +119 -147
- {azure_quantum-1.1.1.dist-info → azure_quantum-1.1.2.dev0.dist-info}/METADATA +1 -1
- {azure_quantum-1.1.1.dist-info → azure_quantum-1.1.2.dev0.dist-info}/RECORD +17 -15
- {azure_quantum-1.1.1.dist-info → azure_quantum-1.1.2.dev0.dist-info}/WHEEL +0 -0
- {azure_quantum-1.1.1.dist-info → azure_quantum-1.1.2.dev0.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# pylint: disable=too-many-lines
|
|
1
|
+
# pylint: disable=too-many-lines,too-many-statements
|
|
2
2
|
# coding=utf-8
|
|
3
3
|
# --------------------------------------------------------------------------
|
|
4
4
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
7
|
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
8
|
# --------------------------------------------------------------------------
|
|
9
|
-
import
|
|
9
|
+
from io import IOBase
|
|
10
10
|
from typing import Any, Callable, Dict, IO, Iterable, List, Optional, TypeVar, Union, overload
|
|
11
11
|
import urllib.parse
|
|
12
12
|
|
|
@@ -20,19 +20,13 @@ from azure.core.exceptions import (
|
|
|
20
20
|
)
|
|
21
21
|
from azure.core.paging import ItemPaged
|
|
22
22
|
from azure.core.pipeline import PipelineResponse
|
|
23
|
-
from azure.core.
|
|
24
|
-
from azure.core.rest import HttpRequest
|
|
23
|
+
from azure.core.rest import HttpRequest, HttpResponse
|
|
25
24
|
from azure.core.tracing.decorator import distributed_trace
|
|
26
25
|
from azure.core.utils import case_insensitive_dict
|
|
27
26
|
|
|
28
27
|
from .. import models as _models
|
|
29
28
|
from .._serialization import Serializer
|
|
30
|
-
from .._vendor import _format_url_section
|
|
31
29
|
|
|
32
|
-
if sys.version_info >= (3, 8):
|
|
33
|
-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
|
|
34
|
-
else:
|
|
35
|
-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
|
|
36
30
|
T = TypeVar("T")
|
|
37
31
|
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
|
38
32
|
|
|
@@ -46,9 +40,7 @@ def build_jobs_list_request(
|
|
|
46
40
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
47
41
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
48
42
|
|
|
49
|
-
api_version:
|
|
50
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
51
|
-
)
|
|
43
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
52
44
|
accept = _headers.pop("Accept", "application/json")
|
|
53
45
|
|
|
54
46
|
# Construct URL
|
|
@@ -59,7 +51,7 @@ def build_jobs_list_request(
|
|
|
59
51
|
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
60
52
|
}
|
|
61
53
|
|
|
62
|
-
_url: str =
|
|
54
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
63
55
|
|
|
64
56
|
# Construct parameters
|
|
65
57
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -76,9 +68,7 @@ def build_jobs_get_request(
|
|
|
76
68
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
77
69
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
78
70
|
|
|
79
|
-
api_version:
|
|
80
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
81
|
-
)
|
|
71
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
82
72
|
accept = _headers.pop("Accept", "application/json")
|
|
83
73
|
|
|
84
74
|
# Construct URL
|
|
@@ -96,7 +86,7 @@ def build_jobs_get_request(
|
|
|
96
86
|
),
|
|
97
87
|
}
|
|
98
88
|
|
|
99
|
-
_url: str =
|
|
89
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
100
90
|
|
|
101
91
|
# Construct parameters
|
|
102
92
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -114,9 +104,7 @@ def build_jobs_create_request(
|
|
|
114
104
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
115
105
|
|
|
116
106
|
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
|
117
|
-
api_version:
|
|
118
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
119
|
-
)
|
|
107
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
120
108
|
accept = _headers.pop("Accept", "application/json")
|
|
121
109
|
|
|
122
110
|
# Construct URL
|
|
@@ -134,7 +122,7 @@ def build_jobs_create_request(
|
|
|
134
122
|
),
|
|
135
123
|
}
|
|
136
124
|
|
|
137
|
-
_url: str =
|
|
125
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
138
126
|
|
|
139
127
|
# Construct parameters
|
|
140
128
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -153,9 +141,7 @@ def build_jobs_cancel_request(
|
|
|
153
141
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
154
142
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
155
143
|
|
|
156
|
-
api_version:
|
|
157
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
158
|
-
)
|
|
144
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
159
145
|
accept = _headers.pop("Accept", "application/json")
|
|
160
146
|
|
|
161
147
|
# Construct URL
|
|
@@ -173,7 +159,7 @@ def build_jobs_cancel_request(
|
|
|
173
159
|
),
|
|
174
160
|
}
|
|
175
161
|
|
|
176
|
-
_url: str =
|
|
162
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
177
163
|
|
|
178
164
|
# Construct parameters
|
|
179
165
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -191,9 +177,7 @@ def build_jobs_patch_request(
|
|
|
191
177
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
192
178
|
|
|
193
179
|
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
|
194
|
-
api_version:
|
|
195
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
196
|
-
)
|
|
180
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
197
181
|
accept = _headers.pop("Accept", "application/json")
|
|
198
182
|
|
|
199
183
|
# Construct URL
|
|
@@ -211,7 +195,7 @@ def build_jobs_patch_request(
|
|
|
211
195
|
),
|
|
212
196
|
}
|
|
213
197
|
|
|
214
|
-
_url: str =
|
|
198
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
215
199
|
|
|
216
200
|
# Construct parameters
|
|
217
201
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -230,9 +214,7 @@ def build_providers_get_status_request(
|
|
|
230
214
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
231
215
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
232
216
|
|
|
233
|
-
api_version:
|
|
234
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
235
|
-
)
|
|
217
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
236
218
|
accept = _headers.pop("Accept", "application/json")
|
|
237
219
|
|
|
238
220
|
# Construct URL
|
|
@@ -243,7 +225,7 @@ def build_providers_get_status_request(
|
|
|
243
225
|
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
244
226
|
}
|
|
245
227
|
|
|
246
|
-
_url: str =
|
|
228
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
247
229
|
|
|
248
230
|
# Construct parameters
|
|
249
231
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -261,9 +243,7 @@ def build_storage_sas_uri_request(
|
|
|
261
243
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
262
244
|
|
|
263
245
|
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
|
264
|
-
api_version:
|
|
265
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
266
|
-
)
|
|
246
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
267
247
|
accept = _headers.pop("Accept", "application/json")
|
|
268
248
|
|
|
269
249
|
# Construct URL
|
|
@@ -274,7 +254,7 @@ def build_storage_sas_uri_request(
|
|
|
274
254
|
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
275
255
|
}
|
|
276
256
|
|
|
277
|
-
_url: str =
|
|
257
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
278
258
|
|
|
279
259
|
# Construct parameters
|
|
280
260
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -293,9 +273,7 @@ def build_quotas_list_request(
|
|
|
293
273
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
294
274
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
295
275
|
|
|
296
|
-
api_version:
|
|
297
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
298
|
-
)
|
|
276
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
299
277
|
accept = _headers.pop("Accept", "application/json")
|
|
300
278
|
|
|
301
279
|
# Construct URL
|
|
@@ -306,7 +284,7 @@ def build_quotas_list_request(
|
|
|
306
284
|
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
307
285
|
}
|
|
308
286
|
|
|
309
|
-
_url: str =
|
|
287
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
310
288
|
|
|
311
289
|
# Construct parameters
|
|
312
290
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -323,9 +301,7 @@ def build_sessions_list_request(
|
|
|
323
301
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
324
302
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
325
303
|
|
|
326
|
-
api_version:
|
|
327
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
328
|
-
)
|
|
304
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
329
305
|
accept = _headers.pop("Accept", "application/json")
|
|
330
306
|
|
|
331
307
|
# Construct URL
|
|
@@ -336,7 +312,7 @@ def build_sessions_list_request(
|
|
|
336
312
|
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
337
313
|
}
|
|
338
314
|
|
|
339
|
-
_url: str =
|
|
315
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
340
316
|
|
|
341
317
|
# Construct parameters
|
|
342
318
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -353,9 +329,7 @@ def build_sessions_get_request(
|
|
|
353
329
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
354
330
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
355
331
|
|
|
356
|
-
api_version:
|
|
357
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
358
|
-
)
|
|
332
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
359
333
|
accept = _headers.pop("Accept", "application/json")
|
|
360
334
|
|
|
361
335
|
# Construct URL
|
|
@@ -373,7 +347,7 @@ def build_sessions_get_request(
|
|
|
373
347
|
),
|
|
374
348
|
}
|
|
375
349
|
|
|
376
|
-
_url: str =
|
|
350
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
377
351
|
|
|
378
352
|
# Construct parameters
|
|
379
353
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -391,9 +365,7 @@ def build_sessions_open_request(
|
|
|
391
365
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
392
366
|
|
|
393
367
|
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
|
394
|
-
api_version:
|
|
395
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
396
|
-
)
|
|
368
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
397
369
|
accept = _headers.pop("Accept", "application/json")
|
|
398
370
|
|
|
399
371
|
# Construct URL
|
|
@@ -411,7 +383,7 @@ def build_sessions_open_request(
|
|
|
411
383
|
),
|
|
412
384
|
}
|
|
413
385
|
|
|
414
|
-
_url: str =
|
|
386
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
415
387
|
|
|
416
388
|
# Construct parameters
|
|
417
389
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -430,9 +402,7 @@ def build_sessions_close_request(
|
|
|
430
402
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
431
403
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
432
404
|
|
|
433
|
-
api_version:
|
|
434
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
435
|
-
)
|
|
405
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
436
406
|
accept = _headers.pop("Accept", "application/json")
|
|
437
407
|
|
|
438
408
|
# Construct URL
|
|
@@ -450,7 +420,7 @@ def build_sessions_close_request(
|
|
|
450
420
|
),
|
|
451
421
|
}
|
|
452
422
|
|
|
453
|
-
_url: str =
|
|
423
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
454
424
|
|
|
455
425
|
# Construct parameters
|
|
456
426
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -467,9 +437,7 @@ def build_sessions_jobs_list_request(
|
|
|
467
437
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
468
438
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
469
439
|
|
|
470
|
-
api_version:
|
|
471
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
472
|
-
)
|
|
440
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
473
441
|
accept = _headers.pop("Accept", "application/json")
|
|
474
442
|
|
|
475
443
|
# Construct URL
|
|
@@ -487,7 +455,7 @@ def build_sessions_jobs_list_request(
|
|
|
487
455
|
),
|
|
488
456
|
}
|
|
489
457
|
|
|
490
|
-
_url: str =
|
|
458
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
491
459
|
|
|
492
460
|
# Construct parameters
|
|
493
461
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -504,9 +472,7 @@ def build_top_level_items_list_request(
|
|
|
504
472
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
505
473
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
506
474
|
|
|
507
|
-
api_version:
|
|
508
|
-
"api_version", _params.pop("api-version", "2022-09-12-preview")
|
|
509
|
-
)
|
|
475
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-13-preview"))
|
|
510
476
|
accept = _headers.pop("Accept", "application/json")
|
|
511
477
|
|
|
512
478
|
# Construct URL
|
|
@@ -517,7 +483,7 @@ def build_top_level_items_list_request(
|
|
|
517
483
|
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
518
484
|
}
|
|
519
485
|
|
|
520
|
-
_url: str =
|
|
486
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
521
487
|
|
|
522
488
|
# Construct parameters
|
|
523
489
|
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
@@ -571,7 +537,7 @@ class JobsOperations:
|
|
|
571
537
|
def prepare_request(next_link=None):
|
|
572
538
|
if not next_link:
|
|
573
539
|
|
|
574
|
-
|
|
540
|
+
_request = build_jobs_list_request(
|
|
575
541
|
subscription_id=self._config.subscription_id,
|
|
576
542
|
resource_group_name=self._config.resource_group_name,
|
|
577
543
|
workspace_name=self._config.workspace_name,
|
|
@@ -579,7 +545,12 @@ class JobsOperations:
|
|
|
579
545
|
headers=_headers,
|
|
580
546
|
params=_params,
|
|
581
547
|
)
|
|
582
|
-
|
|
548
|
+
path_format_arguments = {
|
|
549
|
+
"azureRegion": self._serialize.url(
|
|
550
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
551
|
+
),
|
|
552
|
+
}
|
|
553
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
583
554
|
|
|
584
555
|
else:
|
|
585
556
|
# make call to next link with the client's api-version
|
|
@@ -591,12 +562,17 @@ class JobsOperations:
|
|
|
591
562
|
}
|
|
592
563
|
)
|
|
593
564
|
_next_request_params["api-version"] = self._config.api_version
|
|
594
|
-
|
|
565
|
+
_request = HttpRequest(
|
|
595
566
|
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
596
567
|
)
|
|
597
|
-
|
|
568
|
+
path_format_arguments = {
|
|
569
|
+
"azureRegion": self._serialize.url(
|
|
570
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
571
|
+
),
|
|
572
|
+
}
|
|
573
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
598
574
|
|
|
599
|
-
return
|
|
575
|
+
return _request
|
|
600
576
|
|
|
601
577
|
def extract_data(pipeline_response):
|
|
602
578
|
deserialized = self._deserialize(
|
|
@@ -608,15 +584,17 @@ class JobsOperations:
|
|
|
608
584
|
return deserialized.next_link or None, iter(list_of_elem)
|
|
609
585
|
|
|
610
586
|
def get_next(next_link=None):
|
|
611
|
-
|
|
587
|
+
_request = prepare_request(next_link)
|
|
612
588
|
|
|
613
589
|
_stream = False
|
|
614
590
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
615
|
-
|
|
591
|
+
_request, stream=_stream, **kwargs
|
|
616
592
|
)
|
|
617
593
|
response = pipeline_response.http_response
|
|
618
594
|
|
|
619
595
|
if response.status_code not in [200]:
|
|
596
|
+
if _stream:
|
|
597
|
+
response.read() # Load the body in memory and close the socket
|
|
620
598
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
621
599
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
622
600
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -648,7 +626,7 @@ class JobsOperations:
|
|
|
648
626
|
|
|
649
627
|
cls: ClsType[_models.JobDetails] = kwargs.pop("cls", None)
|
|
650
628
|
|
|
651
|
-
|
|
629
|
+
_request = build_jobs_get_request(
|
|
652
630
|
job_id=job_id,
|
|
653
631
|
subscription_id=self._config.subscription_id,
|
|
654
632
|
resource_group_name=self._config.resource_group_name,
|
|
@@ -657,16 +635,23 @@ class JobsOperations:
|
|
|
657
635
|
headers=_headers,
|
|
658
636
|
params=_params,
|
|
659
637
|
)
|
|
660
|
-
|
|
638
|
+
path_format_arguments = {
|
|
639
|
+
"azureRegion": self._serialize.url(
|
|
640
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
641
|
+
),
|
|
642
|
+
}
|
|
643
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
661
644
|
|
|
662
645
|
_stream = False
|
|
663
646
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
664
|
-
|
|
647
|
+
_request, stream=_stream, **kwargs
|
|
665
648
|
)
|
|
666
649
|
|
|
667
650
|
response = pipeline_response.http_response
|
|
668
651
|
|
|
669
652
|
if response.status_code not in [200]:
|
|
653
|
+
if _stream:
|
|
654
|
+
response.read() # Load the body in memory and close the socket
|
|
670
655
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
671
656
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
672
657
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -674,9 +659,9 @@ class JobsOperations:
|
|
|
674
659
|
deserialized = self._deserialize("JobDetails", pipeline_response)
|
|
675
660
|
|
|
676
661
|
if cls:
|
|
677
|
-
return cls(pipeline_response, deserialized, {})
|
|
662
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
|
678
663
|
|
|
679
|
-
return deserialized
|
|
664
|
+
return deserialized # type: ignore
|
|
680
665
|
|
|
681
666
|
@overload
|
|
682
667
|
def create(
|
|
@@ -698,14 +683,14 @@ class JobsOperations:
|
|
|
698
683
|
|
|
699
684
|
@overload
|
|
700
685
|
def create(
|
|
701
|
-
self, job_id: str, job: IO, *, content_type: str = "application/json", **kwargs: Any
|
|
686
|
+
self, job_id: str, job: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
|
|
702
687
|
) -> _models.JobDetails:
|
|
703
688
|
"""Create a job.
|
|
704
689
|
|
|
705
690
|
:param job_id: Id of the job. Required.
|
|
706
691
|
:type job_id: str
|
|
707
692
|
:param job: The complete metadata of the job to submit. Required.
|
|
708
|
-
:type job: IO
|
|
693
|
+
:type job: IO[bytes]
|
|
709
694
|
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
|
710
695
|
Default value is "application/json".
|
|
711
696
|
:paramtype content_type: str
|
|
@@ -715,14 +700,14 @@ class JobsOperations:
|
|
|
715
700
|
"""
|
|
716
701
|
|
|
717
702
|
@distributed_trace
|
|
718
|
-
def create(self, job_id: str, job: Union[_models.JobDetails, IO], **kwargs: Any) -> _models.JobDetails:
|
|
703
|
+
def create(self, job_id: str, job: Union[_models.JobDetails, IO[bytes]], **kwargs: Any) -> _models.JobDetails:
|
|
719
704
|
"""Create a job.
|
|
720
705
|
|
|
721
706
|
:param job_id: Id of the job. Required.
|
|
722
707
|
:type job_id: str
|
|
723
|
-
:param job: The complete metadata of the job to submit. Is either a JobDetails type or a
|
|
724
|
-
type. Required.
|
|
725
|
-
:type job: ~azure.quantum._client.models.JobDetails or IO
|
|
708
|
+
:param job: The complete metadata of the job to submit. Is either a JobDetails type or a
|
|
709
|
+
IO[bytes] type. Required.
|
|
710
|
+
:type job: ~azure.quantum._client.models.JobDetails or IO[bytes]
|
|
726
711
|
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
|
727
712
|
Default value is None.
|
|
728
713
|
:paramtype content_type: str
|
|
@@ -747,12 +732,12 @@ class JobsOperations:
|
|
|
747
732
|
content_type = content_type or "application/json"
|
|
748
733
|
_json = None
|
|
749
734
|
_content = None
|
|
750
|
-
if isinstance(job, (
|
|
735
|
+
if isinstance(job, (IOBase, bytes)):
|
|
751
736
|
_content = job
|
|
752
737
|
else:
|
|
753
738
|
_json = self._serialize.body(job, "JobDetails")
|
|
754
739
|
|
|
755
|
-
|
|
740
|
+
_request = build_jobs_create_request(
|
|
756
741
|
job_id=job_id,
|
|
757
742
|
subscription_id=self._config.subscription_id,
|
|
758
743
|
resource_group_name=self._config.resource_group_name,
|
|
@@ -764,16 +749,23 @@ class JobsOperations:
|
|
|
764
749
|
headers=_headers,
|
|
765
750
|
params=_params,
|
|
766
751
|
)
|
|
767
|
-
|
|
752
|
+
path_format_arguments = {
|
|
753
|
+
"azureRegion": self._serialize.url(
|
|
754
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
755
|
+
),
|
|
756
|
+
}
|
|
757
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
768
758
|
|
|
769
759
|
_stream = False
|
|
770
760
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
771
|
-
|
|
761
|
+
_request, stream=_stream, **kwargs
|
|
772
762
|
)
|
|
773
763
|
|
|
774
764
|
response = pipeline_response.http_response
|
|
775
765
|
|
|
776
766
|
if response.status_code not in [200, 201]:
|
|
767
|
+
if _stream:
|
|
768
|
+
response.read() # Load the body in memory and close the socket
|
|
777
769
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
778
770
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
779
771
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -812,7 +804,7 @@ class JobsOperations:
|
|
|
812
804
|
|
|
813
805
|
cls: ClsType[None] = kwargs.pop("cls", None)
|
|
814
806
|
|
|
815
|
-
|
|
807
|
+
_request = build_jobs_cancel_request(
|
|
816
808
|
job_id=job_id,
|
|
817
809
|
subscription_id=self._config.subscription_id,
|
|
818
810
|
resource_group_name=self._config.resource_group_name,
|
|
@@ -821,22 +813,29 @@ class JobsOperations:
|
|
|
821
813
|
headers=_headers,
|
|
822
814
|
params=_params,
|
|
823
815
|
)
|
|
824
|
-
|
|
816
|
+
path_format_arguments = {
|
|
817
|
+
"azureRegion": self._serialize.url(
|
|
818
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
819
|
+
),
|
|
820
|
+
}
|
|
821
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
825
822
|
|
|
826
823
|
_stream = False
|
|
827
824
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
828
|
-
|
|
825
|
+
_request, stream=_stream, **kwargs
|
|
829
826
|
)
|
|
830
827
|
|
|
831
828
|
response = pipeline_response.http_response
|
|
832
829
|
|
|
833
830
|
if response.status_code not in [204]:
|
|
831
|
+
if _stream:
|
|
832
|
+
response.read() # Load the body in memory and close the socket
|
|
834
833
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
835
834
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
836
835
|
raise HttpResponseError(response=response, model=error)
|
|
837
836
|
|
|
838
837
|
if cls:
|
|
839
|
-
return cls(pipeline_response, None, {})
|
|
838
|
+
return cls(pipeline_response, None, {}) # type: ignore
|
|
840
839
|
|
|
841
840
|
@overload
|
|
842
841
|
def patch(
|
|
@@ -863,14 +862,14 @@ class JobsOperations:
|
|
|
863
862
|
|
|
864
863
|
@overload
|
|
865
864
|
def patch(
|
|
866
|
-
self, job_id: str, patch_job: IO, *, content_type: str = "application/json", **kwargs: Any
|
|
865
|
+
self, job_id: str, patch_job: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
|
|
867
866
|
) -> Optional[_models.JobDetails]:
|
|
868
867
|
"""Patch a job.
|
|
869
868
|
|
|
870
869
|
:param job_id: Id of the job. Required.
|
|
871
870
|
:type job_id: str
|
|
872
871
|
:param patch_job: The json patch document containing the patch operations. Required.
|
|
873
|
-
:type patch_job: IO
|
|
872
|
+
:type patch_job: IO[bytes]
|
|
874
873
|
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
|
875
874
|
Default value is "application/json".
|
|
876
875
|
:paramtype content_type: str
|
|
@@ -881,15 +880,15 @@ class JobsOperations:
|
|
|
881
880
|
|
|
882
881
|
@distributed_trace
|
|
883
882
|
def patch(
|
|
884
|
-
self, job_id: str, patch_job: Union[List[_models.JsonPatchDocument], IO], **kwargs: Any
|
|
883
|
+
self, job_id: str, patch_job: Union[List[_models.JsonPatchDocument], IO[bytes]], **kwargs: Any
|
|
885
884
|
) -> Optional[_models.JobDetails]:
|
|
886
885
|
"""Patch a job.
|
|
887
886
|
|
|
888
887
|
:param job_id: Id of the job. Required.
|
|
889
888
|
:type job_id: str
|
|
890
889
|
:param patch_job: The json patch document containing the patch operations. Is either a
|
|
891
|
-
[JsonPatchDocument] type or a IO type. Required.
|
|
892
|
-
:type patch_job: list[~azure.quantum._client.models.JsonPatchDocument] or IO
|
|
890
|
+
[JsonPatchDocument] type or a IO[bytes] type. Required.
|
|
891
|
+
:type patch_job: list[~azure.quantum._client.models.JsonPatchDocument] or IO[bytes]
|
|
893
892
|
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
|
894
893
|
Default value is None.
|
|
895
894
|
:paramtype content_type: str
|
|
@@ -914,12 +913,12 @@ class JobsOperations:
|
|
|
914
913
|
content_type = content_type or "application/json"
|
|
915
914
|
_json = None
|
|
916
915
|
_content = None
|
|
917
|
-
if isinstance(patch_job, (
|
|
916
|
+
if isinstance(patch_job, (IOBase, bytes)):
|
|
918
917
|
_content = patch_job
|
|
919
918
|
else:
|
|
920
919
|
_json = self._serialize.body(patch_job, "[JsonPatchDocument]")
|
|
921
920
|
|
|
922
|
-
|
|
921
|
+
_request = build_jobs_patch_request(
|
|
923
922
|
job_id=job_id,
|
|
924
923
|
subscription_id=self._config.subscription_id,
|
|
925
924
|
resource_group_name=self._config.resource_group_name,
|
|
@@ -931,16 +930,23 @@ class JobsOperations:
|
|
|
931
930
|
headers=_headers,
|
|
932
931
|
params=_params,
|
|
933
932
|
)
|
|
934
|
-
|
|
933
|
+
path_format_arguments = {
|
|
934
|
+
"azureRegion": self._serialize.url(
|
|
935
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
936
|
+
),
|
|
937
|
+
}
|
|
938
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
935
939
|
|
|
936
940
|
_stream = False
|
|
937
941
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
938
|
-
|
|
942
|
+
_request, stream=_stream, **kwargs
|
|
939
943
|
)
|
|
940
944
|
|
|
941
945
|
response = pipeline_response.http_response
|
|
942
946
|
|
|
943
947
|
if response.status_code not in [200, 204]:
|
|
948
|
+
if _stream:
|
|
949
|
+
response.read() # Load the body in memory and close the socket
|
|
944
950
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
945
951
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
946
952
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -950,9 +956,9 @@ class JobsOperations:
|
|
|
950
956
|
deserialized = self._deserialize("JobDetails", pipeline_response)
|
|
951
957
|
|
|
952
958
|
if cls:
|
|
953
|
-
return cls(pipeline_response, deserialized, {})
|
|
959
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
|
954
960
|
|
|
955
|
-
return deserialized
|
|
961
|
+
return deserialized # type: ignore
|
|
956
962
|
|
|
957
963
|
|
|
958
964
|
class ProvidersOperations:
|
|
@@ -998,7 +1004,7 @@ class ProvidersOperations:
|
|
|
998
1004
|
def prepare_request(next_link=None):
|
|
999
1005
|
if not next_link:
|
|
1000
1006
|
|
|
1001
|
-
|
|
1007
|
+
_request = build_providers_get_status_request(
|
|
1002
1008
|
subscription_id=self._config.subscription_id,
|
|
1003
1009
|
resource_group_name=self._config.resource_group_name,
|
|
1004
1010
|
workspace_name=self._config.workspace_name,
|
|
@@ -1006,7 +1012,12 @@ class ProvidersOperations:
|
|
|
1006
1012
|
headers=_headers,
|
|
1007
1013
|
params=_params,
|
|
1008
1014
|
)
|
|
1009
|
-
|
|
1015
|
+
path_format_arguments = {
|
|
1016
|
+
"azureRegion": self._serialize.url(
|
|
1017
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1018
|
+
),
|
|
1019
|
+
}
|
|
1020
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1010
1021
|
|
|
1011
1022
|
else:
|
|
1012
1023
|
# make call to next link with the client's api-version
|
|
@@ -1018,12 +1029,17 @@ class ProvidersOperations:
|
|
|
1018
1029
|
}
|
|
1019
1030
|
)
|
|
1020
1031
|
_next_request_params["api-version"] = self._config.api_version
|
|
1021
|
-
|
|
1032
|
+
_request = HttpRequest(
|
|
1022
1033
|
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1023
1034
|
)
|
|
1024
|
-
|
|
1035
|
+
path_format_arguments = {
|
|
1036
|
+
"azureRegion": self._serialize.url(
|
|
1037
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1038
|
+
),
|
|
1039
|
+
}
|
|
1040
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1025
1041
|
|
|
1026
|
-
return
|
|
1042
|
+
return _request
|
|
1027
1043
|
|
|
1028
1044
|
def extract_data(pipeline_response):
|
|
1029
1045
|
deserialized = self._deserialize(
|
|
@@ -1035,15 +1051,17 @@ class ProvidersOperations:
|
|
|
1035
1051
|
return deserialized.next_link or None, iter(list_of_elem)
|
|
1036
1052
|
|
|
1037
1053
|
def get_next(next_link=None):
|
|
1038
|
-
|
|
1054
|
+
_request = prepare_request(next_link)
|
|
1039
1055
|
|
|
1040
1056
|
_stream = False
|
|
1041
1057
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1042
|
-
|
|
1058
|
+
_request, stream=_stream, **kwargs
|
|
1043
1059
|
)
|
|
1044
1060
|
response = pipeline_response.http_response
|
|
1045
1061
|
|
|
1046
1062
|
if response.status_code not in [200]:
|
|
1063
|
+
if _stream:
|
|
1064
|
+
response.read() # Load the body in memory and close the socket
|
|
1047
1065
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1048
1066
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
1049
1067
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -1092,14 +1110,14 @@ class StorageOperations:
|
|
|
1092
1110
|
|
|
1093
1111
|
@overload
|
|
1094
1112
|
def sas_uri(
|
|
1095
|
-
self, blob_details: IO, *, content_type: str = "application/json", **kwargs: Any
|
|
1113
|
+
self, blob_details: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
|
|
1096
1114
|
) -> _models.SasUriResponse:
|
|
1097
1115
|
"""Gets a URL with SAS token for a container/blob in the storage account associated with the
|
|
1098
1116
|
workspace. The SAS URL can be used to upload job input and/or download job output.
|
|
1099
1117
|
|
|
1100
1118
|
:param blob_details: The details (name and container) of the blob to store or download data.
|
|
1101
1119
|
Required.
|
|
1102
|
-
:type blob_details: IO
|
|
1120
|
+
:type blob_details: IO[bytes]
|
|
1103
1121
|
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
|
1104
1122
|
Default value is "application/json".
|
|
1105
1123
|
:paramtype content_type: str
|
|
@@ -1109,13 +1127,13 @@ class StorageOperations:
|
|
|
1109
1127
|
"""
|
|
1110
1128
|
|
|
1111
1129
|
@distributed_trace
|
|
1112
|
-
def sas_uri(self, blob_details: Union[_models.BlobDetails, IO], **kwargs: Any) -> _models.SasUriResponse:
|
|
1130
|
+
def sas_uri(self, blob_details: Union[_models.BlobDetails, IO[bytes]], **kwargs: Any) -> _models.SasUriResponse:
|
|
1113
1131
|
"""Gets a URL with SAS token for a container/blob in the storage account associated with the
|
|
1114
1132
|
workspace. The SAS URL can be used to upload job input and/or download job output.
|
|
1115
1133
|
|
|
1116
1134
|
:param blob_details: The details (name and container) of the blob to store or download data. Is
|
|
1117
|
-
either a BlobDetails type or a IO type. Required.
|
|
1118
|
-
:type blob_details: ~azure.quantum._client.models.BlobDetails or IO
|
|
1135
|
+
either a BlobDetails type or a IO[bytes] type. Required.
|
|
1136
|
+
:type blob_details: ~azure.quantum._client.models.BlobDetails or IO[bytes]
|
|
1119
1137
|
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
|
1120
1138
|
Default value is None.
|
|
1121
1139
|
:paramtype content_type: str
|
|
@@ -1140,12 +1158,12 @@ class StorageOperations:
|
|
|
1140
1158
|
content_type = content_type or "application/json"
|
|
1141
1159
|
_json = None
|
|
1142
1160
|
_content = None
|
|
1143
|
-
if isinstance(blob_details, (
|
|
1161
|
+
if isinstance(blob_details, (IOBase, bytes)):
|
|
1144
1162
|
_content = blob_details
|
|
1145
1163
|
else:
|
|
1146
1164
|
_json = self._serialize.body(blob_details, "BlobDetails")
|
|
1147
1165
|
|
|
1148
|
-
|
|
1166
|
+
_request = build_storage_sas_uri_request(
|
|
1149
1167
|
subscription_id=self._config.subscription_id,
|
|
1150
1168
|
resource_group_name=self._config.resource_group_name,
|
|
1151
1169
|
workspace_name=self._config.workspace_name,
|
|
@@ -1156,16 +1174,23 @@ class StorageOperations:
|
|
|
1156
1174
|
headers=_headers,
|
|
1157
1175
|
params=_params,
|
|
1158
1176
|
)
|
|
1159
|
-
|
|
1177
|
+
path_format_arguments = {
|
|
1178
|
+
"azureRegion": self._serialize.url(
|
|
1179
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1180
|
+
),
|
|
1181
|
+
}
|
|
1182
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1160
1183
|
|
|
1161
1184
|
_stream = False
|
|
1162
1185
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1163
|
-
|
|
1186
|
+
_request, stream=_stream, **kwargs
|
|
1164
1187
|
)
|
|
1165
1188
|
|
|
1166
1189
|
response = pipeline_response.http_response
|
|
1167
1190
|
|
|
1168
1191
|
if response.status_code not in [200]:
|
|
1192
|
+
if _stream:
|
|
1193
|
+
response.read() # Load the body in memory and close the socket
|
|
1169
1194
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1170
1195
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
1171
1196
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -1173,9 +1198,9 @@ class StorageOperations:
|
|
|
1173
1198
|
deserialized = self._deserialize("SasUriResponse", pipeline_response)
|
|
1174
1199
|
|
|
1175
1200
|
if cls:
|
|
1176
|
-
return cls(pipeline_response, deserialized, {})
|
|
1201
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
|
1177
1202
|
|
|
1178
|
-
return deserialized
|
|
1203
|
+
return deserialized # type: ignore
|
|
1179
1204
|
|
|
1180
1205
|
|
|
1181
1206
|
class QuotasOperations:
|
|
@@ -1221,7 +1246,7 @@ class QuotasOperations:
|
|
|
1221
1246
|
def prepare_request(next_link=None):
|
|
1222
1247
|
if not next_link:
|
|
1223
1248
|
|
|
1224
|
-
|
|
1249
|
+
_request = build_quotas_list_request(
|
|
1225
1250
|
subscription_id=self._config.subscription_id,
|
|
1226
1251
|
resource_group_name=self._config.resource_group_name,
|
|
1227
1252
|
workspace_name=self._config.workspace_name,
|
|
@@ -1229,7 +1254,12 @@ class QuotasOperations:
|
|
|
1229
1254
|
headers=_headers,
|
|
1230
1255
|
params=_params,
|
|
1231
1256
|
)
|
|
1232
|
-
|
|
1257
|
+
path_format_arguments = {
|
|
1258
|
+
"azureRegion": self._serialize.url(
|
|
1259
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1260
|
+
),
|
|
1261
|
+
}
|
|
1262
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1233
1263
|
|
|
1234
1264
|
else:
|
|
1235
1265
|
# make call to next link with the client's api-version
|
|
@@ -1241,12 +1271,17 @@ class QuotasOperations:
|
|
|
1241
1271
|
}
|
|
1242
1272
|
)
|
|
1243
1273
|
_next_request_params["api-version"] = self._config.api_version
|
|
1244
|
-
|
|
1274
|
+
_request = HttpRequest(
|
|
1245
1275
|
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1246
1276
|
)
|
|
1247
|
-
|
|
1277
|
+
path_format_arguments = {
|
|
1278
|
+
"azureRegion": self._serialize.url(
|
|
1279
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1280
|
+
),
|
|
1281
|
+
}
|
|
1282
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1248
1283
|
|
|
1249
|
-
return
|
|
1284
|
+
return _request
|
|
1250
1285
|
|
|
1251
1286
|
def extract_data(pipeline_response):
|
|
1252
1287
|
deserialized = self._deserialize(
|
|
@@ -1258,15 +1293,17 @@ class QuotasOperations:
|
|
|
1258
1293
|
return deserialized.next_link or None, iter(list_of_elem)
|
|
1259
1294
|
|
|
1260
1295
|
def get_next(next_link=None):
|
|
1261
|
-
|
|
1296
|
+
_request = prepare_request(next_link)
|
|
1262
1297
|
|
|
1263
1298
|
_stream = False
|
|
1264
1299
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1265
|
-
|
|
1300
|
+
_request, stream=_stream, **kwargs
|
|
1266
1301
|
)
|
|
1267
1302
|
response = pipeline_response.http_response
|
|
1268
1303
|
|
|
1269
1304
|
if response.status_code not in [200]:
|
|
1305
|
+
if _stream:
|
|
1306
|
+
response.read() # Load the body in memory and close the socket
|
|
1270
1307
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1271
1308
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
1272
1309
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -1319,7 +1356,7 @@ class SessionsOperations:
|
|
|
1319
1356
|
def prepare_request(next_link=None):
|
|
1320
1357
|
if not next_link:
|
|
1321
1358
|
|
|
1322
|
-
|
|
1359
|
+
_request = build_sessions_list_request(
|
|
1323
1360
|
subscription_id=self._config.subscription_id,
|
|
1324
1361
|
resource_group_name=self._config.resource_group_name,
|
|
1325
1362
|
workspace_name=self._config.workspace_name,
|
|
@@ -1327,7 +1364,12 @@ class SessionsOperations:
|
|
|
1327
1364
|
headers=_headers,
|
|
1328
1365
|
params=_params,
|
|
1329
1366
|
)
|
|
1330
|
-
|
|
1367
|
+
path_format_arguments = {
|
|
1368
|
+
"azureRegion": self._serialize.url(
|
|
1369
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1370
|
+
),
|
|
1371
|
+
}
|
|
1372
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1331
1373
|
|
|
1332
1374
|
else:
|
|
1333
1375
|
# make call to next link with the client's api-version
|
|
@@ -1339,12 +1381,17 @@ class SessionsOperations:
|
|
|
1339
1381
|
}
|
|
1340
1382
|
)
|
|
1341
1383
|
_next_request_params["api-version"] = self._config.api_version
|
|
1342
|
-
|
|
1384
|
+
_request = HttpRequest(
|
|
1343
1385
|
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1344
1386
|
)
|
|
1345
|
-
|
|
1387
|
+
path_format_arguments = {
|
|
1388
|
+
"azureRegion": self._serialize.url(
|
|
1389
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1390
|
+
),
|
|
1391
|
+
}
|
|
1392
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1346
1393
|
|
|
1347
|
-
return
|
|
1394
|
+
return _request
|
|
1348
1395
|
|
|
1349
1396
|
def extract_data(pipeline_response):
|
|
1350
1397
|
deserialized = self._deserialize(
|
|
@@ -1356,15 +1403,17 @@ class SessionsOperations:
|
|
|
1356
1403
|
return deserialized.next_link or None, iter(list_of_elem)
|
|
1357
1404
|
|
|
1358
1405
|
def get_next(next_link=None):
|
|
1359
|
-
|
|
1406
|
+
_request = prepare_request(next_link)
|
|
1360
1407
|
|
|
1361
1408
|
_stream = False
|
|
1362
1409
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1363
|
-
|
|
1410
|
+
_request, stream=_stream, **kwargs
|
|
1364
1411
|
)
|
|
1365
1412
|
response = pipeline_response.http_response
|
|
1366
1413
|
|
|
1367
1414
|
if response.status_code not in [200]:
|
|
1415
|
+
if _stream:
|
|
1416
|
+
response.read() # Load the body in memory and close the socket
|
|
1368
1417
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1369
1418
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
1370
1419
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -1396,7 +1445,7 @@ class SessionsOperations:
|
|
|
1396
1445
|
|
|
1397
1446
|
cls: ClsType[_models.SessionDetails] = kwargs.pop("cls", None)
|
|
1398
1447
|
|
|
1399
|
-
|
|
1448
|
+
_request = build_sessions_get_request(
|
|
1400
1449
|
session_id=session_id,
|
|
1401
1450
|
subscription_id=self._config.subscription_id,
|
|
1402
1451
|
resource_group_name=self._config.resource_group_name,
|
|
@@ -1405,16 +1454,23 @@ class SessionsOperations:
|
|
|
1405
1454
|
headers=_headers,
|
|
1406
1455
|
params=_params,
|
|
1407
1456
|
)
|
|
1408
|
-
|
|
1457
|
+
path_format_arguments = {
|
|
1458
|
+
"azureRegion": self._serialize.url(
|
|
1459
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1460
|
+
),
|
|
1461
|
+
}
|
|
1462
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1409
1463
|
|
|
1410
1464
|
_stream = False
|
|
1411
1465
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1412
|
-
|
|
1466
|
+
_request, stream=_stream, **kwargs
|
|
1413
1467
|
)
|
|
1414
1468
|
|
|
1415
1469
|
response = pipeline_response.http_response
|
|
1416
1470
|
|
|
1417
1471
|
if response.status_code not in [200]:
|
|
1472
|
+
if _stream:
|
|
1473
|
+
response.read() # Load the body in memory and close the socket
|
|
1418
1474
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1419
1475
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
1420
1476
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -1422,9 +1478,9 @@ class SessionsOperations:
|
|
|
1422
1478
|
deserialized = self._deserialize("SessionDetails", pipeline_response)
|
|
1423
1479
|
|
|
1424
1480
|
if cls:
|
|
1425
|
-
return cls(pipeline_response, deserialized, {})
|
|
1481
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
|
1426
1482
|
|
|
1427
|
-
return deserialized
|
|
1483
|
+
return deserialized # type: ignore
|
|
1428
1484
|
|
|
1429
1485
|
@overload
|
|
1430
1486
|
def open(
|
|
@@ -1446,14 +1502,14 @@ class SessionsOperations:
|
|
|
1446
1502
|
|
|
1447
1503
|
@overload
|
|
1448
1504
|
def open(
|
|
1449
|
-
self, session_id: str, session: IO, *, content_type: str = "application/json", **kwargs: Any
|
|
1505
|
+
self, session_id: str, session: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
|
|
1450
1506
|
) -> _models.SessionDetails:
|
|
1451
1507
|
"""Open a session.
|
|
1452
1508
|
|
|
1453
1509
|
:param session_id: Id of the session. Required.
|
|
1454
1510
|
:type session_id: str
|
|
1455
1511
|
:param session: The complete metadata of the session to be opened. Required.
|
|
1456
|
-
:type session: IO
|
|
1512
|
+
:type session: IO[bytes]
|
|
1457
1513
|
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
|
1458
1514
|
Default value is "application/json".
|
|
1459
1515
|
:paramtype content_type: str
|
|
@@ -1464,15 +1520,15 @@ class SessionsOperations:
|
|
|
1464
1520
|
|
|
1465
1521
|
@distributed_trace
|
|
1466
1522
|
def open(
|
|
1467
|
-
self, session_id: str, session: Union[_models.SessionDetails, IO], **kwargs: Any
|
|
1523
|
+
self, session_id: str, session: Union[_models.SessionDetails, IO[bytes]], **kwargs: Any
|
|
1468
1524
|
) -> _models.SessionDetails:
|
|
1469
1525
|
"""Open a session.
|
|
1470
1526
|
|
|
1471
1527
|
:param session_id: Id of the session. Required.
|
|
1472
1528
|
:type session_id: str
|
|
1473
1529
|
:param session: The complete metadata of the session to be opened. Is either a SessionDetails
|
|
1474
|
-
type or a IO type. Required.
|
|
1475
|
-
:type session: ~azure.quantum._client.models.SessionDetails or IO
|
|
1530
|
+
type or a IO[bytes] type. Required.
|
|
1531
|
+
:type session: ~azure.quantum._client.models.SessionDetails or IO[bytes]
|
|
1476
1532
|
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
|
1477
1533
|
Default value is None.
|
|
1478
1534
|
:paramtype content_type: str
|
|
@@ -1497,12 +1553,12 @@ class SessionsOperations:
|
|
|
1497
1553
|
content_type = content_type or "application/json"
|
|
1498
1554
|
_json = None
|
|
1499
1555
|
_content = None
|
|
1500
|
-
if isinstance(session, (
|
|
1556
|
+
if isinstance(session, (IOBase, bytes)):
|
|
1501
1557
|
_content = session
|
|
1502
1558
|
else:
|
|
1503
1559
|
_json = self._serialize.body(session, "SessionDetails")
|
|
1504
1560
|
|
|
1505
|
-
|
|
1561
|
+
_request = build_sessions_open_request(
|
|
1506
1562
|
session_id=session_id,
|
|
1507
1563
|
subscription_id=self._config.subscription_id,
|
|
1508
1564
|
resource_group_name=self._config.resource_group_name,
|
|
@@ -1514,16 +1570,23 @@ class SessionsOperations:
|
|
|
1514
1570
|
headers=_headers,
|
|
1515
1571
|
params=_params,
|
|
1516
1572
|
)
|
|
1517
|
-
|
|
1573
|
+
path_format_arguments = {
|
|
1574
|
+
"azureRegion": self._serialize.url(
|
|
1575
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1576
|
+
),
|
|
1577
|
+
}
|
|
1578
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1518
1579
|
|
|
1519
1580
|
_stream = False
|
|
1520
1581
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1521
|
-
|
|
1582
|
+
_request, stream=_stream, **kwargs
|
|
1522
1583
|
)
|
|
1523
1584
|
|
|
1524
1585
|
response = pipeline_response.http_response
|
|
1525
1586
|
|
|
1526
1587
|
if response.status_code not in [200, 201]:
|
|
1588
|
+
if _stream:
|
|
1589
|
+
response.read() # Load the body in memory and close the socket
|
|
1527
1590
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1528
1591
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
1529
1592
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -1562,7 +1625,7 @@ class SessionsOperations:
|
|
|
1562
1625
|
|
|
1563
1626
|
cls: ClsType[_models.SessionDetails] = kwargs.pop("cls", None)
|
|
1564
1627
|
|
|
1565
|
-
|
|
1628
|
+
_request = build_sessions_close_request(
|
|
1566
1629
|
session_id=session_id,
|
|
1567
1630
|
subscription_id=self._config.subscription_id,
|
|
1568
1631
|
resource_group_name=self._config.resource_group_name,
|
|
@@ -1571,16 +1634,23 @@ class SessionsOperations:
|
|
|
1571
1634
|
headers=_headers,
|
|
1572
1635
|
params=_params,
|
|
1573
1636
|
)
|
|
1574
|
-
|
|
1637
|
+
path_format_arguments = {
|
|
1638
|
+
"azureRegion": self._serialize.url(
|
|
1639
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1640
|
+
),
|
|
1641
|
+
}
|
|
1642
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1575
1643
|
|
|
1576
1644
|
_stream = False
|
|
1577
1645
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1578
|
-
|
|
1646
|
+
_request, stream=_stream, **kwargs
|
|
1579
1647
|
)
|
|
1580
1648
|
|
|
1581
1649
|
response = pipeline_response.http_response
|
|
1582
1650
|
|
|
1583
1651
|
if response.status_code not in [200]:
|
|
1652
|
+
if _stream:
|
|
1653
|
+
response.read() # Load the body in memory and close the socket
|
|
1584
1654
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1585
1655
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
1586
1656
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -1588,9 +1658,9 @@ class SessionsOperations:
|
|
|
1588
1658
|
deserialized = self._deserialize("SessionDetails", pipeline_response)
|
|
1589
1659
|
|
|
1590
1660
|
if cls:
|
|
1591
|
-
return cls(pipeline_response, deserialized, {})
|
|
1661
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
|
1592
1662
|
|
|
1593
|
-
return deserialized
|
|
1663
|
+
return deserialized # type: ignore
|
|
1594
1664
|
|
|
1595
1665
|
@distributed_trace
|
|
1596
1666
|
def jobs_list(self, session_id: str, **kwargs: Any) -> Iterable["_models.JobDetails"]:
|
|
@@ -1618,7 +1688,7 @@ class SessionsOperations:
|
|
|
1618
1688
|
def prepare_request(next_link=None):
|
|
1619
1689
|
if not next_link:
|
|
1620
1690
|
|
|
1621
|
-
|
|
1691
|
+
_request = build_sessions_jobs_list_request(
|
|
1622
1692
|
session_id=session_id,
|
|
1623
1693
|
subscription_id=self._config.subscription_id,
|
|
1624
1694
|
resource_group_name=self._config.resource_group_name,
|
|
@@ -1627,7 +1697,12 @@ class SessionsOperations:
|
|
|
1627
1697
|
headers=_headers,
|
|
1628
1698
|
params=_params,
|
|
1629
1699
|
)
|
|
1630
|
-
|
|
1700
|
+
path_format_arguments = {
|
|
1701
|
+
"azureRegion": self._serialize.url(
|
|
1702
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1703
|
+
),
|
|
1704
|
+
}
|
|
1705
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1631
1706
|
|
|
1632
1707
|
else:
|
|
1633
1708
|
# make call to next link with the client's api-version
|
|
@@ -1639,12 +1714,17 @@ class SessionsOperations:
|
|
|
1639
1714
|
}
|
|
1640
1715
|
)
|
|
1641
1716
|
_next_request_params["api-version"] = self._config.api_version
|
|
1642
|
-
|
|
1717
|
+
_request = HttpRequest(
|
|
1643
1718
|
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1644
1719
|
)
|
|
1645
|
-
|
|
1720
|
+
path_format_arguments = {
|
|
1721
|
+
"azureRegion": self._serialize.url(
|
|
1722
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1723
|
+
),
|
|
1724
|
+
}
|
|
1725
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1646
1726
|
|
|
1647
|
-
return
|
|
1727
|
+
return _request
|
|
1648
1728
|
|
|
1649
1729
|
def extract_data(pipeline_response):
|
|
1650
1730
|
deserialized = self._deserialize(
|
|
@@ -1656,15 +1736,17 @@ class SessionsOperations:
|
|
|
1656
1736
|
return deserialized.next_link or None, iter(list_of_elem)
|
|
1657
1737
|
|
|
1658
1738
|
def get_next(next_link=None):
|
|
1659
|
-
|
|
1739
|
+
_request = prepare_request(next_link)
|
|
1660
1740
|
|
|
1661
1741
|
_stream = False
|
|
1662
1742
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1663
|
-
|
|
1743
|
+
_request, stream=_stream, **kwargs
|
|
1664
1744
|
)
|
|
1665
1745
|
response = pipeline_response.http_response
|
|
1666
1746
|
|
|
1667
1747
|
if response.status_code not in [200]:
|
|
1748
|
+
if _stream:
|
|
1749
|
+
response.read() # Load the body in memory and close the socket
|
|
1668
1750
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1669
1751
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
1670
1752
|
raise HttpResponseError(response=response, model=error)
|
|
@@ -1717,7 +1799,7 @@ class TopLevelItemsOperations:
|
|
|
1717
1799
|
def prepare_request(next_link=None):
|
|
1718
1800
|
if not next_link:
|
|
1719
1801
|
|
|
1720
|
-
|
|
1802
|
+
_request = build_top_level_items_list_request(
|
|
1721
1803
|
subscription_id=self._config.subscription_id,
|
|
1722
1804
|
resource_group_name=self._config.resource_group_name,
|
|
1723
1805
|
workspace_name=self._config.workspace_name,
|
|
@@ -1725,7 +1807,12 @@ class TopLevelItemsOperations:
|
|
|
1725
1807
|
headers=_headers,
|
|
1726
1808
|
params=_params,
|
|
1727
1809
|
)
|
|
1728
|
-
|
|
1810
|
+
path_format_arguments = {
|
|
1811
|
+
"azureRegion": self._serialize.url(
|
|
1812
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1813
|
+
),
|
|
1814
|
+
}
|
|
1815
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1729
1816
|
|
|
1730
1817
|
else:
|
|
1731
1818
|
# make call to next link with the client's api-version
|
|
@@ -1737,12 +1824,17 @@ class TopLevelItemsOperations:
|
|
|
1737
1824
|
}
|
|
1738
1825
|
)
|
|
1739
1826
|
_next_request_params["api-version"] = self._config.api_version
|
|
1740
|
-
|
|
1827
|
+
_request = HttpRequest(
|
|
1741
1828
|
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1742
1829
|
)
|
|
1743
|
-
|
|
1830
|
+
path_format_arguments = {
|
|
1831
|
+
"azureRegion": self._serialize.url(
|
|
1832
|
+
"self._config.azure_region", self._config.azure_region, "str", skip_quote=True
|
|
1833
|
+
),
|
|
1834
|
+
}
|
|
1835
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1744
1836
|
|
|
1745
|
-
return
|
|
1837
|
+
return _request
|
|
1746
1838
|
|
|
1747
1839
|
def extract_data(pipeline_response):
|
|
1748
1840
|
deserialized = self._deserialize(
|
|
@@ -1754,15 +1846,17 @@ class TopLevelItemsOperations:
|
|
|
1754
1846
|
return deserialized.next_link or None, iter(list_of_elem)
|
|
1755
1847
|
|
|
1756
1848
|
def get_next(next_link=None):
|
|
1757
|
-
|
|
1849
|
+
_request = prepare_request(next_link)
|
|
1758
1850
|
|
|
1759
1851
|
_stream = False
|
|
1760
1852
|
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1761
|
-
|
|
1853
|
+
_request, stream=_stream, **kwargs
|
|
1762
1854
|
)
|
|
1763
1855
|
response = pipeline_response.http_response
|
|
1764
1856
|
|
|
1765
1857
|
if response.status_code not in [200]:
|
|
1858
|
+
if _stream:
|
|
1859
|
+
response.read() # Load the body in memory and close the socket
|
|
1766
1860
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1767
1861
|
error = self._deserialize.failsafe_deserialize(_models.RestError, pipeline_response)
|
|
1768
1862
|
raise HttpResponseError(response=response, model=error)
|