azure-quantum 2.3.0__tar.gz → 2.5.0.dev0__tar.gz
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-2.3.0 → azure_quantum-2.5.0.dev0}/PKG-INFO +35 -1
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_client/__init__.py +11 -5
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_client/_client.py +40 -49
- azure_quantum-2.5.0.dev0/azure/quantum/_client/_configuration.py +82 -0
- azure_quantum-2.5.0.dev0/azure/quantum/_client/_model_base.py +1159 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_client/_serialization.py +285 -172
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_client/_version.py +1 -1
- azure_quantum-2.5.0.dev0/azure/quantum/_client/aio/__init__.py +29 -0
- azure_quantum-2.5.0.dev0/azure/quantum/_client/aio/_client.py +143 -0
- azure_quantum-2.5.0.dev0/azure/quantum/_client/aio/_configuration.py +82 -0
- azure_quantum-2.5.0.dev0/azure/quantum/_client/aio/operations/__init__.py +35 -0
- azure_quantum-2.5.0.dev0/azure/quantum/_client/aio/operations/_operations.py +1824 -0
- azure_quantum-2.5.0.dev0/azure/quantum/_client/models/__init__.py +76 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_client/models/_enums.py +34 -4
- azure_quantum-2.5.0.dev0/azure/quantum/_client/models/_models.py +692 -0
- azure_quantum-2.5.0.dev0/azure/quantum/_client/models/_patch.py +20 -0
- azure_quantum-2.5.0.dev0/azure/quantum/_client/operations/__init__.py +35 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_client/operations/_operations.py +1191 -769
- azure_quantum-2.5.0.dev0/azure/quantum/_client/operations/_patch.py +20 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/microsoft/elements/dft/target.py +2 -1
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/rigetti/target.py +1 -1
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/version.py +1 -1
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/workspace.py +371 -38
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure_quantum.egg-info/PKG-INFO +35 -1
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure_quantum.egg-info/SOURCES.txt +8 -1
- azure-quantum-2.3.0/azure/quantum/_client/_configuration.py +0 -89
- azure-quantum-2.3.0/azure/quantum/_client/_vendor.py +0 -20
- azure-quantum-2.3.0/azure/quantum/_client/models/__init__.py +0 -65
- azure-quantum-2.3.0/azure/quantum/_client/models/_models.py +0 -1021
- azure-quantum-2.3.0/azure/quantum/_client/operations/__init__.py +0 -29
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/README.md +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_authentication/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_authentication/_chained.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_authentication/_default.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_authentication/_token.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_client/_patch.py +0 -0
- {azure-quantum-2.3.0/azure/quantum/_client/models → azure_quantum-2.5.0.dev0/azure/quantum/_client/aio}/_patch.py +0 -0
- {azure-quantum-2.3.0/azure/quantum/_client → azure_quantum-2.5.0.dev0/azure/quantum/_client/aio}/operations/_patch.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_constants.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/_workspace_connection_params.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/argument_types/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/argument_types/types.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/chemistry/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/cirq/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/cirq/job.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/cirq/service.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/cirq/targets/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/cirq/targets/ionq.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/cirq/targets/quantinuum.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/cirq/targets/target.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/job/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/job/base_job.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/job/filtered_job.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/job/job.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/job/job_failed_with_results_error.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/job/session.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/job/workspace_item.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/job/workspace_item_factory.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/qiskit/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/qiskit/backends/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/qiskit/backends/backend.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/qiskit/backends/ionq.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/qiskit/backends/qci.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/qiskit/backends/quantinuum.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/qiskit/backends/rigetti.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/qiskit/job.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/qiskit/provider.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/storage.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/ionq.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/microsoft/elements/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/microsoft/elements/dft/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/microsoft/elements/dft/job.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/microsoft/target.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/params.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/pasqal/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/pasqal/result.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/pasqal/target.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/quantinuum.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/rigetti/__init__.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/rigetti/result.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/target.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure/quantum/target/target_factory.py +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure_quantum.egg-info/dependency_links.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure_quantum.egg-info/requires.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/azure_quantum.egg-info/top_level.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/requirements-cirq.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/requirements-dev.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/requirements-pulser.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/requirements-qiskit.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/requirements-qsharp.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/requirements-quil.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/requirements.txt +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/setup.cfg +0 -0
- {azure-quantum-2.3.0 → azure_quantum-2.5.0.dev0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: azure-quantum
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.0.dev0
|
|
4
4
|
Summary: Python client for Azure Quantum
|
|
5
5
|
Home-page: https://github.com/microsoft/azure-quantum-python
|
|
6
6
|
Author: Microsoft
|
|
@@ -10,13 +10,47 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Requires-Python: >=3.8
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: azure-core<2.0,>=1.30
|
|
14
|
+
Requires-Dist: azure-identity<2.0,>=1.17
|
|
15
|
+
Requires-Dist: azure-storage-blob==12.20
|
|
16
|
+
Requires-Dist: msrest<1.0,>=0.7.1
|
|
17
|
+
Requires-Dist: numpy<2.0,>=1.21.0
|
|
18
|
+
Requires-Dist: deprecated<2.0,>=1.2.12
|
|
19
|
+
Requires-Dist: Markdown>=3.4.1
|
|
20
|
+
Requires-Dist: python-markdown-math>=0.8
|
|
13
21
|
Provides-Extra: cirq
|
|
22
|
+
Requires-Dist: cirq-core<=1.4.1,>=1.3.0; extra == "cirq"
|
|
23
|
+
Requires-Dist: cirq-ionq<=1.4.1,>=1.3.0; extra == "cirq"
|
|
14
24
|
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: vcrpy>=4.3.1; extra == "dev"
|
|
26
|
+
Requires-Dist: azure-devtools<2.0,>=1.2.0; extra == "dev"
|
|
27
|
+
Requires-Dist: graphviz>=0.20.1; extra == "dev"
|
|
15
28
|
Provides-Extra: pulser
|
|
29
|
+
Requires-Dist: pulser<0.19,>=0.18; extra == "pulser"
|
|
16
30
|
Provides-Extra: qiskit
|
|
31
|
+
Requires-Dist: qiskit-ionq<0.6,>=0.5; extra == "qiskit"
|
|
32
|
+
Requires-Dist: qsharp[qiskit]<2.0,>=1.9.0; extra == "qiskit"
|
|
33
|
+
Requires-Dist: pyqir<0.11,>=0.10.6; extra == "qiskit"
|
|
34
|
+
Requires-Dist: Markdown<4.0,>=3.4.1; extra == "qiskit"
|
|
35
|
+
Requires-Dist: python-markdown-math<1.0,>=0.8.0; extra == "qiskit"
|
|
17
36
|
Provides-Extra: qsharp
|
|
37
|
+
Requires-Dist: qsharp<2.0,>=1.0.33; extra == "qsharp"
|
|
18
38
|
Provides-Extra: quil
|
|
39
|
+
Requires-Dist: pyquil>=3.3.2; extra == "quil"
|
|
19
40
|
Provides-Extra: all
|
|
41
|
+
Requires-Dist: cirq-core<=1.4.1,>=1.3.0; extra == "all"
|
|
42
|
+
Requires-Dist: cirq-ionq<=1.4.1,>=1.3.0; extra == "all"
|
|
43
|
+
Requires-Dist: vcrpy>=4.3.1; extra == "all"
|
|
44
|
+
Requires-Dist: azure-devtools<2.0,>=1.2.0; extra == "all"
|
|
45
|
+
Requires-Dist: graphviz>=0.20.1; extra == "all"
|
|
46
|
+
Requires-Dist: pulser<0.19,>=0.18; extra == "all"
|
|
47
|
+
Requires-Dist: qiskit-ionq<0.6,>=0.5; extra == "all"
|
|
48
|
+
Requires-Dist: qsharp[qiskit]<2.0,>=1.9.0; extra == "all"
|
|
49
|
+
Requires-Dist: pyqir<0.11,>=0.10.6; extra == "all"
|
|
50
|
+
Requires-Dist: Markdown<4.0,>=3.4.1; extra == "all"
|
|
51
|
+
Requires-Dist: python-markdown-math<1.0,>=0.8.0; extra == "all"
|
|
52
|
+
Requires-Dist: qsharp<2.0,>=1.0.33; extra == "all"
|
|
53
|
+
Requires-Dist: pyquil>=3.3.2; extra == "all"
|
|
20
54
|
|
|
21
55
|

|
|
22
56
|
|
|
@@ -2,25 +2,31 @@
|
|
|
2
2
|
# --------------------------------------------------------------------------
|
|
3
3
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
# Code generated by Microsoft (R)
|
|
5
|
+
# Code generated by Microsoft (R) Python Code Generator.
|
|
6
6
|
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
# --------------------------------------------------------------------------
|
|
8
|
+
# pylint: disable=wrong-import-position
|
|
8
9
|
|
|
9
|
-
from
|
|
10
|
+
from typing import TYPE_CHECKING
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from ._patch import * # pylint: disable=unused-wildcard-import
|
|
14
|
+
|
|
15
|
+
from ._client import ServicesClient # type: ignore
|
|
10
16
|
from ._version import VERSION
|
|
11
17
|
|
|
12
18
|
__version__ = VERSION
|
|
13
19
|
|
|
14
20
|
try:
|
|
15
21
|
from ._patch import __all__ as _patch_all
|
|
16
|
-
from ._patch import *
|
|
22
|
+
from ._patch import *
|
|
17
23
|
except ImportError:
|
|
18
24
|
_patch_all = []
|
|
19
25
|
from ._patch import patch_sdk as _patch_sdk
|
|
20
26
|
|
|
21
27
|
__all__ = [
|
|
22
|
-
"
|
|
28
|
+
"ServicesClient",
|
|
23
29
|
]
|
|
24
|
-
__all__.extend([p for p in _patch_all if p not in __all__])
|
|
30
|
+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
|
|
25
31
|
|
|
26
32
|
_patch_sdk()
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
# --------------------------------------------------------------------------
|
|
3
3
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
# Code generated by Microsoft (R)
|
|
5
|
+
# Code generated by Microsoft (R) Python Code Generator.
|
|
6
6
|
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
# --------------------------------------------------------------------------
|
|
8
8
|
|
|
9
9
|
from copy import deepcopy
|
|
10
|
-
from typing import Any, TYPE_CHECKING
|
|
10
|
+
from typing import Any, TYPE_CHECKING, Union
|
|
11
|
+
from typing_extensions import Self
|
|
11
12
|
|
|
12
13
|
from azure.core import PipelineClient
|
|
14
|
+
from azure.core.credentials import AzureKeyCredential
|
|
13
15
|
from azure.core.pipeline import policies
|
|
14
16
|
from azure.core.rest import HttpRequest, HttpResponse
|
|
15
17
|
|
|
16
|
-
from . import
|
|
17
|
-
from ._configuration import QuantumClientConfiguration
|
|
18
|
+
from ._configuration import ServicesClientConfiguration
|
|
18
19
|
from ._serialization import Deserializer, Serializer
|
|
19
20
|
from .operations import (
|
|
20
21
|
JobsOperations,
|
|
@@ -26,59 +27,50 @@ from .operations import (
|
|
|
26
27
|
)
|
|
27
28
|
|
|
28
29
|
if TYPE_CHECKING:
|
|
29
|
-
# pylint: disable=unused-import,ungrouped-imports
|
|
30
30
|
from azure.core.credentials import TokenCredential
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
class
|
|
34
|
-
"""Azure Quantum
|
|
33
|
+
class ServicesClient:
|
|
34
|
+
"""Azure Quantum Workspace Services.
|
|
35
35
|
|
|
36
36
|
:ivar jobs: JobsOperations operations
|
|
37
|
-
:vartype jobs: azure.quantum.
|
|
37
|
+
:vartype jobs: azure.quantum.operations.JobsOperations
|
|
38
|
+
:ivar sessions: SessionsOperations operations
|
|
39
|
+
:vartype sessions: azure.quantum.operations.SessionsOperations
|
|
38
40
|
:ivar providers: ProvidersOperations operations
|
|
39
|
-
:vartype providers: azure.quantum.
|
|
41
|
+
:vartype providers: azure.quantum.operations.ProvidersOperations
|
|
40
42
|
:ivar storage: StorageOperations operations
|
|
41
|
-
:vartype storage: azure.quantum.
|
|
43
|
+
:vartype storage: azure.quantum.operations.StorageOperations
|
|
42
44
|
:ivar quotas: QuotasOperations operations
|
|
43
|
-
:vartype quotas: azure.quantum.
|
|
44
|
-
:ivar sessions: SessionsOperations operations
|
|
45
|
-
:vartype sessions: azure.quantum._client.operations.SessionsOperations
|
|
45
|
+
:vartype quotas: azure.quantum.operations.QuotasOperations
|
|
46
46
|
:ivar top_level_items: TopLevelItemsOperations operations
|
|
47
|
-
:vartype top_level_items: azure.quantum.
|
|
48
|
-
:param
|
|
49
|
-
|
|
50
|
-
:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
:
|
|
55
|
-
|
|
56
|
-
:
|
|
57
|
-
:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
:keyword api_version: Api Version. Default value is "2023-11-13-preview". Note that overriding
|
|
61
|
-
this default value may result in unsupported behavior.
|
|
47
|
+
:vartype top_level_items: azure.quantum.operations.TopLevelItemsOperations
|
|
48
|
+
:param region: The Azure region where the Azure Quantum Workspace is located. Required.
|
|
49
|
+
:type region: str
|
|
50
|
+
:param credential: Credential used to authenticate requests to the service. Is either a
|
|
51
|
+
TokenCredential type or a AzureKeyCredential type. Required.
|
|
52
|
+
:type credential: ~azure.core.credentials.TokenCredential or
|
|
53
|
+
~azure.core.credentials.AzureKeyCredential
|
|
54
|
+
:keyword service_base_url: The Azure Quantum service base url. Default value is
|
|
55
|
+
"quantum.azure.com".
|
|
56
|
+
:paramtype service_base_url: str
|
|
57
|
+
:keyword api_version: The API version to use for this operation. Default value is
|
|
58
|
+
"2024-10-01-preview". Note that overriding this default value may result in unsupported
|
|
59
|
+
behavior.
|
|
62
60
|
:paramtype api_version: str
|
|
63
61
|
"""
|
|
64
62
|
|
|
65
63
|
def __init__(
|
|
66
64
|
self,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
credential: "TokenCredential",
|
|
65
|
+
region: str,
|
|
66
|
+
credential: Union["TokenCredential", AzureKeyCredential],
|
|
67
|
+
*,
|
|
68
|
+
service_base_url: str = "quantum.azure.com",
|
|
72
69
|
**kwargs: Any
|
|
73
70
|
) -> None:
|
|
74
|
-
_endpoint =
|
|
75
|
-
self._config =
|
|
76
|
-
|
|
77
|
-
subscription_id=subscription_id,
|
|
78
|
-
resource_group_name=resource_group_name,
|
|
79
|
-
workspace_name=workspace_name,
|
|
80
|
-
credential=credential,
|
|
81
|
-
**kwargs
|
|
71
|
+
_endpoint = "https://{region}.{serviceBaseUrl}"
|
|
72
|
+
self._config = ServicesClientConfiguration(
|
|
73
|
+
region=region, credential=credential, service_base_url=service_base_url, **kwargs
|
|
82
74
|
)
|
|
83
75
|
_policies = kwargs.pop("policies", None)
|
|
84
76
|
if _policies is None:
|
|
@@ -99,16 +91,14 @@ class QuantumClient: # pylint: disable=client-accepts-api-version-keyword
|
|
|
99
91
|
]
|
|
100
92
|
self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
|
|
101
93
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
self._serialize = Serializer(client_models)
|
|
105
|
-
self._deserialize = Deserializer(client_models)
|
|
94
|
+
self._serialize = Serializer()
|
|
95
|
+
self._deserialize = Deserializer()
|
|
106
96
|
self._serialize.client_side_validation = False
|
|
107
97
|
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
98
|
+
self.sessions = SessionsOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
108
99
|
self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
109
100
|
self.storage = StorageOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
110
101
|
self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
111
|
-
self.sessions = SessionsOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
112
102
|
self.top_level_items = TopLevelItemsOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
113
103
|
|
|
114
104
|
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
|
|
@@ -131,8 +121,9 @@ class QuantumClient: # pylint: disable=client-accepts-api-version-keyword
|
|
|
131
121
|
|
|
132
122
|
request_copy = deepcopy(request)
|
|
133
123
|
path_format_arguments = {
|
|
134
|
-
"
|
|
135
|
-
|
|
124
|
+
"region": self._serialize.url("self._config.region", self._config.region, "str"),
|
|
125
|
+
"serviceBaseUrl": self._serialize.url(
|
|
126
|
+
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
136
127
|
),
|
|
137
128
|
}
|
|
138
129
|
|
|
@@ -142,7 +133,7 @@ class QuantumClient: # pylint: disable=client-accepts-api-version-keyword
|
|
|
142
133
|
def close(self) -> None:
|
|
143
134
|
self._client.close()
|
|
144
135
|
|
|
145
|
-
def __enter__(self) ->
|
|
136
|
+
def __enter__(self) -> Self:
|
|
146
137
|
self._client.__enter__()
|
|
147
138
|
return self
|
|
148
139
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
# --------------------------------------------------------------------------
|
|
3
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
+
# Code generated by Microsoft (R) Python Code Generator.
|
|
6
|
+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
# --------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
from typing import Any, TYPE_CHECKING, Union
|
|
10
|
+
|
|
11
|
+
from azure.core.credentials import AzureKeyCredential
|
|
12
|
+
from azure.core.pipeline import policies
|
|
13
|
+
|
|
14
|
+
from ._version import VERSION
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from azure.core.credentials import TokenCredential
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ServicesClientConfiguration: # pylint: disable=too-many-instance-attributes
|
|
21
|
+
"""Configuration for ServicesClient.
|
|
22
|
+
|
|
23
|
+
Note that all parameters used to create this instance are saved as instance
|
|
24
|
+
attributes.
|
|
25
|
+
|
|
26
|
+
:param region: The Azure region where the Azure Quantum Workspace is located. Required.
|
|
27
|
+
:type region: str
|
|
28
|
+
:param credential: Credential used to authenticate requests to the service. Is either a
|
|
29
|
+
TokenCredential type or a AzureKeyCredential type. Required.
|
|
30
|
+
:type credential: ~azure.core.credentials.TokenCredential or
|
|
31
|
+
~azure.core.credentials.AzureKeyCredential
|
|
32
|
+
:param service_base_url: The Azure Quantum service base url. Default value is
|
|
33
|
+
"quantum.azure.com".
|
|
34
|
+
:type service_base_url: str
|
|
35
|
+
:keyword api_version: The API version to use for this operation. Default value is
|
|
36
|
+
"2024-10-01-preview". Note that overriding this default value may result in unsupported
|
|
37
|
+
behavior.
|
|
38
|
+
:paramtype api_version: str
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
def __init__(
|
|
42
|
+
self,
|
|
43
|
+
region: str,
|
|
44
|
+
credential: Union["TokenCredential", AzureKeyCredential],
|
|
45
|
+
service_base_url: str = "quantum.azure.com",
|
|
46
|
+
**kwargs: Any,
|
|
47
|
+
) -> None:
|
|
48
|
+
api_version: str = kwargs.pop("api_version", "2024-10-01-preview")
|
|
49
|
+
|
|
50
|
+
if region is None:
|
|
51
|
+
raise ValueError("Parameter 'region' must not be None.")
|
|
52
|
+
if credential is None:
|
|
53
|
+
raise ValueError("Parameter 'credential' must not be None.")
|
|
54
|
+
|
|
55
|
+
self.region = region
|
|
56
|
+
self.credential = credential
|
|
57
|
+
self.service_base_url = service_base_url
|
|
58
|
+
self.api_version = api_version
|
|
59
|
+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://quantum.microsoft.com/.default"])
|
|
60
|
+
kwargs.setdefault("sdk_moniker", "quantum/{}".format(VERSION))
|
|
61
|
+
self.polling_interval = kwargs.get("polling_interval", 30)
|
|
62
|
+
self._configure(**kwargs)
|
|
63
|
+
|
|
64
|
+
def _infer_policy(self, **kwargs):
|
|
65
|
+
if hasattr(self.credential, "get_token"):
|
|
66
|
+
return policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
|
|
67
|
+
if isinstance(self.credential, AzureKeyCredential):
|
|
68
|
+
return policies.AzureKeyCredentialPolicy(self.credential, "x-ms-quantum-api-key", **kwargs)
|
|
69
|
+
raise TypeError(f"Unsupported credential: {self.credential}")
|
|
70
|
+
|
|
71
|
+
def _configure(self, **kwargs: Any) -> None:
|
|
72
|
+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
|
|
73
|
+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
|
|
74
|
+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
|
|
75
|
+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
|
|
76
|
+
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
|
|
77
|
+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
|
|
78
|
+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
|
|
79
|
+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
|
|
80
|
+
self.authentication_policy = kwargs.get("authentication_policy")
|
|
81
|
+
if self.credential and not self.authentication_policy:
|
|
82
|
+
self.authentication_policy = self._infer_policy(**kwargs)
|