Skip to content

Commit b8682cf

Browse files
author
SDKAuto
committed
CodeGen from PR 34456 in Azure/azure-rest-api-specs
Merge 1ea5648a2870f0497bc26e8542e43bff94a6c974 into 4ba642bf36e93f15819c3c414e6a1c449f1979d6
1 parent c572fa7 commit b8682cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2813
-2316
lines changed

sdk/quantum/azure-mgmt-quantum/CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
# Release History
22

3+
## 1.0.0b6 (2025-05-06)
4+
5+
### Features Added
6+
7+
- Model `Operation` added property `origin`
8+
- Model `Operation` added property `action_type`
9+
- Model `WorkspaceResourceProperties` added property `managed_on_behalf_of_configuration`
10+
- Model `WorkspaceResourceProperties` added property `managed_storage_account`
11+
- Added enum `ActionType`
12+
- Added model `ApiKeys`
13+
- Added enum `CheckNameAvailabilityReason`
14+
- Added model `CheckNameAvailabilityRequest`
15+
- Added model `CheckNameAvailabilityResponse`
16+
- Added model `ManagedOnBehalfOfConfiguration`
17+
- Added model `ManagedServiceIdentity`
18+
- Added enum `ManagedServiceIdentityType`
19+
- Added model `MoboBrokerResource`
20+
- Added model `OperationListResult`
21+
- Added enum `Origin`
22+
- Added enum `ProviderStatus`
23+
- Added model `QuantumWorkspaceListResult`
24+
- Added model `QuantumWorkspaceTagsUpdate`
25+
- Added model `UserAssignedIdentity`
26+
- Added enum `WorkspaceProvisioningStatus`
27+
- Model `WorkspacesOperations` added method `check_name_availability`
28+
- Model `WorkspacesOperations` added method `list_keys`
29+
- Model `WorkspacesOperations` added method `regenerate_keys`
30+
- Method `WorkspacesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, workspace_name: str, resource: QuantumWorkspace, content_type: str)`
31+
- Method `WorkspacesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, workspace_name: str, resource: IO[bytes], content_type: str)`
32+
- Method `WorkspacesOperations.update_tags` has a new overload `def update_tags(self: None, resource_group_name: str, workspace_name: str, properties: QuantumWorkspaceTagsUpdate, content_type: str)`
33+
- Method `WorkspacesOperations.update_tags` has a new overload `def update_tags(self: None, resource_group_name: str, workspace_name: str, properties: IO[bytes], content_type: str)`
34+
- Method `WorkspacesOperations.check_name_availability` has a new overload `def check_name_availability(self: None, location: str, body: CheckNameAvailabilityRequest, content_type: str)`
35+
- Method `WorkspacesOperations.check_name_availability` has a new overload `def check_name_availability(self: None, location: str, body: IO[bytes], content_type: str)`
36+
- Method `WorkspacesOperations.regenerate_keys` has a new overload `def regenerate_keys(self: None, resource_group_name: str, workspace_name: str, body: ApiKeys, content_type: str)`
37+
- Method `WorkspacesOperations.regenerate_keys` has a new overload `def regenerate_keys(self: None, resource_group_name: str, workspace_name: str, body: IO[bytes], content_type: str)`
38+
39+
### Breaking Changes
40+
41+
- Deleted or renamed client operation group `AzureQuantumMgmtClient.workspace`
42+
- Method `OfferingsListResult.__init__` removed default value `None` from its parameter `value`
43+
- Deleted or renamed model `APIKeys`
44+
- Deleted or renamed model `CheckNameAvailabilityParameters`
45+
- Deleted or renamed model `CheckNameAvailabilityResult`
46+
- Deleted or renamed model `OperationsList`
47+
- Deleted or renamed model `ProvisioningStatus`
48+
- Deleted or renamed model `QuantumWorkspaceIdentity`
49+
- Deleted or renamed model `ResourceIdentityType`
50+
- Deleted or renamed model `Status`
51+
- Deleted or renamed model `TagsObject`
52+
- Method `WorkspacesOperations.begin_create_or_update` inserted a `positional_or_keyword` parameter `resource`
53+
- Method `WorkspacesOperations.begin_create_or_update` deleted or renamed its parameter `quantum_workspace` of kind `positional_or_keyword`
54+
- Method `WorkspacesOperations.update_tags` inserted a `positional_or_keyword` parameter `properties`
55+
- Method `WorkspacesOperations.update_tags` deleted or renamed its parameter `workspace_tags` of kind `positional_or_keyword`
56+
- Deleted or renamed model `WorkspaceOperations`
57+
- Method `WorkspacesOperations.update_tags` re-ordered its parameters from `['self', 'resource_group_name', 'workspace_name', 'workspace_tags', 'kwargs']` to `['self', 'resource_group_name', 'workspace_name', 'properties', 'kwargs']`
58+
- Method `WorkspacesOperations.begin_create_or_update` re-ordered its parameters from `['self', 'resource_group_name', 'workspace_name', 'quantum_workspace', 'kwargs']` to `['self', 'resource_group_name', 'workspace_name', 'resource', 'kwargs']`
59+
360
## 1.0.0b5 (2024-03-18)
461

562
### Features Added

sdk/quantum/azure-mgmt-quantum/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Quantum Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "90fc96af52257944371b95428245bce0f218c7f5",
2+
"commit": "908a1ce4e7520f2482114e22dfbb0664806d0d26",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.7.1",
7-
"@autorest/modelerfour@4.26.2"
6+
"@autorest/python@6.34.1",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/quantum/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/quantum/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.34.1 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/quantum/resource-manager/readme.md"
1111
}

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._azure_quantum_mgmt_client import AzureQuantumMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._azure_quantum_mgmt_client import AzureQuantumMgmtClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"AzureQuantumMgmtClient",
2329
]
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
2531

2632
_patch_sdk()

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/_azure_quantum_mgmt_client.py

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,88 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1316
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1419

1520
from . import models as _models
1621
from ._configuration import AzureQuantumMgmtClientConfiguration
17-
from ._serialization import Deserializer, Serializer
18-
from .operations import OfferingsOperations, Operations, WorkspaceOperations, WorkspacesOperations
22+
from ._utils.serialization import Deserializer, Serializer
23+
from .operations import OfferingsOperations, Operations, WorkspacesOperations
1924

2025
if TYPE_CHECKING:
21-
# pylint: disable=unused-import,ungrouped-imports
2226
from azure.core.credentials import TokenCredential
2327

2428

25-
class AzureQuantumMgmtClient: # pylint: disable=client-accepts-api-version-keyword
26-
"""AzureQuantumMgmtClient.
29+
class AzureQuantumMgmtClient:
30+
"""Microsoft.Quantum Resource Provider Management API.
2731
32+
:ivar operations: Operations operations
33+
:vartype operations: azure.mgmt.quantum.operations.Operations
2834
:ivar workspaces: WorkspacesOperations operations
2935
:vartype workspaces: azure.mgmt.quantum.operations.WorkspacesOperations
3036
:ivar offerings: OfferingsOperations operations
3137
:vartype offerings: azure.mgmt.quantum.operations.OfferingsOperations
32-
:ivar operations: Operations operations
33-
:vartype operations: azure.mgmt.quantum.operations.Operations
34-
:ivar workspace: WorkspaceOperations operations
35-
:vartype workspace: azure.mgmt.quantum.operations.WorkspaceOperations
3638
:param credential: Credential needed for the client to connect to Azure. Required.
3739
:type credential: ~azure.core.credentials.TokenCredential
3840
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3941
:type subscription_id: str
40-
:param base_url: Service URL. Default value is "https://management.azure.com".
42+
:param base_url: Service URL. Default value is None.
4143
:type base_url: str
42-
:keyword api_version: Api Version. Default value is "2023-11-13-preview". Note that overriding
44+
:keyword api_version: Api Version. Default value is "2025-01-01-preview". Note that overriding
4345
this default value may result in unsupported behavior.
4446
:paramtype api_version: str
4547
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4648
Retry-After header is present.
4749
"""
4850

4951
def __init__(
50-
self,
51-
credential: "TokenCredential",
52-
subscription_id: str,
53-
base_url: str = "https://management.azure.com",
54-
**kwargs: Any
52+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
5553
) -> None:
54+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
55+
_endpoints = get_arm_endpoints(_cloud)
56+
if not base_url:
57+
base_url = _endpoints["resource_manager"]
58+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
5659
self._config = AzureQuantumMgmtClientConfiguration(
57-
credential=credential, subscription_id=subscription_id, **kwargs
60+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
5861
)
59-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
62+
63+
_policies = kwargs.pop("policies", None)
64+
if _policies is None:
65+
_policies = [
66+
policies.RequestIdPolicy(**kwargs),
67+
self._config.headers_policy,
68+
self._config.user_agent_policy,
69+
self._config.proxy_policy,
70+
policies.ContentDecodePolicy(**kwargs),
71+
ARMAutoResourceProviderRegistrationPolicy(),
72+
self._config.redirect_policy,
73+
self._config.retry_policy,
74+
self._config.authentication_policy,
75+
self._config.custom_hook_policy,
76+
self._config.logging_policy,
77+
policies.DistributedTracingPolicy(**kwargs),
78+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
79+
self._config.http_logging_policy,
80+
]
81+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
6082

6183
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
6284
self._serialize = Serializer(client_models)
6385
self._deserialize = Deserializer(client_models)
6486
self._serialize.client_side_validation = False
87+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
6588
self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize)
6689
self.offerings = OfferingsOperations(self._client, self._config, self._serialize, self._deserialize)
67-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
68-
self.workspace = WorkspaceOperations(self._client, self._config, self._serialize, self._deserialize)
6990

70-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
91+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
7192
"""Runs the network request through the client's chained policies.
7293
7394
>>> from azure.core.rest import HttpRequest
@@ -87,12 +108,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
87108

88109
request_copy = deepcopy(request)
89110
request_copy.url = self._client.format_url(request_copy.url)
90-
return self._client.send_request(request_copy, **kwargs)
111+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
91112

92113
def close(self) -> None:
93114
self._client.close()
94115

95-
def __enter__(self) -> "AzureQuantumMgmtClient":
116+
def __enter__(self) -> Self:
96117
self._client.__enter__()
97118
return self
98119

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/_configuration.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

1514
from ._version import VERSION
1615

1716
if TYPE_CHECKING:
18-
# pylint: disable=unused-import,ungrouped-imports
1917
from azure.core.credentials import TokenCredential
2018

2119

22-
class AzureQuantumMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
20+
class AzureQuantumMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
2321
"""Configuration for AzureQuantumMgmtClient.
2422
2523
Note that all parameters used to create this instance are saved as instance
@@ -29,14 +27,13 @@ class AzureQuantumMgmtClientConfiguration(Configuration): # pylint: disable=too
2927
:type credential: ~azure.core.credentials.TokenCredential
3028
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3129
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-11-13-preview". Note that overriding
30+
:keyword api_version: Api Version. Default value is "2025-01-01-preview". Note that overriding
3331
this default value may result in unsupported behavior.
3432
:paramtype api_version: str
3533
"""
3634

3735
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
super(AzureQuantumMgmtClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-11-13-preview")
36+
api_version: str = kwargs.pop("api_version", "2025-01-01-preview")
4037

4138
if credential is None:
4239
raise ValueError("Parameter 'credential' must not be None.")
@@ -48,6 +45,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4845
self.api_version = api_version
4946
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5047
kwargs.setdefault("sdk_moniker", "mgmt-quantum/{}".format(VERSION))
48+
self.polling_interval = kwargs.get("polling_interval", 30)
5149
self._configure(**kwargs)
5250

5351
def _configure(self, **kwargs: Any) -> None:
@@ -56,9 +54,9 @@ def _configure(self, **kwargs: Any) -> None:
5654
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5755
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5856
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6057
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6158
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
59+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6260
self.authentication_policy = kwargs.get("authentication_policy")
6361
if self.credential and not self.authentication_policy:
6462
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/_vendor.py renamed to sdk/quantum/azure-mgmt-quantum/azure/mgmt/quantum/_utils/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,3 @@
44
# Code generated by Microsoft (R) AutoRest Code Generator.
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
7-
8-
from azure.core.pipeline.transport import HttpRequest
9-
10-
11-
def _convert_request(request, files=None):
12-
data = request.content if not files else None
13-
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
14-
if files:
15-
request.set_formdata_body(files)
16-
return request

0 commit comments

Comments
 (0)