-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use swagger #904899a23a417768ce1ec1d5f89f33817f8ef8ad * update * updates * update changelog
- Loading branch information
1 parent
d08c4f4
commit 5a79ca8
Showing
71 changed files
with
17,437 additions
and
21,052 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 15 additions & 9 deletions
24
sdk/search/azure-search-documents/azure/search/documents/_generated/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.3, generator: @autorest/[email protected]) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._search_client import SearchClient | ||
__all__ = ['SearchClient'] | ||
from ._search_index_client import SearchIndexClient | ||
|
||
# `._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 __all__ as _patch_all | ||
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import | ||
except ImportError: | ||
_patch_all = [] | ||
from ._patch import patch_sdk as _patch_sdk | ||
|
||
__all__ = [ | ||
"SearchIndexClient", | ||
] | ||
__all__.extend([p for p in _patch_all if p not in __all__]) | ||
|
||
_patch_sdk() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,41 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.3, generator: @autorest/[email protected]) | ||
# Changes may cause incorrect behavior and will be lost if the code is regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from typing import TYPE_CHECKING | ||
import sys | ||
from typing import Any | ||
|
||
from azure.core.configuration import Configuration | ||
from azure.core.pipeline import policies | ||
|
||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from typing import Any | ||
if sys.version_info >= (3, 8): | ||
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports | ||
else: | ||
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports | ||
|
||
VERSION = "unknown" | ||
|
||
class SearchClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes | ||
"""Configuration for SearchClient. | ||
|
||
class SearchIndexClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes | ||
"""Configuration for SearchIndexClient. | ||
Note that all parameters used to create this instance are saved as instance | ||
attributes. | ||
:param endpoint: The endpoint URL of the search service. | ||
:param endpoint: The endpoint URL of the search service. Required. | ||
:type endpoint: str | ||
:param index_name: The name of the index. | ||
:param index_name: The name of the index. Required. | ||
: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. | ||
:keyword api_version: Api Version. Default value is "2021-04-30-Preview". Note that overriding | ||
this default value may result in unsupported behavior. | ||
:paramtype api_version: str | ||
""" | ||
|
||
def __init__( | ||
self, | ||
endpoint, # type: str | ||
index_name, # type: str | ||
**kwargs # type: Any | ||
): | ||
# type: (...) -> None | ||
super(SearchClientConfiguration, self).__init__(**kwargs) | ||
api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str | ||
def __init__(self, endpoint: str, index_name: str, **kwargs: Any) -> None: | ||
super(SearchIndexClientConfiguration, self).__init__(**kwargs) | ||
api_version = kwargs.pop("api_version", "2021-04-30-Preview") # type: Literal["2021-04-30-Preview"] | ||
|
||
if endpoint is None: | ||
raise ValueError("Parameter 'endpoint' must not be None.") | ||
|
@@ -50,20 +45,19 @@ def __init__( | |
self.endpoint = endpoint | ||
self.index_name = index_name | ||
self.api_version = api_version | ||
kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) | ||
kwargs.setdefault("sdk_moniker", "searchindexclient/{}".format(VERSION)) | ||
self._configure(**kwargs) | ||
|
||
def _configure( | ||
self, | ||
**kwargs # type: Any | ||
self, **kwargs # type: Any | ||
): | ||
# type: (...) -> None | ||
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) | ||
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) | ||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) | ||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) | ||
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) | ||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) | ||
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) | ||
self.authentication_policy = kwargs.get('authentication_policy') | ||
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) | ||
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) | ||
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) | ||
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) | ||
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) | ||
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) | ||
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) | ||
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) | ||
self.authentication_policy = kwargs.get("authentication_policy") |
47 changes: 18 additions & 29 deletions
47
sdk/search/azure-search-documents/azure/search/documents/_generated/_patch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# | ||
# The MIT License (MIT) | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the ""Software""), to | ||
# deal in the Software without restriction, including without limitation the | ||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
# sell copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
# IN THE SOFTWARE. | ||
# | ||
# -------------------------------------------------------------------------- | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
"""Customize generated code here. | ||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize | ||
""" | ||
from typing import List | ||
|
||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level | ||
|
||
|
||
# This file 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 | ||
def patch_sdk(): | ||
pass | ||
"""Do not remove from this file. | ||
`patch_sdk` is a last resort escape hatch that allows you to do customizations | ||
you can't accomplish using the techniques described in | ||
https://aka.ms/azsdk/python/dpcodegen/python/customize | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,49 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.3, generator: @autorest/[email protected]) | ||
# 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 typing import Any | ||
|
||
from azure.core import PipelineClient | ||
from azure.core.rest import HttpRequest, HttpResponse | ||
|
||
from . import models | ||
from ._configuration import SearchClientConfiguration | ||
from ._configuration import SearchIndexClientConfiguration | ||
from ._serialization import Deserializer, Serializer | ||
from .operations import DocumentsOperations | ||
|
||
if TYPE_CHECKING: | ||
# pylint: disable=unused-import,ungrouped-imports | ||
from typing import Any | ||
|
||
from azure.core.rest import HttpRequest, HttpResponse | ||
|
||
class SearchClient(object): | ||
class SearchIndexClient: # pylint: disable=client-accepts-api-version-keyword | ||
"""Client that can be used to query an index and upload, merge, or delete documents. | ||
:ivar documents: DocumentsOperations operations | ||
:vartype documents: azure.search.documents.operations.DocumentsOperations | ||
:param endpoint: The endpoint URL of the search service. | ||
:vartype documents: search_index_client.operations.DocumentsOperations | ||
:param endpoint: The endpoint URL of the search service. Required. | ||
:type endpoint: str | ||
:param index_name: The name of the index. | ||
:param index_name: The name of the index. Required. | ||
: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. | ||
:keyword api_version: Api Version. Default value is "2021-04-30-Preview". Note that overriding | ||
this default value may result in unsupported behavior. | ||
:paramtype api_version: str | ||
""" | ||
|
||
def __init__( | ||
self, | ||
endpoint, # type: str | ||
index_name, # type: str | ||
**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) | ||
def __init__( # pylint: disable=missing-client-constructor-parameter-credential | ||
self, endpoint: str, index_name: str, **kwargs: Any | ||
) -> None: | ||
_endpoint = "{endpoint}/indexes('{indexName}')" | ||
self._config = SearchIndexClientConfiguration(endpoint=endpoint, index_name=index_name, **kwargs) | ||
self._client = PipelineClient(base_url=_endpoint, 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) | ||
|
||
|
||
def _send_request( | ||
self, | ||
request, # type: HttpRequest | ||
**kwargs # type: Any | ||
): | ||
# type: (...) -> HttpResponse | ||
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: | ||
"""Runs the network request through the client's chained policies. | ||
>>> from azure.core.rest import HttpRequest | ||
|
@@ -69,7 +52,7 @@ def _send_request( | |
>>> response = client._send_request(request) | ||
<HttpResponse: 200 OK> | ||
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart | ||
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request | ||
:param request: The network request you want to make. Required. | ||
:type request: ~azure.core.rest.HttpRequest | ||
|
@@ -80,8 +63,8 @@ def _send_request( | |
|
||
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) | ||
|
@@ -92,7 +75,7 @@ def close(self): | |
self._client.close() | ||
|
||
def __enter__(self): | ||
# type: () -> SearchClient | ||
# type: () -> SearchIndexClient | ||
self._client.__enter__() | ||
return self | ||
|
||
|
Oops, something went wrong.