Skip to content

Commit b6ad563

Browse files
authored
Regenerate azure-mgmt-managementpartner with latest code generator tool (#46943)
* Regenerate azure-mgmt-managementpartner with latest code generator tool * fix ci
1 parent 0ec6e94 commit b6ad563

51 files changed

Lines changed: 1484 additions & 1014 deletions

Some content is hidden

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

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

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

3+
## 1.0.1 (2026-05-18)
4+
5+
### Other Changes
6+
7+
- Regenerated with latest code generator tool
8+
39
## 1.1.0b1 (2022-11-01)
410

511
### Features Added
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
include _meta.json
2-
recursive-include tests *.py *.json
3-
recursive-include samples *.py *.md
41
include *.md
5-
include azure/__init__.py
6-
include azure/mgmt/__init__.py
72
include LICENSE
83
include azure/mgmt/managementpartner/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/mgmt/__init__.py
Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,57 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Management Partner Management Client Library.
4-
This package has been tested with Python 3.7+.
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_
88

99
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1010

11-
# Usage
11+
## Getting started
1212

13+
### Prerequisites
1314

14-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
17-
Code samples for this package can be found at [Management Partner Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
18-
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
15+
- Python 3.10+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1917

18+
### Install the package
2019

21-
# Provide Feedback
20+
```bash
21+
pip install azure-mgmt-managementpartner
22+
pip install azure-identity
23+
```
2224

23-
If you encounter any bugs or have suggestions, please file an issue in the
24-
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
25-
section of the project.
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
With above configuration, client can be authenticated by following code:
34+
35+
```python
36+
from azure.identity import DefaultAzureCredential
37+
from azure.mgmt.managementpartner import ACEProvisioningManagementPartnerAPI
38+
39+
client = ACEProvisioningManagementPartnerAPI(credential=DefaultAzureCredential())
40+
```
2641

42+
## Examples
2743

44+
Code samples for this package can be found at:
45+
- [Search Management Partner Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
46+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
2847

48+
49+
## Troubleshooting
50+
51+
## Next steps
52+
53+
## Provide Feedback
54+
55+
If you encounter any bugs or have suggestions, please file an issue in the
56+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
57+
section of the project.

sdk/managementpartner/azure-mgmt-managementpartner/_meta.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"commit": "736baa6d7d8bec3c6aaf1f16e77e78846eda4871",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.10.2",
5+
"use": [
6+
"@autorest/python@6.50.0",
7+
"@autorest/modelerfour@4.27.0"
8+
],
9+
"autorest_command": "autorest specification/managementpartner/resource-manager/Microsoft.ManagementPartner/ManagementPartner/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=C:\\dev\\azure-sdk-for-python\\sdk --tag=package-2018-02 --use=@autorest/python@6.50.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
10+
"readme": "specification/managementpartner/resource-manager/Microsoft.ManagementPartner/ManagementPartner/readme.md"
11+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"CrossLanguagePackageId": null,
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.managementpartner.models.Error": null,
5+
"azure.mgmt.managementpartner.models.ExtendedErrorInfo": null,
6+
"azure.mgmt.managementpartner.models.OperationDisplay": null,
7+
"azure.mgmt.managementpartner.models.OperationList": null,
8+
"azure.mgmt.managementpartner.models.OperationResponse": null,
9+
"azure.mgmt.managementpartner.models.PartnerResponse": null,
10+
"azure.mgmt.managementpartner.models.ManagementPartnerState": null,
11+
"azure.mgmt.managementpartner.operations.PartnerOperations.get": null,
12+
"azure.mgmt.managementpartner.aio.operations.PartnerOperations.get": null,
13+
"azure.mgmt.managementpartner.operations.PartnerOperations.create": null,
14+
"azure.mgmt.managementpartner.aio.operations.PartnerOperations.create": null,
15+
"azure.mgmt.managementpartner.operations.PartnerOperations.update": null,
16+
"azure.mgmt.managementpartner.aio.operations.PartnerOperations.update": null,
17+
"azure.mgmt.managementpartner.operations.PartnerOperations.delete": null,
18+
"azure.mgmt.managementpartner.aio.operations.PartnerOperations.delete": null,
19+
"azure.mgmt.managementpartner.operations.OperationOperations.list": null,
20+
"azure.mgmt.managementpartner.aio.operations.OperationOperations.list": null,
21+
"azure.mgmt.managementpartner.operations.PartnersOperations.get": null,
22+
"azure.mgmt.managementpartner.aio.operations.PartnersOperations.get": null
23+
}
24+
}
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/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/__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 ._ace_provisioning_management_partner_api import ACEProvisioningManagementPartnerAPI
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._ace_provisioning_management_partner_api import ACEProvisioningManagementPartnerAPI # 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 * # type: ignore # 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
"ACEProvisioningManagementPartnerAPI",
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/managementpartner/azure-mgmt-managementpartner/azure/mgmt/managementpartner/_ace_provisioning_management_partner_api.py

Lines changed: 55 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,27 @@
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

15-
from . import models
20+
from . import models as _models
1621
from ._configuration import ACEProvisioningManagementPartnerAPIConfiguration
17-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
1823
from .operations import OperationOperations, PartnerOperations, PartnersOperations
1924

2025
if TYPE_CHECKING:
21-
# pylint: disable=unused-import,ungrouped-imports
26+
from azure.core import AzureClouds
2227
from azure.core.credentials import TokenCredential
2328

2429

25-
class ACEProvisioningManagementPartnerAPI: # pylint: disable=client-accepts-api-version-keyword
30+
class ACEProvisioningManagementPartnerAPI:
2631
"""This API describe ACE Provisioning ManagementPartner.
2732
2833
:ivar partner: PartnerOperations operations
@@ -33,28 +38,62 @@ class ACEProvisioningManagementPartnerAPI: # pylint: disable=client-accepts-api
3338
:vartype partners: azure.mgmt.managementpartner.operations.PartnersOperations
3439
:param credential: Credential needed for the client to connect to Azure. Required.
3540
:type credential: ~azure.core.credentials.TokenCredential
36-
:param base_url: Service URL. Default value is "https://management.azure.com".
41+
:param base_url: Service URL. Default value is None.
3742
:type base_url: str
43+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
44+
None.
45+
:paramtype cloud_setting: ~azure.core.AzureClouds
3846
:keyword api_version: Api Version. Default value is "2018-02-01". Note that overriding this
3947
default value may result in unsupported behavior.
4048
:paramtype api_version: str
4149
"""
4250

4351
def __init__(
44-
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
52+
self,
53+
credential: "TokenCredential",
54+
base_url: Optional[str] = None,
55+
*,
56+
cloud_setting: Optional["AzureClouds"] = None,
57+
**kwargs: Any
4558
) -> None:
46-
self._config = ACEProvisioningManagementPartnerAPIConfiguration(credential=credential, **kwargs)
47-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
48-
49-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
59+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
60+
_endpoints = get_arm_endpoints(_cloud)
61+
if not base_url:
62+
base_url = _endpoints["resource_manager"]
63+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
64+
self._config = ACEProvisioningManagementPartnerAPIConfiguration(
65+
credential=credential, cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs
66+
)
67+
68+
_policies = kwargs.pop("policies", None)
69+
if _policies is None:
70+
_policies = [
71+
policies.RequestIdPolicy(**kwargs),
72+
self._config.headers_policy,
73+
self._config.user_agent_policy,
74+
self._config.proxy_policy,
75+
policies.ContentDecodePolicy(**kwargs),
76+
ARMAutoResourceProviderRegistrationPolicy(),
77+
self._config.redirect_policy,
78+
self._config.retry_policy,
79+
self._config.authentication_policy,
80+
self._config.custom_hook_policy,
81+
self._config.logging_policy,
82+
policies.DistributedTracingPolicy(**kwargs),
83+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
84+
self._config.http_logging_policy,
85+
]
86+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
87+
88+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
5089
self._serialize = Serializer(client_models)
5190
self._deserialize = Deserializer(client_models)
5291
self._serialize.client_side_validation = False
5392
self.partner = PartnerOperations(self._client, self._config, self._serialize, self._deserialize)
5493
self.operation = OperationOperations(self._client, self._config, self._serialize, self._deserialize)
5594
self.partners = PartnersOperations(self._client, self._config, self._serialize, self._deserialize)
5695

57-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
96+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
5897
"""Runs the network request through the client's chained policies.
5998
6099
>>> from azure.core.rest import HttpRequest
@@ -74,17 +113,14 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
74113

75114
request_copy = deepcopy(request)
76115
request_copy.url = self._client.format_url(request_copy.url)
77-
return self._client.send_request(request_copy, **kwargs)
116+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
78117

79-
def close(self):
80-
# type: () -> None
118+
def close(self) -> None:
81119
self._client.close()
82120

83-
def __enter__(self):
84-
# type: () -> ACEProvisioningManagementPartnerAPI
121+
def __enter__(self) -> Self:
85122
self._client.__enter__()
86123
return self
87124

88-
def __exit__(self, *exc_details):
89-
# type: (Any) -> None
125+
def __exit__(self, *exc_details: Any) -> None:
90126
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)