Skip to content

Commit

Permalink
Remove beta features from main (#25795)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rakshith91 authored Aug 31, 2022
1 parent f01ddff commit df82ec8
Show file tree
Hide file tree
Showing 93 changed files with 6,349 additions and 21,009 deletions.
2 changes: 1 addition & 1 deletion sdk/search/azure-search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 11.3.0b9 (Unreleased)
## 11.3.0 (Unreleased)

### Features Added
- Added support for other national clouds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
class ApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
#: this is the default version
V2020_06_30 = "2020-06-30"
V2021_04_30_PREVIEW = "2021-04-30-Preview"


DEFAULT_VERSION = ApiVersion.V2021_04_30_PREVIEW
DEFAULT_VERSION = ApiVersion.V2020_06_30
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from ._search_client import SearchClient
__all__ = ['SearchClient']

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

VERSION = "unknown"

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

def __init__(
Expand All @@ -39,17 +36,15 @@ def __init__(
**kwargs # type: Any
):
# type: (...) -> None
super(SearchClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
if index_name is None:
raise ValueError("Parameter 'index_name' must not be None.")
super(SearchClientConfiguration, self).__init__(**kwargs)

self.endpoint = endpoint
self.index_name = index_name
self.api_version = api_version
self.api_version = "2020-06-30"
kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION))
self._configure(**kwargs)

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.core import PipelineClient

from . import models
from ._configuration import SearchClientConfiguration
from .operations import DocumentsOperations
from msrest import Deserializer, Serializer

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

from azure.core.rest import HttpRequest, HttpResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import SearchClientConfiguration
from .operations import DocumentsOperations
from . import models


class SearchClient(object):
"""Client that can be used to query an index and upload, merge, or delete documents.
Expand All @@ -32,9 +31,6 @@ class SearchClient(object):
:type endpoint: str
:param index_name: The name of the index.
:type index_name: str
:keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that
overriding this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
Expand All @@ -44,48 +40,36 @@ def __init__(
**kwargs # type: Any
):
# type: (...) -> None
_base_url = '{endpoint}/indexes(\'{indexName}\')'
self._config = SearchClientConfiguration(endpoint=endpoint, index_name=index_name, **kwargs)
self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs)
base_url = '{endpoint}/indexes(\'{indexName}\')'
self._config = SearchClientConfiguration(endpoint, index_name, **kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)

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

self.documents = DocumentsOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(
self,
request, # type: HttpRequest
**kwargs # type: Any
):
# type: (...) -> HttpResponse
def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.rest.HttpResponse
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""

request_copy = deepcopy(request)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
"indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'),
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'),
}

request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
return self._client.send_request(request_copy, **kwargs)
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@

from ._search_client import SearchClient
__all__ = ['SearchClient']

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

VERSION = "unknown"

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

def __init__(
Expand All @@ -34,17 +31,15 @@ def __init__(
index_name: str,
**kwargs: Any
) -> None:
super(SearchClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
if index_name is None:
raise ValueError("Parameter 'index_name' must not be None.")
super(SearchClientConfiguration, self).__init__(**kwargs)

self.endpoint = endpoint
self.index_name = index_name
self.api_version = api_version
self.api_version = "2020-06-30"
kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION))
self._configure(**kwargs)

Expand Down

This file was deleted.

Loading

0 comments on commit df82ec8

Please sign in to comment.