Skip to content

Commit 30c6d22

Browse files
azure-sdkmsyycChenxiJiang333iscai-msftiscai-msft
authored
[AutoPR azure-mgmt-keyvault]-generated-from-SDK Generation - Python-5479988 (#43559)
* Configurations: 'specification/keyvault/KeyVault.Management/tspconfig.yaml', API Version: 2025-05-01, SDK Release Type: stable, and CommitSHA: '0476e10d463909ce48ba4a8365d971586ede7f98' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5479988 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * update changelog * update changelog * add customized code with easy way * update testcases * update * customize * update test case for customization * remove outdated test * update test case for customization * update testcases * Configurations: 'specification/keyvault/KeyVault.Management/tspconfig.yaml', API Version: 2025-05-01, SDK Release Type: stable, and CommitSHA: '08a510e768ebd24b415dd642416cf955b70c4069' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5511433 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * add customized code back after regeneration * Update CHANGELOG.md * regeneration * customize * add tests and fix backcompat functions * add changelog * lint and run black * run black * add get_old_attribute * add test case * update test case * update test case * update * switch to get_backcompat_attr_name * fix ci * format * regeneration * Configurations: 'specification/keyvault/KeyVault.Management/tspconfig.yaml', API Version: 2025-05-01, SDK Release Type: stable, and CommitSHA: 'cd9e490ce205294e81539af5b5d8dfa4da1d5240' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5655092 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Update CHANGELOG.md * Configurations: 'specification/keyvault/KeyVault.Management/tspconfig.yaml', API Version: 2025-05-01, SDK Release Type: stable, and CommitSHA: '74db5e79837425a7723e81bca0b7576ab725c186' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5658478 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * update patch and changelog * Update CHANGELOG.md --------- Co-authored-by: Yuchao Yan <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: iscai-msft <[email protected]> Co-authored-by: iscai-msft <[email protected]>
1 parent 5662910 commit 30c6d22

File tree

128 files changed

+19538
-17767
lines changed

Some content is hidden

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

128 files changed

+19538
-17767
lines changed

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

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

3+
## 13.0.0 (2025-12-11)
4+
5+
### Features Added
6+
7+
- Client `KeyVaultManagementClient` added method `send_request`
8+
- Model `DeletedManagedHsm` added property `system_data`
9+
- Model `DeletedVault` added property `system_data`
10+
- Model `Key` added property `properties`
11+
- Model `Key` added property `system_data`
12+
- Model `MHSMPrivateEndpointConnectionItem` added property `properties`
13+
- Model `ManagedHsmKey` added property `properties`
14+
- Model `ManagedHsmKey` added property `system_data`
15+
- Model `Operation` added property `operation_properties`
16+
- Model `Permissions` added property `keys_property`
17+
- Model `PrivateEndpointConnection` added property `system_data`
18+
- Model `PrivateEndpointConnectionItem` added property `properties`
19+
- Model `PrivateLinkResource` added property `system_data`
20+
- Model `Resource` added property `system_data`
21+
- Model `Secret` added property `system_data`
22+
- Model `VaultCheckNameAvailabilityParameters` added property `type`
23+
- Added model `CloudError`
24+
- Added model `OperationProperties`
25+
- Added model `TrackedResource`
26+
27+
### Breaking Changes
28+
29+
- This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration.
30+
- Model `Key` moved instance variable `attributes`, `kty`, `key_ops`, `key_size`, `curve_name`, `key_uri`, `key_uri_with_version`, `rotation_policy` and `release_policy` under property `properties`
31+
- Model `MHSMPrivateEndpointConnectionItem` moved instance variable `private_endpoint`, `private_link_service_connection_state` and `provisioning_state` under property `properties`
32+
- Model `ManagedHsmKey` moved instance variable `attributes`, `kty`, `key_ops`, `key_size`, `curve_name`, `key_uri`, `key_uri_with_version`, `rotation_policy` and `release_policy` under property `properties`
33+
- Model `Operation` moved instance variable `service_specification` under property `operation_properties`
34+
- Model `PrivateEndpointConnectionItem` moved instance variable `private_endpoint`, `private_link_service_connection_state` and `provisioning_state` under property `properties`
35+
- Model `Permissions` renamed its instance variable `keys` to `keys_property`
36+
- Model `Resource` deleted or renamed its instance variable `location`
37+
- Model `Resource` deleted or renamed its instance variable `tags`
38+
- Renamed model `ProxyResourceWithoutSystemData` to `ProxyResource`
39+
340
## 12.1.1 (2025-10-09)
441

542
### Bugs Fixed
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
2-
"commit": "520e1f6bc250b4ce51a22eaa7583cc0b24564b71",
2+
"apiVersion": "2025-05-01",
3+
"commit": "74db5e79837425a7723e81bca0b7576ab725c186",
34
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/keyvault/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/keyvault/resource-manager/readme.md"
5+
"typespec_src": "specification/keyvault/KeyVault.Management",
6+
"emitterVersion": "0.55.0"
117
}

sdk/keyvault/azure-mgmt-keyvault/apiview-properties.json

Lines changed: 216 additions & 221 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88
# pylint: disable=wrong-import-position
@@ -12,7 +12,7 @@
1212
if TYPE_CHECKING:
1313
from ._patch import * # pylint: disable=unused-wildcard-import
1414

15-
from ._key_vault_management_client import KeyVaultManagementClient # type: ignore
15+
from ._client import KeyVaultManagementClient # type: ignore
1616
from ._version import VERSION
1717

1818
__version__ = VERSION

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/_key_vault_management_client.py renamed to sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/_client.py

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

@@ -17,7 +17,6 @@
1717
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1818
from azure.mgmt.core.tools import get_arm_endpoints
1919

20-
from . import models as _models
2120
from ._configuration import KeyVaultManagementClientConfiguration
2221
from ._utils.serialization import Deserializer, Serializer
2322
from .operations import (
@@ -43,43 +42,42 @@ class KeyVaultManagementClient: # pylint: disable=too-many-instance-attributes
4342
"""The Azure management API provides a RESTful set of web services that interact with Azure Key
4443
Vault.
4544
46-
:ivar keys: KeysOperations operations
47-
:vartype keys: azure.mgmt.keyvault.operations.KeysOperations
48-
:ivar managed_hsm_keys: ManagedHsmKeysOperations operations
49-
:vartype managed_hsm_keys: azure.mgmt.keyvault.operations.ManagedHsmKeysOperations
45+
:ivar operations: Operations operations
46+
:vartype operations: azure.mgmt.keyvault.operations.Operations
5047
:ivar vaults: VaultsOperations operations
5148
:vartype vaults: azure.mgmt.keyvault.operations.VaultsOperations
5249
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
5350
:vartype private_endpoint_connections:
5451
azure.mgmt.keyvault.operations.PrivateEndpointConnectionsOperations
55-
:ivar private_link_resources: PrivateLinkResourcesOperations operations
56-
:vartype private_link_resources: azure.mgmt.keyvault.operations.PrivateLinkResourcesOperations
5752
:ivar managed_hsms: ManagedHsmsOperations operations
5853
:vartype managed_hsms: azure.mgmt.keyvault.operations.ManagedHsmsOperations
59-
:ivar mhsm_private_endpoint_connections: MHSMPrivateEndpointConnectionsOperations operations
60-
:vartype mhsm_private_endpoint_connections:
61-
azure.mgmt.keyvault.operations.MHSMPrivateEndpointConnectionsOperations
54+
:ivar secrets: SecretsOperations operations
55+
:vartype secrets: azure.mgmt.keyvault.operations.SecretsOperations
56+
:ivar keys: KeysOperations operations
57+
:vartype keys: azure.mgmt.keyvault.operations.KeysOperations
58+
:ivar managed_hsm_keys: ManagedHsmKeysOperations operations
59+
:vartype managed_hsm_keys: azure.mgmt.keyvault.operations.ManagedHsmKeysOperations
60+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
61+
:vartype private_link_resources: azure.mgmt.keyvault.operations.PrivateLinkResourcesOperations
6262
:ivar mhsm_private_link_resources: MHSMPrivateLinkResourcesOperations operations
6363
:vartype mhsm_private_link_resources:
6464
azure.mgmt.keyvault.operations.MHSMPrivateLinkResourcesOperations
6565
:ivar mhsm_regions: MHSMRegionsOperations operations
6666
:vartype mhsm_regions: azure.mgmt.keyvault.operations.MHSMRegionsOperations
67-
:ivar operations: Operations operations
68-
:vartype operations: azure.mgmt.keyvault.operations.Operations
69-
:ivar secrets: SecretsOperations operations
70-
:vartype secrets: azure.mgmt.keyvault.operations.SecretsOperations
71-
:param credential: Credential needed for the client to connect to Azure. Required.
67+
:ivar mhsm_private_endpoint_connections: MHSMPrivateEndpointConnectionsOperations operations
68+
:vartype mhsm_private_endpoint_connections:
69+
azure.mgmt.keyvault.operations.MHSMPrivateEndpointConnectionsOperations
70+
:param credential: Credential used to authenticate requests to the service. Required.
7271
:type credential: ~azure.core.credentials.TokenCredential
73-
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
74-
subscription. The subscription ID forms part of the URI for every service call. Required.
72+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
7573
:type subscription_id: str
76-
:param base_url: Service URL. Default value is None.
74+
:param base_url: Service host. Default value is None.
7775
:type base_url: str
7876
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
7977
None.
8078
:paramtype cloud_setting: ~azure.core.AzureClouds
81-
:keyword api_version: Api Version. Default value is "2025-05-01". Note that overriding this
82-
default value may result in unsupported behavior.
79+
:keyword api_version: The API version to use for this operation. Default value is "2025-05-01".
80+
Note that overriding this default value may result in unsupported behavior.
8381
:paramtype api_version: str
8482
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
8583
Retry-After header is present.
@@ -94,6 +92,7 @@ def __init__(
9492
cloud_setting: Optional["AzureClouds"] = None,
9593
**kwargs: Any
9694
) -> None:
95+
_endpoint = "{endpoint}"
9796
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
9897
_endpoints = get_arm_endpoints(_cloud)
9998
if not base_url:
@@ -102,6 +101,7 @@ def __init__(
102101
self._config = KeyVaultManagementClientConfiguration(
103102
credential=credential,
104103
subscription_id=subscription_id,
104+
base_url=cast(str, base_url),
105105
cloud_setting=cloud_setting,
106106
credential_scopes=credential_scopes,
107107
**kwargs
@@ -125,39 +125,38 @@ def __init__(
125125
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
126126
self._config.http_logging_policy,
127127
]
128-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
128+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
129129

130-
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
131-
self._serialize = Serializer(client_models)
132-
self._deserialize = Deserializer(client_models)
130+
self._serialize = Serializer()
131+
self._deserialize = Deserializer()
133132
self._serialize.client_side_validation = False
134-
self.keys = KeysOperations(self._client, self._config, self._serialize, self._deserialize)
135-
self.managed_hsm_keys = ManagedHsmKeysOperations(self._client, self._config, self._serialize, self._deserialize)
133+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
136134
self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize)
137135
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
138136
self._client, self._config, self._serialize, self._deserialize
139137
)
140-
self.private_link_resources = PrivateLinkResourcesOperations(
141-
self._client, self._config, self._serialize, self._deserialize
142-
)
143138
self.managed_hsms = ManagedHsmsOperations(self._client, self._config, self._serialize, self._deserialize)
144-
self.mhsm_private_endpoint_connections = MHSMPrivateEndpointConnectionsOperations(
139+
self.secrets = SecretsOperations(self._client, self._config, self._serialize, self._deserialize)
140+
self.keys = KeysOperations(self._client, self._config, self._serialize, self._deserialize)
141+
self.managed_hsm_keys = ManagedHsmKeysOperations(self._client, self._config, self._serialize, self._deserialize)
142+
self.private_link_resources = PrivateLinkResourcesOperations(
145143
self._client, self._config, self._serialize, self._deserialize
146144
)
147145
self.mhsm_private_link_resources = MHSMPrivateLinkResourcesOperations(
148146
self._client, self._config, self._serialize, self._deserialize
149147
)
150148
self.mhsm_regions = MHSMRegionsOperations(self._client, self._config, self._serialize, self._deserialize)
151-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
152-
self.secrets = SecretsOperations(self._client, self._config, self._serialize, self._deserialize)
149+
self.mhsm_private_endpoint_connections = MHSMPrivateEndpointConnectionsOperations(
150+
self._client, self._config, self._serialize, self._deserialize
151+
)
153152

154-
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
153+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
155154
"""Runs the network request through the client's chained policies.
156155
157156
>>> from azure.core.rest import HttpRequest
158157
>>> request = HttpRequest("GET", "https://www.example.org/")
159158
<HttpRequest [GET], url: 'https://www.example.org/'>
160-
>>> response = client._send_request(request)
159+
>>> response = client.send_request(request)
161160
<HttpResponse: 200 OK>
162161
163162
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -170,7 +169,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
170169
"""
171170

172171
request_copy = deepcopy(request)
173-
request_copy.url = self._client.format_url(request_copy.url)
172+
path_format_arguments = {
173+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
174+
}
175+
176+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
174177
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
175178

176179
def close(self) -> None:

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

@@ -24,23 +24,25 @@ class KeyVaultManagementClientConfiguration: # pylint: disable=too-many-instanc
2424
Note that all parameters used to create this instance are saved as instance
2525
attributes.
2626
27-
:param credential: Credential needed for the client to connect to Azure. Required.
27+
:param credential: Credential used to authenticate requests to the service. Required.
2828
:type credential: ~azure.core.credentials.TokenCredential
29-
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
30-
subscription. The subscription ID forms part of the URI for every service call. Required.
29+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3130
:type subscription_id: str
31+
:param base_url: Service host. Default value is "https://management.azure.com".
32+
:type base_url: str
3233
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
3334
None.
3435
:type cloud_setting: ~azure.core.AzureClouds
35-
:keyword api_version: Api Version. Default value is "2025-05-01". Note that overriding this
36-
default value may result in unsupported behavior.
36+
:keyword api_version: The API version to use for this operation. Default value is "2025-05-01".
37+
Note that overriding this default value may result in unsupported behavior.
3738
:paramtype api_version: str
3839
"""
3940

4041
def __init__(
4142
self,
4243
credential: "TokenCredential",
4344
subscription_id: str,
45+
base_url: str = "https://management.azure.com",
4446
cloud_setting: Optional["AzureClouds"] = None,
4547
**kwargs: Any
4648
) -> None:
@@ -53,6 +55,7 @@ def __init__(
5355

5456
self.credential = credential
5557
self.subscription_id = subscription_id
58+
self.base_url = base_url
5659
self.cloud_setting = cloud_setting
5760
self.api_version = api_version
5861
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/_patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
88
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
99
"""
10-
from typing import List
1110

12-
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
11+
12+
__all__: list[str] = [] # Add all objects you want publicly available to users at this package level
1313

1414

1515
def patch_sdk():
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# Code generated by Microsoft (R) AutoRest Code Generator.
4+
# Code generated by Microsoft (R) Python Code Generator.
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)