Skip to content

Commit dffd260

Browse files
azure-sdkmsyycChenxiJiang333
authored
[AutoRelease] t2-search-2024-06-05-87019(can only be merged by SDK owner) (#35922)
* code and test * Update CHANGELOG.md * Update _version.py * Update assets.json * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent e576ac2 commit dffd260

File tree

76 files changed

+1001
-1287
lines changed

Some content is hidden

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

76 files changed

+1001
-1287
lines changed

sdk/search/azure-mgmt-search/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+
## 9.2.0b2 (2024-07-18)
4+
5+
### Other Changes
6+
7+
- Regular release
8+
39
## 9.2.0b1 (2024-03-18)
410

511
### Features Added
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "77df3b1680a95566a3e6a3a2cd07c9a4960b2af3",
2+
"commit": "32f566eb38af9593cfc1ed183362471c50d67fb2",
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.13.16",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/search/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/search/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.13.16 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/search/resource-manager/readme.md"
1111
}

sdk/search/azure-mgmt-search/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/search/azure-mgmt-search",
5-
"Tag": "python/search/azure-mgmt-search_c9d8ad9153"
5+
"Tag": "python/search/azure-mgmt-search_d8e3361fc9"
66
}

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

Lines changed: 5 additions & 6 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 SearchManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class SearchManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for SearchManagementClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -30,14 +29,13 @@ class SearchManagementClientConfiguration(Configuration): # pylint: disable=too
3029
:param subscription_id: The unique identifier for a Microsoft Azure subscription. You can
3130
obtain this value from the Azure Resource Manager API or the portal. Required.
3231
:type subscription_id: str
33-
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
32+
:keyword api_version: Api Version. Default value is "2024-06-01-preview". Note that overriding
3433
this default value may result in unsupported behavior.
3534
:paramtype api_version: str
3635
"""
3736

3837
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
39-
super(SearchManagementClientConfiguration, self).__init__(**kwargs)
40-
api_version: str = kwargs.pop("api_version", "2024-03-01-preview")
38+
api_version: str = kwargs.pop("api_version", "2024-06-01-preview")
4139

4240
if credential is None:
4341
raise ValueError("Parameter 'credential' must not be None.")
@@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4947
self.api_version = api_version
5048
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5149
kwargs.setdefault("sdk_moniker", "mgmt-search/{}".format(VERSION))
50+
self.polling_interval = kwargs.get("polling_interval", 30)
5251
self._configure(**kwargs)
5352

5453
def _configure(self, **kwargs: Any) -> None:
@@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None:
5756
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5857
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5958
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
60-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6159
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6260
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
61+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6362
self.authentication_policy = kwargs.get("authentication_policy")
6463
if self.credential and not self.authentication_policy:
6564
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/search/azure-mgmt-search/azure/mgmt/search/_search_management_client.py

Lines changed: 24 additions & 4 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 SearchManagementClientConfiguration
@@ -67,7 +69,7 @@ class SearchManagementClient(
6769
:type subscription_id: str
6870
:param base_url: Service URL. Default value is "https://management.azure.com".
6971
:type base_url: str
70-
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
72+
:keyword api_version: Api Version. Default value is "2024-06-01-preview". Note that overriding
7173
this default value may result in unsupported behavior.
7274
:paramtype api_version: str
7375
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -84,7 +86,25 @@ def __init__(
8486
self._config = SearchManagementClientConfiguration(
8587
credential=credential, subscription_id=subscription_id, **kwargs
8688
)
87-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
89+
_policies = kwargs.pop("policies", None)
90+
if _policies is None:
91+
_policies = [
92+
policies.RequestIdPolicy(**kwargs),
93+
self._config.headers_policy,
94+
self._config.user_agent_policy,
95+
self._config.proxy_policy,
96+
policies.ContentDecodePolicy(**kwargs),
97+
ARMAutoResourceProviderRegistrationPolicy(),
98+
self._config.redirect_policy,
99+
self._config.retry_policy,
100+
self._config.authentication_policy,
101+
self._config.custom_hook_policy,
102+
self._config.logging_policy,
103+
policies.DistributedTracingPolicy(**kwargs),
104+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
105+
self._config.http_logging_policy,
106+
]
107+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
88108

89109
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
90110
self._serialize = Serializer(client_models)
@@ -108,7 +128,7 @@ def __init__(
108128
self._client, self._config, self._serialize, self._deserialize
109129
)
110130

111-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
131+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
112132
"""Runs the network request through the client's chained policies.
113133
114134
>>> from azure.core.rest import HttpRequest
@@ -128,7 +148,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
128148

129149
request_copy = deepcopy(request)
130150
request_copy.url = self._client.format_url(request_copy.url)
131-
return self._client.send_request(request_copy, **kwargs)
151+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
132152

133153
def close(self) -> None:
134154
self._client.close()

0 commit comments

Comments
 (0)