Skip to content

Commit b0873ba

Browse files
azure-sdkChenxiJiang333msyycCopilot
authored
[AutoPR azure-mgmt-resource-deployments]-generated-from-SDK Generation - Python-6331830 (#47044)
* Configurations: 'specification/resources/resource-manager/Microsoft.Resources/deployments/tspconfig.yaml', API Version: 2025-04-01, SDK Release Type: beta, and CommitSHA: 'f34830624e2040e4777496c73aa7c6fe764f4bfc' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6331830 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * update * Optimize changelog: consolidate unused models Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Chenxi Jiang (WICRESOFT NORTH AMERICA LTD) <v-chenjiang@microsoft.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5ebaa13 commit b0873ba

61 files changed

Lines changed: 12062 additions & 8756 deletions

File tree

Some content is hidden

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

sdk/resources/azure-mgmt-resource-deployments/CHANGELOG.md

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

3+
## 1.0.0b2 (2026-05-21)
4+
5+
### Features Added
6+
7+
- Client `DeploymentsMgmtClient` added parameter `cloud_setting` in method `__init__`
8+
- Client `DeploymentsMgmtClient` added method `send_request`
9+
- Model `DeploymentExtended` added property `system_data`
10+
- Added model `CloudError`
11+
- Added enum `CreatedByType`
12+
- Added model `ExtensionResource`
13+
- Added model `Resource`
14+
- Added model `SystemData`
15+
16+
### Breaking Changes
17+
18+
- 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.
19+
- Model `WhatIfOperationResult` moved instance variable `changes`, `potential_changes` and `diagnostics` under property `properties` whose type is `WhatIfOperationProperties`
20+
21+
### Other Changes
22+
23+
- Deleted model `DeploymentExtendedFilter`/`ResourceProviderOperationDisplayProperties`/`SubResource` which actually were not used by SDK users
24+
325
## 1.0.0b1 (2025-06-20)
426

527
### Other Changes
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
recursive-include tests *.py *.json
2-
recursive-include samples *.py *.md
31
include *.md
2+
include LICENSE
3+
include azure/mgmt/resource/deployments/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
46
include azure/__init__.py
57
include azure/mgmt/__init__.py
68
include azure/mgmt/resource/__init__.py
7-
include LICENSE
8-
include azure/mgmt/resource/deployments/py.typed

sdk/resources/azure-mgmt-resource-deployments/README.md

Lines changed: 2 additions & 2 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 Resource Deployments Management Client Library.
4-
This package has been tested with Python 3.9+.
4+
This package has been tested with Python 3.10+.
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.9+ is required to use this package.
15+
- Python 3.10+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2-
"commit": "8338afaf221a4ca1cc2a134cdc38952bdd5c7245",
2+
"apiVersion": "2025-04-01",
3+
"apiVersions": {
4+
"Microsoft.Resources": "2025-04-01"
5+
},
6+
"commit": "f34830624e2040e4777496c73aa7c6fe764f4bfc",
37
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/python@6.35.0",
7-
"@autorest/modelerfour@4.27.0"
8-
],
9-
"autorest_command": "autorest specification/resources/resource-manager/Microsoft.Resources/deployments/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.35.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/resources/resource-manager/Microsoft.Resources/deployments/readme.md"
8+
"typespec_src": "specification/resources/resource-manager/Microsoft.Resources/deployments",
9+
"emitterVersion": "0.62.1"
1110
}

sdk/resources/azure-mgmt-resource-deployments/apiview-properties.json

Lines changed: 189 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

sdk/resources/azure-mgmt-resource-deployments/azure/mgmt/resource/deployments/__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 ._deployments_mgmt_client import DeploymentsMgmtClient # type: ignore
15+
from ._client import DeploymentsMgmtClient # type: ignore
1616
from ._version import VERSION
1717

1818
__version__ = VERSION

sdk/resources/azure-mgmt-resource-deployments/azure/mgmt/resource/deployments/_deployments_mgmt_client.py renamed to sdk/resources/azure-mgmt-resource-deployments/azure/mgmt/resource/deployments/_client.py

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
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

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

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
@@ -17,46 +17,67 @@
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 DeploymentsMgmtClientConfiguration
2221
from ._utils.serialization import Deserializer, Serializer
2322
from .operations import DeploymentOperationsOperations, DeploymentsOperations
2423

24+
if sys.version_info >= (3, 11):
25+
from typing import Self
26+
else:
27+
from typing_extensions import Self # type: ignore
28+
2529
if TYPE_CHECKING:
30+
from azure.core import AzureClouds
2631
from azure.core.credentials import TokenCredential
2732

2833

2934
class DeploymentsMgmtClient:
30-
"""Deployments Client.
35+
"""Provides operations for working with deployments.
3136
3237
:ivar deployments: DeploymentsOperations operations
3338
:vartype deployments: azure.mgmt.resource.deployments.operations.DeploymentsOperations
3439
:ivar deployment_operations: DeploymentOperationsOperations operations
3540
:vartype deployment_operations:
3641
azure.mgmt.resource.deployments.operations.DeploymentOperationsOperations
37-
:param credential: Credential needed for the client to connect to Azure. Required.
42+
:param credential: Credential used to authenticate requests to the service. Required.
3843
:type credential: ~azure.core.credentials.TokenCredential
39-
:param subscription_id: The Microsoft Azure subscription ID. Required.
44+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4045
:type subscription_id: str
41-
:param base_url: Service URL. Default value is None.
46+
:param base_url: Service host. Default value is None.
4247
:type base_url: str
43-
:keyword api_version: Api Version. Default value is "2025-04-01". Note that overriding this
44-
default value may result in unsupported behavior.
48+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
49+
None.
50+
:paramtype cloud_setting: ~azure.core.AzureClouds
51+
:keyword api_version: The API version to use for this operation. Known values are "2025-04-01"
52+
and None. Default value is None. If not set, the operation's default API version will be used.
53+
Note that overriding this default value may result in unsupported behavior.
4554
:paramtype api_version: str
4655
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4756
Retry-After header is present.
4857
"""
4958

5059
def __init__(
51-
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
60+
self,
61+
credential: "TokenCredential",
62+
subscription_id: str,
63+
base_url: Optional[str] = None,
64+
*,
65+
cloud_setting: Optional["AzureClouds"] = None,
66+
**kwargs: Any
5267
) -> None:
53-
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
68+
_endpoint = "{endpoint}"
69+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
5470
_endpoints = get_arm_endpoints(_cloud)
5571
if not base_url:
5672
base_url = _endpoints["resource_manager"]
5773
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
5874
self._config = DeploymentsMgmtClientConfiguration(
59-
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
75+
credential=credential,
76+
subscription_id=subscription_id,
77+
base_url=cast(str, base_url),
78+
cloud_setting=cloud_setting,
79+
credential_scopes=credential_scopes,
80+
**kwargs
6081
)
6182

6283
_policies = kwargs.pop("policies", None)
@@ -77,24 +98,23 @@ def __init__(
7798
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
7899
self._config.http_logging_policy,
79100
]
80-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
101+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
81102

82-
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
83-
self._serialize = Serializer(client_models)
84-
self._deserialize = Deserializer(client_models)
103+
self._serialize = Serializer()
104+
self._deserialize = Deserializer()
85105
self._serialize.client_side_validation = False
86106
self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize)
87107
self.deployment_operations = DeploymentOperationsOperations(
88108
self._client, self._config, self._serialize, self._deserialize
89109
)
90110

91-
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
111+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
92112
"""Runs the network request through the client's chained policies.
93113
94114
>>> from azure.core.rest import HttpRequest
95115
>>> request = HttpRequest("GET", "https://www.example.org/")
96116
<HttpRequest [GET], url: 'https://www.example.org/'>
97-
>>> response = client._send_request(request)
117+
>>> response = client.send_request(request)
98118
<HttpResponse: 200 OK>
99119
100120
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -107,7 +127,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
107127
"""
108128

109129
request_copy = deepcopy(request)
110-
request_copy.url = self._client.format_url(request_copy.url)
130+
path_format_arguments = {
131+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
132+
}
133+
134+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
111135
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
112136

113137
def close(self) -> None:

0 commit comments

Comments
 (0)