Skip to content

Commit 5a79ca8

Browse files
authored
Use latest swagger (Azure#27288)
* Use swagger #904899a23a417768ce1ec1d5f89f33817f8ef8ad * update * updates * update changelog
1 parent d08c4f4 commit 5a79ca8

File tree

71 files changed

+17437
-21052
lines changed

Some content is hidden

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

71 files changed

+17437
-21052
lines changed

sdk/identity/azure-identity/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
Issue [#25713](https://github.com/Azure/azure-sdk-for-python/issues/25713) tracks this. In the meantime
1717
Visual Studio Code users can authenticate their development environment using the [Azure CLI](https://learn.microsoft.com/cli/azure/).
1818

19+
### Other Changes
20+
21+
- Added Python 3.11 support and stopped supporting Python 3.6.
22+
1923
## 1.12.0b2 (2022-10-11)
2024

2125
1.12.0 release candidate

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

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

3-
## 11.4.0b2 (Unreleased)
3+
## 11.4.0b2 (2022-11-08)
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
7+
- Enabled `OcrSkill` and `ImageAnalysisSkill`
108

119
### Other Changes
1210

11+
- Added Python 3.11 support.
12+
1313
## 11.4.0b1 (2022-09-08)
1414

1515
### Features Added
16+
1617
- Added support to create, update and delete aliases via the `SearchIndexClient`.
1718

1819
## 11.3.0 (2022-09-06)
@@ -22,23 +23,28 @@
2223
- Some of the features that were available in the `11.3.0b8` version are not available in this GA. They would be available in the upcoming beta release.
2324

2425
### Features Added
26+
2527
- Added support for other national clouds.
2628
- Added support for TokenCredential
2729

2830
### Bugs Fixed
31+
2932
- Fixed issue where async `search` call would fail with a 403 error when retrieving large number of documents.
3033

3134
### Other Changes
35+
3236
- Python 3.6 is no longer supported. Please use Python version 3.7 or later.
3337

3438
## 11.2.2 (2022-04-14)
3539

3640
### Bugs Fixed
41+
3742
- Fixes a bug allowing users to set keys for cognitive service skills using the API. Exposes `DefaultCognitiveServicesAccount` and `CognitiveServicesAccountKey`
3843

3944
## 11.3.0b8 (2022-03-08)
4045

4146
### Features Added
47+
4248
- Added support to create, update and delete aliases via the `SearchIndexClient`.
4349

4450
## 11.3.0b7 (2022-02-08)
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
3-
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.3, generator: @autorest/python@6.2.3)
64
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
75
# --------------------------------------------------------------------------
86

9-
from ._search_client import SearchClient
10-
__all__ = ['SearchClient']
7+
from ._search_index_client import SearchIndexClient
118

12-
# `._patch.py` is used for handwritten extensions to the generated code
13-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
14-
from ._patch import patch_sdk
15-
patch_sdk()
9+
try:
10+
from ._patch import __all__ as _patch_all
11+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
12+
except ImportError:
13+
_patch_all = []
14+
from ._patch import patch_sdk as _patch_sdk
15+
16+
__all__ = [
17+
"SearchIndexClient",
18+
]
19+
__all__.extend([p for p in _patch_all if p not in __all__])
20+
21+
_patch_sdk()
Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
3-
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.3, generator: @autorest/python@6.2.3)
64
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
75
# --------------------------------------------------------------------------
86

9-
from typing import TYPE_CHECKING
7+
import sys
8+
from typing import Any
109

1110
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312

14-
if TYPE_CHECKING:
15-
# pylint: disable=unused-import,ungrouped-imports
16-
from typing import Any
13+
if sys.version_info >= (3, 8):
14+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
15+
else:
16+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
1717

1818
VERSION = "unknown"
1919

20-
class SearchClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21-
"""Configuration for SearchClient.
20+
21+
class SearchIndexClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
22+
"""Configuration for SearchIndexClient.
2223
2324
Note that all parameters used to create this instance are saved as instance
2425
attributes.
2526
26-
:param endpoint: The endpoint URL of the search service.
27+
:param endpoint: The endpoint URL of the search service. Required.
2728
:type endpoint: str
28-
:param index_name: The name of the index.
29+
:param index_name: The name of the index. Required.
2930
:type index_name: str
30-
:keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that
31-
overriding this default value may result in unsupported behavior.
31+
:keyword api_version: Api Version. Default value is "2021-04-30-Preview". Note that overriding
32+
this default value may result in unsupported behavior.
3233
:paramtype api_version: str
3334
"""
3435

35-
def __init__(
36-
self,
37-
endpoint, # type: str
38-
index_name, # type: str
39-
**kwargs # type: Any
40-
):
41-
# type: (...) -> None
42-
super(SearchClientConfiguration, self).__init__(**kwargs)
43-
api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str
36+
def __init__(self, endpoint: str, index_name: str, **kwargs: Any) -> None:
37+
super(SearchIndexClientConfiguration, self).__init__(**kwargs)
38+
api_version = kwargs.pop("api_version", "2021-04-30-Preview") # type: Literal["2021-04-30-Preview"]
4439

4540
if endpoint is None:
4641
raise ValueError("Parameter 'endpoint' must not be None.")
@@ -50,20 +45,19 @@ def __init__(
5045
self.endpoint = endpoint
5146
self.index_name = index_name
5247
self.api_version = api_version
53-
kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION))
48+
kwargs.setdefault("sdk_moniker", "searchindexclient/{}".format(VERSION))
5449
self._configure(**kwargs)
5550

5651
def _configure(
57-
self,
58-
**kwargs # type: Any
52+
self, **kwargs # type: Any
5953
):
6054
# type: (...) -> None
61-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65-
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
66-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69-
self.authentication_policy = kwargs.get('authentication_policy')
55+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
56+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
57+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
58+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
59+
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
61+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
62+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
63+
self.authentication_policy = kwargs.get("authentication_policy")
Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
1-
# coding=utf-8
2-
# --------------------------------------------------------------------------
3-
#
4-
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
#
6-
# The MIT License (MIT)
7-
#
8-
# Permission is hereby granted, free of charge, to any person obtaining a copy
9-
# of this software and associated documentation files (the ""Software""), to
10-
# deal in the Software without restriction, including without limitation the
11-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12-
# sell copies of the Software, and to permit persons to whom the Software is
13-
# furnished to do so, subject to the following conditions:
14-
#
15-
# The above copyright notice and this permission notice shall be included in
16-
# all copies or substantial portions of the Software.
17-
#
18-
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24-
# IN THE SOFTWARE.
25-
#
26-
# --------------------------------------------------------------------------
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
"""Customize generated code here.
6+
7+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8+
"""
9+
from typing import List
10+
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12+
2713

28-
# This file is used for handwritten extensions to the generated code. Example:
29-
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3014
def patch_sdk():
31-
pass
15+
"""Do not remove from this file.
16+
17+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
18+
you can't accomplish using the techniques described in
19+
https://aka.ms/azsdk/python/dpcodegen/python/customize
20+
"""

sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py renamed to sdk/search/azure-search-documents/azure/search/documents/_generated/_search_index_client.py

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,49 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
3-
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
3+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.3, generator: @autorest/python@6.2.3)
64
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
75
# --------------------------------------------------------------------------
86

97
from copy import deepcopy
10-
from typing import TYPE_CHECKING
11-
12-
from msrest import Deserializer, Serializer
8+
from typing import Any
139

1410
from azure.core import PipelineClient
11+
from azure.core.rest import HttpRequest, HttpResponse
1512

1613
from . import models
17-
from ._configuration import SearchClientConfiguration
14+
from ._configuration import SearchIndexClientConfiguration
15+
from ._serialization import Deserializer, Serializer
1816
from .operations import DocumentsOperations
1917

20-
if TYPE_CHECKING:
21-
# pylint: disable=unused-import,ungrouped-imports
22-
from typing import Any
23-
24-
from azure.core.rest import HttpRequest, HttpResponse
2518

26-
class SearchClient(object):
19+
class SearchIndexClient: # pylint: disable=client-accepts-api-version-keyword
2720
"""Client that can be used to query an index and upload, merge, or delete documents.
2821
2922
:ivar documents: DocumentsOperations operations
30-
:vartype documents: azure.search.documents.operations.DocumentsOperations
31-
:param endpoint: The endpoint URL of the search service.
23+
:vartype documents: search_index_client.operations.DocumentsOperations
24+
:param endpoint: The endpoint URL of the search service. Required.
3225
:type endpoint: str
33-
:param index_name: The name of the index.
26+
:param index_name: The name of the index. Required.
3427
:type index_name: str
35-
:keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that
36-
overriding this default value may result in unsupported behavior.
28+
:keyword api_version: Api Version. Default value is "2021-04-30-Preview". Note that overriding
29+
this default value may result in unsupported behavior.
3730
:paramtype api_version: str
3831
"""
3932

40-
def __init__(
41-
self,
42-
endpoint, # type: str
43-
index_name, # type: str
44-
**kwargs # type: Any
45-
):
46-
# type: (...) -> None
47-
_base_url = '{endpoint}/indexes(\'{indexName}\')'
48-
self._config = SearchClientConfiguration(endpoint=endpoint, index_name=index_name, **kwargs)
49-
self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs)
33+
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
34+
self, endpoint: str, index_name: str, **kwargs: Any
35+
) -> None:
36+
_endpoint = "{endpoint}/indexes('{indexName}')"
37+
self._config = SearchIndexClientConfiguration(endpoint=endpoint, index_name=index_name, **kwargs)
38+
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
5039

5140
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5241
self._serialize = Serializer(client_models)
5342
self._deserialize = Deserializer(client_models)
5443
self._serialize.client_side_validation = False
5544
self.documents = DocumentsOperations(self._client, self._config, self._serialize, self._deserialize)
5645

57-
58-
def _send_request(
59-
self,
60-
request, # type: HttpRequest
61-
**kwargs # type: Any
62-
):
63-
# type: (...) -> HttpResponse
46+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
6447
"""Runs the network request through the client's chained policies.
6548
6649
>>> from azure.core.rest import HttpRequest
@@ -69,7 +52,7 @@ def _send_request(
6952
>>> response = client._send_request(request)
7053
<HttpResponse: 200 OK>
7154
72-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
55+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
7356
7457
:param request: The network request you want to make. Required.
7558
:type request: ~azure.core.rest.HttpRequest
@@ -80,8 +63,8 @@ def _send_request(
8063

8164
request_copy = deepcopy(request)
8265
path_format_arguments = {
83-
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
84-
"indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'),
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"),
8568
}
8669

8770
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
@@ -92,7 +75,7 @@ def close(self):
9275
self._client.close()
9376

9477
def __enter__(self):
95-
# type: () -> SearchClient
78+
# type: () -> SearchIndexClient
9679
self._client.__enter__()
9780
return self
9881

0 commit comments

Comments
 (0)