Skip to content

Commit df82ec8

Browse files
authored
Remove beta features from main (Azure#25795)
* initial commit * lint * build fix * generated code * Apply suggestions from code review * lint * 11.2.2 models * generated * changes * lint * lint * tests fix * doc fix * tests fix * docs fix * recordings * callable
1 parent f01ddff commit df82ec8

File tree

93 files changed

+6349
-21009
lines changed

Some content is hidden

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

93 files changed

+6349
-21009
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 11.3.0b9 (Unreleased)
3+
## 11.3.0 (Unreleased)
44

55
### Features Added
66
- Added support for other national clouds.

sdk/search/azure-search-documents/azure/search/documents/_api_versions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
1010
#: this is the default version
1111
V2020_06_30 = "2020-06-30"
12-
V2021_04_30_PREVIEW = "2021-04-30-Preview"
1312

1413

15-
DEFAULT_VERSION = ApiVersion.V2021_04_30_PREVIEW
14+
DEFAULT_VERSION = ApiVersion.V2020_06_30

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from ._search_client import SearchClient
1010
__all__ = ['SearchClient']
1111

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()
12+
try:
13+
from ._patch import patch_sdk # type: ignore
14+
patch_sdk()
15+
except ImportError:
16+
pass

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
VERSION = "unknown"
1919

20-
class SearchClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
20+
class SearchClientConfiguration(Configuration):
2121
"""Configuration for SearchClient.
2222
2323
Note that all parameters used to create this instance are saved as instance
@@ -27,9 +27,6 @@ class SearchClientConfiguration(Configuration): # pylint: disable=too-many-inst
2727
:type endpoint: str
2828
:param index_name: The name of the index.
2929
: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.
32-
:paramtype api_version: str
3330
"""
3431

3532
def __init__(
@@ -39,17 +36,15 @@ def __init__(
3936
**kwargs # type: Any
4037
):
4138
# type: (...) -> None
42-
super(SearchClientConfiguration, self).__init__(**kwargs)
43-
api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str
44-
4539
if endpoint is None:
4640
raise ValueError("Parameter 'endpoint' must not be None.")
4741
if index_name is None:
4842
raise ValueError("Parameter 'index_name' must not be None.")
43+
super(SearchClientConfiguration, self).__init__(**kwargs)
4944

5045
self.endpoint = endpoint
5146
self.index_name = index_name
52-
self.api_version = api_version
47+
self.api_version = "2020-06-30"
5348
kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION))
5449
self._configure(**kwargs)
5550

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

Lines changed: 0 additions & 31 deletions
This file was deleted.

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

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from copy import deepcopy
109
from typing import TYPE_CHECKING
1110

12-
from msrest import Deserializer, Serializer
13-
1411
from azure.core import PipelineClient
15-
16-
from . import models
17-
from ._configuration import SearchClientConfiguration
18-
from .operations import DocumentsOperations
12+
from msrest import Deserializer, Serializer
1913

2014
if TYPE_CHECKING:
2115
# pylint: disable=unused-import,ungrouped-imports
2216
from typing import Any
2317

24-
from azure.core.rest import HttpRequest, HttpResponse
18+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
19+
20+
from ._configuration import SearchClientConfiguration
21+
from .operations import DocumentsOperations
22+
from . import models
23+
2524

2625
class SearchClient(object):
2726
"""Client that can be used to query an index and upload, merge, or delete documents.
@@ -32,9 +31,6 @@ class SearchClient(object):
3231
:type endpoint: str
3332
:param index_name: The name of the index.
3433
: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.
37-
:paramtype api_version: str
3834
"""
3935

4036
def __init__(
@@ -44,48 +40,36 @@ def __init__(
4440
**kwargs # type: Any
4541
):
4642
# 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)
43+
base_url = '{endpoint}/indexes(\'{indexName}\')'
44+
self._config = SearchClientConfiguration(endpoint, index_name, **kwargs)
45+
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
5046

5147
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5248
self._serialize = Serializer(client_models)
53-
self._deserialize = Deserializer(client_models)
5449
self._serialize.client_side_validation = False
55-
self.documents = DocumentsOperations(self._client, self._config, self._serialize, self._deserialize)
50+
self._deserialize = Deserializer(client_models)
5651

52+
self.documents = DocumentsOperations(
53+
self._client, self._config, self._serialize, self._deserialize)
5754

58-
def _send_request(
59-
self,
60-
request, # type: HttpRequest
61-
**kwargs # type: Any
62-
):
63-
# type: (...) -> HttpResponse
55+
def _send_request(self, http_request, **kwargs):
56+
# type: (HttpRequest, Any) -> HttpResponse
6457
"""Runs the network request through the client's chained policies.
6558
66-
>>> from azure.core.rest import HttpRequest
67-
>>> request = HttpRequest("GET", "https://www.example.org/")
68-
<HttpRequest [GET], url: 'https://www.example.org/'>
69-
>>> response = client._send_request(request)
70-
<HttpResponse: 200 OK>
71-
72-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
73-
74-
:param request: The network request you want to make. Required.
75-
:type request: ~azure.core.rest.HttpRequest
76-
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
59+
:param http_request: The network request you want to make. Required.
60+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
61+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
7762
:return: The response of your network call. Does not do error handling on your response.
78-
:rtype: ~azure.core.rest.HttpResponse
63+
:rtype: ~azure.core.pipeline.transport.HttpResponse
7964
"""
80-
81-
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
}
86-
87-
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
88-
return self._client.send_request(request_copy, **kwargs)
69+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
70+
stream = kwargs.pop("stream", True)
71+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
72+
return pipeline_response.http_response
8973

9074
def close(self):
9175
# type: () -> None

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

Lines changed: 0 additions & 27 deletions
This file was deleted.

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,3 @@
88

99
from ._search_client import SearchClient
1010
__all__ = ['SearchClient']
11-
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()

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
VERSION = "unknown"
1515

16-
class SearchClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
16+
class SearchClientConfiguration(Configuration):
1717
"""Configuration for SearchClient.
1818
1919
Note that all parameters used to create this instance are saved as instance
@@ -23,9 +23,6 @@ class SearchClientConfiguration(Configuration): # pylint: disable=too-many-inst
2323
:type endpoint: str
2424
:param index_name: The name of the index.
2525
:type index_name: str
26-
:keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that
27-
overriding this default value may result in unsupported behavior.
28-
:paramtype api_version: str
2926
"""
3027

3128
def __init__(
@@ -34,17 +31,15 @@ def __init__(
3431
index_name: str,
3532
**kwargs: Any
3633
) -> None:
37-
super(SearchClientConfiguration, self).__init__(**kwargs)
38-
api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str
39-
4034
if endpoint is None:
4135
raise ValueError("Parameter 'endpoint' must not be None.")
4236
if index_name is None:
4337
raise ValueError("Parameter 'index_name' must not be None.")
38+
super(SearchClientConfiguration, self).__init__(**kwargs)
4439

4540
self.endpoint = endpoint
4641
self.index_name = index_name
47-
self.api_version = api_version
42+
self.api_version = "2020-06-30"
4843
kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION))
4944
self._configure(**kwargs)
5045

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

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)