Skip to content

Commit 571f231

Browse files
[AutoRelease] t2-apimanagement-2024-03-19-08399(can only be merged by SDK owner) (#34827)
* code and test * Update CHANGELOG.md * Update CHANGELOG.md * Update _version.py --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 6cd9716 commit 571f231

File tree

639 files changed

+8736
-14633
lines changed

Some content is hidden

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

639 files changed

+8736
-14633
lines changed

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

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

3+
## 4.0.1 (2024-03-19)
4+
5+
### Other Changes
6+
- Regenerate samples
7+
38
## 4.0.0 (2023-04-20)
49

510
### Features Added

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

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

1818
### Install the package
@@ -59,6 +59,3 @@ Code samples for this package can be found at:
5959
If you encounter any bugs or have suggestions, please file an issue in the
6060
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6161
section of the project.
62-
63-
64-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-apimanagement%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "1198b4b73bed8c941a51acb037f1531166aa6728",
2+
"commit": "44d7a32482656b3a79a2fa11ac27c981f8e0e3cd",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.4.8",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.13.7",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/apimanagement/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.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/apimanagement/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 --tag=package-2022-08 --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/apimanagement/resource-manager/readme.md"
1111
}

sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_api_management_client.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12+
from azure.core.pipeline import policies
1213
from azure.core.rest import HttpRequest, HttpResponse
1314
from azure.mgmt.core import ARMPipelineClient
15+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1416

1517
from . import models as _models
1618
from ._configuration import ApiManagementClientConfiguration
@@ -337,7 +339,25 @@ def __init__(
337339
self._config = ApiManagementClientConfiguration(
338340
credential=credential, subscription_id=subscription_id, **kwargs
339341
)
340-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
342+
_policies = kwargs.pop("policies", None)
343+
if _policies is None:
344+
_policies = [
345+
policies.RequestIdPolicy(**kwargs),
346+
self._config.headers_policy,
347+
self._config.user_agent_policy,
348+
self._config.proxy_policy,
349+
policies.ContentDecodePolicy(**kwargs),
350+
ARMAutoResourceProviderRegistrationPolicy(),
351+
self._config.redirect_policy,
352+
self._config.retry_policy,
353+
self._config.authentication_policy,
354+
self._config.custom_hook_policy,
355+
self._config.logging_policy,
356+
policies.DistributedTracingPolicy(**kwargs),
357+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
358+
self._config.http_logging_policy,
359+
]
360+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
341361

342362
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
343363
self._serialize = Serializer(client_models)
@@ -496,7 +516,7 @@ def __init__(
496516
)
497517
self.documentation = DocumentationOperations(self._client, self._config, self._serialize, self._deserialize)
498518

499-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
519+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
500520
"""Runs the network request through the client's chained policies.
501521
502522
>>> from azure.core.rest import HttpRequest
@@ -516,7 +536,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
516536

517537
request_copy = deepcopy(request)
518538
request_copy.url = self._client.format_url(request_copy.url)
519-
return self._client.send_request(request_copy, **kwargs)
539+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
520540

521541
def close(self) -> None:
522542
self._client.close()

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
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

@@ -19,7 +18,7 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class ApiManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class ApiManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for ApiManagementClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -35,7 +34,6 @@ class ApiManagementClientConfiguration(Configuration): # pylint: disable=too-ma
3534
"""
3635

3736
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
super(ApiManagementClientConfiguration, self).__init__(**kwargs)
3937
api_version: str = kwargs.pop("api_version", "2022-08-01")
4038

4139
if credential is None:
@@ -48,6 +46,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4846
self.api_version = api_version
4947
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5048
kwargs.setdefault("sdk_moniker", "mgmt-apimanagement/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
5150
self._configure(**kwargs)
5251

5352
def _configure(self, **kwargs: Any) -> None:
@@ -56,9 +55,9 @@ def _configure(self, **kwargs: Any) -> None:
5655
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5756
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5857
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6058
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6159
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6261
self.authentication_policy = kwargs.get("authentication_policy")
6362
if self.credential and not self.authentication_policy:
6463
self.authentication_policy = ARMChallengeAuthenticationPolicy(

0 commit comments

Comments
 (0)