Skip to content

Commit 04b0f97

Browse files
authored
Search: Add normalizer property to AnalyzeText. (Azure#20485)
* Regenerate index code. * Regenerate service code. * Update AnalyzeTextOptions. * Update changelog.
1 parent ec3548b commit 04b0f97

File tree

18 files changed

+1122
-1576
lines changed

18 files changed

+1122
-1576
lines changed

sdk/search/azure-search-documents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- `azure.search.documents.indexes.models.SearchIndexerDataIdentity`
1616
- `azure.search.documents.indexes.models.SearchIndexerDataNoneIdentity`
1717
- `azure.search.documents.indexes.models.SearchIndexerDataUserAssignedIdentity`
18+
- Added `normalizer_name` property to `AnalyzeTextOptions` model.
1819

1920
## 11.3.0b2 (2021-08-10)
2021

sdk/search/azure-search-documents/azure/search/documents/_generated/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
# --------------------------------------------------------------------------
88

99
from ._search_client import SearchClient
10-
11-
__all__ = ["SearchClient"]
10+
__all__ = ['SearchClient']
1211

1312
try:
1413
from ._patch import patch_sdk # type: ignore
15-
1614
patch_sdk()
1715
except ImportError:
1816
pass

sdk/search/azure-search-documents/azure/search/documents/_generated/_configuration.py

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
VERSION = "unknown"
1919

20-
2120
class SearchClientConfiguration(Configuration):
2221
"""Configuration for SearchClient.
2322
@@ -46,31 +45,20 @@ def __init__(
4645
self.endpoint = endpoint
4746
self.index_name = index_name
4847
self.api_version = "2021-04-30-Preview"
49-
kwargs.setdefault("sdk_moniker", "search-documents/{}".format(VERSION))
48+
kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION))
5049
self._configure(**kwargs)
5150

5251
def _configure(
53-
self, **kwargs # type: Any
52+
self,
53+
**kwargs # type: Any
5454
):
5555
# type: (...) -> None
56-
self.user_agent_policy = kwargs.get(
57-
"user_agent_policy"
58-
) or policies.UserAgentPolicy(**kwargs)
59-
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(
60-
**kwargs
61-
)
62-
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
63-
self.logging_policy = kwargs.get(
64-
"logging_policy"
65-
) or policies.NetworkTraceLoggingPolicy(**kwargs)
66-
self.http_logging_policy = kwargs.get(
67-
"http_logging_policy"
68-
) or policies.HttpLoggingPolicy(**kwargs)
69-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
70-
self.custom_hook_policy = kwargs.get(
71-
"custom_hook_policy"
72-
) or policies.CustomHookPolicy(**kwargs)
73-
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(
74-
**kwargs
75-
)
76-
self.authentication_policy = kwargs.get("authentication_policy")
56+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
57+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
58+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
59+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
60+
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
61+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
62+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
63+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
64+
self.authentication_policy = kwargs.get('authentication_policy')

sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,17 @@ def __init__(
4040
**kwargs # type: Any
4141
):
4242
# type: (...) -> None
43-
base_url = "{endpoint}/indexes('{indexName}')"
43+
base_url = '{endpoint}/indexes(\'{indexName}\')'
4444
self._config = SearchClientConfiguration(endpoint, index_name, **kwargs)
4545
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
4646

47-
client_models = {
48-
k: v for k, v in models.__dict__.items() if isinstance(v, type)
49-
}
47+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5048
self._serialize = Serializer(client_models)
5149
self._serialize.client_side_validation = False
5250
self._deserialize = Deserializer(client_models)
5351

5452
self.documents = DocumentsOperations(
55-
self._client, self._config, self._serialize, self._deserialize
56-
)
53+
self._client, self._config, self._serialize, self._deserialize)
5754

5855
def _send_request(self, http_request, **kwargs):
5956
# type: (HttpRequest, Any) -> HttpResponse
@@ -66,20 +63,12 @@ def _send_request(self, http_request, **kwargs):
6663
:rtype: ~azure.core.pipeline.transport.HttpResponse
6764
"""
6865
path_format_arguments = {
69-
"endpoint": self._serialize.url(
70-
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
71-
),
72-
"indexName": self._serialize.url(
73-
"self._config.index_name", self._config.index_name, "str"
74-
),
66+
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
67+
'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'),
7568
}
76-
http_request.url = self._client.format_url(
77-
http_request.url, **path_format_arguments
78-
)
69+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
7970
stream = kwargs.pop("stream", True)
80-
pipeline_response = self._client._pipeline.run(
81-
http_request, stream=stream, **kwargs
82-
)
71+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
8372
return pipeline_response.http_response
8473

8574
def close(self):

sdk/search/azure-search-documents/azure/search/documents/_generated/aio/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
# --------------------------------------------------------------------------
88

99
from ._search_client import SearchClient
10-
11-
__all__ = ["SearchClient"]
10+
__all__ = ['SearchClient']

sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_configuration.py

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
VERSION = "unknown"
1515

16-
1716
class SearchClientConfiguration(Configuration):
1817
"""Configuration for SearchClient.
1918
@@ -26,7 +25,12 @@ class SearchClientConfiguration(Configuration):
2625
:type index_name: str
2726
"""
2827

29-
def __init__(self, endpoint: str, index_name: str, **kwargs: Any) -> None:
28+
def __init__(
29+
self,
30+
endpoint: str,
31+
index_name: str,
32+
**kwargs: Any
33+
) -> None:
3034
if endpoint is None:
3135
raise ValueError("Parameter 'endpoint' must not be None.")
3236
if index_name is None:
@@ -36,30 +40,19 @@ def __init__(self, endpoint: str, index_name: str, **kwargs: Any) -> None:
3640
self.endpoint = endpoint
3741
self.index_name = index_name
3842
self.api_version = "2021-04-30-Preview"
39-
kwargs.setdefault("sdk_moniker", "search-documents/{}".format(VERSION))
43+
kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION))
4044
self._configure(**kwargs)
4145

42-
def _configure(self, **kwargs: Any) -> None:
43-
self.user_agent_policy = kwargs.get(
44-
"user_agent_policy"
45-
) or policies.UserAgentPolicy(**kwargs)
46-
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(
47-
**kwargs
48-
)
49-
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
50-
self.logging_policy = kwargs.get(
51-
"logging_policy"
52-
) or policies.NetworkTraceLoggingPolicy(**kwargs)
53-
self.http_logging_policy = kwargs.get(
54-
"http_logging_policy"
55-
) or policies.HttpLoggingPolicy(**kwargs)
56-
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(
57-
**kwargs
58-
)
59-
self.custom_hook_policy = kwargs.get(
60-
"custom_hook_policy"
61-
) or policies.CustomHookPolicy(**kwargs)
62-
self.redirect_policy = kwargs.get(
63-
"redirect_policy"
64-
) or policies.AsyncRedirectPolicy(**kwargs)
65-
self.authentication_policy = kwargs.get("authentication_policy")
46+
def _configure(
47+
self,
48+
**kwargs: Any
49+
) -> None:
50+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
51+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
52+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
53+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
54+
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
55+
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
56+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
57+
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
58+
self.authentication_policy = kwargs.get('authentication_policy')

sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,25 @@ class SearchClient(object):
2828
:type index_name: str
2929
"""
3030

31-
def __init__(self, endpoint: str, index_name: str, **kwargs: Any) -> None:
32-
base_url = "{endpoint}/indexes('{indexName}')"
31+
def __init__(
32+
self,
33+
endpoint: str,
34+
index_name: str,
35+
**kwargs: Any
36+
) -> None:
37+
base_url = '{endpoint}/indexes(\'{indexName}\')'
3338
self._config = SearchClientConfiguration(endpoint, index_name, **kwargs)
34-
self._client = AsyncPipelineClient(
35-
base_url=base_url, config=self._config, **kwargs
36-
)
39+
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)
3740

38-
client_models = {
39-
k: v for k, v in models.__dict__.items() if isinstance(v, type)
40-
}
41+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
4142
self._serialize = Serializer(client_models)
4243
self._serialize.client_side_validation = False
4344
self._deserialize = Deserializer(client_models)
4445

4546
self.documents = DocumentsOperations(
46-
self._client, self._config, self._serialize, self._deserialize
47-
)
47+
self._client, self._config, self._serialize, self._deserialize)
4848

49-
async def _send_request(
50-
self, http_request: HttpRequest, **kwargs: Any
51-
) -> AsyncHttpResponse:
49+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
5250
"""Runs the network request through the client's chained policies.
5351
5452
:param http_request: The network request you want to make. Required.
@@ -58,20 +56,12 @@ async def _send_request(
5856
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
5957
"""
6058
path_format_arguments = {
61-
"endpoint": self._serialize.url(
62-
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
63-
),
64-
"indexName": self._serialize.url(
65-
"self._config.index_name", self._config.index_name, "str"
66-
),
59+
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
60+
'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'),
6761
}
68-
http_request.url = self._client.format_url(
69-
http_request.url, **path_format_arguments
70-
)
62+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
7163
stream = kwargs.pop("stream", True)
72-
pipeline_response = await self._client._pipeline.run(
73-
http_request, stream=stream, **kwargs
74-
)
64+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
7565
return pipeline_response.http_response
7666

7767
async def close(self) -> None:

sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
from ._documents_operations import DocumentsOperations
1010

1111
__all__ = [
12-
"DocumentsOperations",
12+
'DocumentsOperations',
1313
]

0 commit comments

Comments
 (0)