From 72f03736b00bcc919d253c410bdbc0b790f7fba6 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 14 Apr 2021 15:04:30 -0700 Subject: [PATCH 1/2] remove multiapi generated code --- .../documents/_generated/_configuration.py | 15 +- .../documents/_generated/_search_client.py | 119 +- .../search/documents/_generated/_version.py | 8 - .../_generated/aio/_configuration.py | 15 +- .../_generated/aio/_search_client.py | 116 +- .../{v2020_06 => }/aio/operations/__init__.py | 0 .../aio/operations/_documents_operations.py | 48 +- .../search/documents/_generated/models.py | 7 - .../{v2020_06_preview => }/models/__init__.py | 0 .../{v2020_06_preview => }/models/_models.py | 55 +- .../models/_models_py3.py | 55 +- .../models/_search_client_enums.py | 0 .../{v2020_06 => }/operations/__init__.py | 0 .../operations/_documents_operations.py | 48 +- .../documents/_generated/v2020_06/__init__.py | 16 - .../_generated/v2020_06/_configuration.py | 64 - .../_generated/v2020_06/_metadata.json | 97 - .../_generated/v2020_06/_search_client.py | 85 - .../_generated/v2020_06/aio/__init__.py | 10 - .../_generated/v2020_06/aio/_configuration.py | 58 - .../_generated/v2020_06/aio/_search_client.py | 75 - .../aio/operations/_documents_operations.py | 814 --- .../_generated/v2020_06/models/__init__.py | 83 - .../_generated/v2020_06/models/_models.py | 1001 --- .../_generated/v2020_06/models/_models_py3.py | 1099 --- .../v2020_06/models/_search_client_enums.py | 99 - .../operations/_documents_operations.py | 827 --- .../documents/_generated/v2020_06/py.typed | 1 - .../_generated/v2020_06_preview/__init__.py | 16 - .../v2020_06_preview/_configuration.py | 64 - .../v2020_06_preview/_metadata.json | 97 - .../v2020_06_preview/_search_client.py | 85 - .../v2020_06_preview/aio/__init__.py | 10 - .../v2020_06_preview/aio/_configuration.py | 58 - .../v2020_06_preview/aio/_search_client.py | 75 - .../aio/operations/__init__.py | 13 - .../v2020_06_preview/operations/__init__.py | 13 - .../_generated/v2020_06_preview/py.typed | 1 - .../indexes/_generated/_configuration.py | 15 +- .../indexes/_generated/_operations_mixin.py | 53 - .../indexes/_generated/_search_client.py | 208 +- .../documents/indexes/_generated/_version.py | 8 - .../indexes/_generated/aio/_configuration.py | 15 +- .../_generated/aio/_operations_mixin.py | 49 - .../indexes/_generated/aio/_search_client.py | 209 +- .../{v2020_06 => }/aio/operations/__init__.py | 0 .../operations/_data_sources_operations.py | 24 +- .../aio/operations/_indexers_operations.py | 32 +- .../aio/operations/_indexes_operations.py | 34 +- .../operations/_search_client_operations.py | 4 +- .../aio/operations/_skillsets_operations.py | 24 +- .../operations/_synonym_maps_operations.py | 24 +- .../documents/indexes/_generated/models.py | 7 - .../{v2020_06_preview => }/models/__init__.py | 0 .../{v2020_06_preview => }/models/_models.py | 465 +- .../models/_models_py3.py | 468 +- .../models/_search_client_enums.py | 184 +- .../{v2020_06 => }/operations/__init__.py | 0 .../operations/_data_sources_operations.py | 24 +- .../operations/_indexers_operations.py | 32 +- .../operations/_indexes_operations.py | 34 +- .../operations/_search_client_operations.py | 4 +- .../operations/_skillsets_operations.py | 24 +- .../operations/_synonym_maps_operations.py | 24 +- .../indexes/_generated/v2020_06/__init__.py | 16 - .../_generated/v2020_06/_configuration.py | 58 - .../_generated/v2020_06/_metadata.json | 101 - .../_generated/v2020_06/_search_client.py | 102 - .../_generated/v2020_06/aio/__init__.py | 10 - .../_generated/v2020_06/aio/_configuration.py | 52 - .../_generated/v2020_06/aio/_search_client.py | 92 - .../operations/_data_sources_operations.py | 402 -- .../aio/operations/_documents_operations.py | 814 --- .../aio/operations/_indexers_operations.py | 588 -- .../aio/operations/_indexes_operations.py | 570 -- .../operations/_search_client_operations.py | 80 - .../aio/operations/_skillsets_operations.py | 403 -- .../operations/_synonym_maps_operations.py | 402 -- .../_generated/v2020_06/models/__init__.py | 465 -- .../_generated/v2020_06/models/_models.py | 5790 --------------- .../_generated/v2020_06/models/_models_py3.py | 6343 ----------------- .../v2020_06/models/_search_client_enums.py | 1526 ---- .../operations/_data_sources_operations.py | 411 -- .../operations/_documents_operations.py | 827 --- .../operations/_indexers_operations.py | 600 -- .../operations/_indexes_operations.py | 581 -- .../operations/_search_client_operations.py | 85 - .../operations/_skillsets_operations.py | 412 -- .../operations/_synonym_maps_operations.py | 411 -- .../indexes/_generated/v2020_06/py.typed | 1 - .../_generated/v2020_06_preview/__init__.py | 16 - .../v2020_06_preview/_configuration.py | 58 - .../v2020_06_preview/_metadata.json | 101 - .../v2020_06_preview/_search_client.py | 102 - .../v2020_06_preview/aio/__init__.py | 10 - .../v2020_06_preview/aio/_configuration.py | 52 - .../v2020_06_preview/aio/_search_client.py | 92 - .../aio/operations/__init__.py | 23 - .../aio/operations/_documents_operations.py | 814 --- .../v2020_06_preview/operations/__init__.py | 23 - .../operations/_documents_operations.py | 827 --- .../_generated/v2020_06_preview/py.typed | 1 - 102 files changed, 933 insertions(+), 29540 deletions(-) delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/_version.py rename sdk/search/azure-search-documents/azure/search/documents/_generated/{v2020_06 => }/aio/operations/__init__.py (100%) rename sdk/search/azure-search-documents/azure/search/documents/_generated/{v2020_06_preview => }/aio/operations/_documents_operations.py (94%) delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/models.py rename sdk/search/azure-search-documents/azure/search/documents/_generated/{v2020_06_preview => }/models/__init__.py (100%) rename sdk/search/azure-search-documents/azure/search/documents/_generated/{v2020_06_preview => }/models/_models.py (95%) rename sdk/search/azure-search-documents/azure/search/documents/_generated/{v2020_06_preview => }/models/_models_py3.py (96%) rename sdk/search/azure-search-documents/azure/search/documents/_generated/{v2020_06_preview => }/models/_search_client_enums.py (100%) rename sdk/search/azure-search-documents/azure/search/documents/_generated/{v2020_06 => }/operations/__init__.py (100%) rename sdk/search/azure-search-documents/azure/search/documents/_generated/{v2020_06_preview => }/operations/_documents_operations.py (94%) delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_configuration.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_metadata.json delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_search_client.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/_configuration.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/_search_client.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/operations/_documents_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_models.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_models_py3.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_search_client_enums.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/operations/_documents_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/py.typed delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_configuration.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_metadata.json delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_search_client.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/_configuration.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/_search_client.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/operations/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/operations/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/py.typed delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_operations_mixin.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_version.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_operations_mixin.py rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06 => }/aio/operations/__init__.py (100%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/aio/operations/_data_sources_operations.py (94%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/aio/operations/_indexers_operations.py (94%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/aio/operations/_indexes_operations.py (94%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/aio/operations/_search_client_operations.py (95%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/aio/operations/_skillsets_operations.py (94%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/aio/operations/_synonym_maps_operations.py (94%) delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models.py rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/models/__init__.py (100%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/models/_models.py (93%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/models/_models_py3.py (93%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/models/_search_client_enums.py (87%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06 => }/operations/__init__.py (100%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/operations/_data_sources_operations.py (94%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/operations/_indexers_operations.py (94%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/operations/_indexes_operations.py (94%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/operations/_search_client_operations.py (95%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/operations/_skillsets_operations.py (94%) rename sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/{v2020_06_preview => }/operations/_synonym_maps_operations.py (94%) delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_configuration.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_metadata.json delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_search_client.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/_configuration.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/_search_client.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_data_sources_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_documents_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_indexers_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_indexes_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_search_client_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_skillsets_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_synonym_maps_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_models.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_models_py3.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_search_client_enums.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_data_sources_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_documents_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_indexers_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_indexes_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_search_client_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_skillsets_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_synonym_maps_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/py.typed delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_configuration.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_metadata.json delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_search_client.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/_configuration.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/_search_client.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_documents_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/__init__.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_documents_operations.py delete mode 100644 sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/py.typed diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/_configuration.py index 3a6383d38091..fa5c32c24b1a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/_configuration.py @@ -1,24 +1,22 @@ # 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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- + from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any +VERSION = "unknown" + class SearchClientConfiguration(Configuration): """Configuration for SearchClient. @@ -46,7 +44,8 @@ def __init__( self.endpoint = endpoint self.index_name = index_name - kwargs.setdefault('sdk_moniker', 'azure-search-documents/{}'.format(VERSION)) + self.api_version = "2020-06-30-Preview" + kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py index 092e1e52b740..cf5857632715 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py @@ -1,124 +1,85 @@ # 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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import TYPE_CHECKING from azure.core import PipelineClient -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin from msrest import Deserializer, Serializer -from ._configuration import SearchClientConfiguration - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional + from typing import Any from azure.core.pipeline.transport import HttpRequest, HttpResponse -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass +from ._configuration import SearchClientConfiguration +from .operations import DocumentsOperations +from . import models -class SearchClient(MultiApiClientMixin, _SDKClient): - """Client that can be used to query an index and upload, merge, or delete documents. - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. +class SearchClient(object): + """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. :type endpoint: str :param index_name: The name of the index. :type index_name: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2020-06-30-Preview' - _PROFILE_TAG = "azure.search.documents.SearchClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - }}, - _PROFILE_TAG + " latest" - ) - def __init__( self, endpoint, # type: str index_name, # type: str - api_version=None, # type: Optional[str] - profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): - if api_version == '2020-06-30' or api_version == '2020-06-30-Preview': - base_url = '{endpoint}/indexes(\'{indexName}\')' - else: - raise ValueError("API version {} is not available".format(api_version)) + # type: (...) -> None + base_url = '{endpoint}/indexes(\'{indexName}\')' self._config = SearchClientConfiguration(endpoint, index_name, **kwargs) self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) - super(SearchClient, self).__init__( - api_version=api_version, - profile=profile - ) - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: + self.documents = DocumentsOperations( + self._client, self._config, self._serialize, self._deserialize) - * 2020-06-30: :mod:`v2020_06.models` - * 2020-06-30-Preview: :mod:`v2020_06_preview.models` - """ - if api_version == '2020-06-30': - from .v2020_06 import models - return models - elif api_version == '2020-06-30-Preview': - from .v2020_06_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def documents(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`DocumentsOperations` - * 2020-06-30-Preview: :class:`DocumentsOperations` + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :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.pipeline.transport.HttpResponse """ - api_version = self._get_api_version('documents') - if api_version == '2020-06-30': - from .v2020_06.operations import DocumentsOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from .v2020_06_preview.operations import DocumentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'documents'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + 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'), + } + 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 self._client.close() + def __enter__(self): + # type: () -> SearchClient self._client.__enter__() return self + def __exit__(self, *exc_details): + # type: (Any) -> None self._client.__exit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/_version.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/_version.py deleted file mode 100644 index a30a458f8b5b..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/_version.py +++ /dev/null @@ -1,8 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_configuration.py index ef12238e85c5..07e344b9c7df 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_configuration.py @@ -1,19 +1,17 @@ # 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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- + from typing import Any from azure.core.configuration import Configuration from azure.core.pipeline import policies -from .._version import VERSION +VERSION = "unknown" class SearchClientConfiguration(Configuration): """Configuration for SearchClient. @@ -31,7 +29,7 @@ def __init__( self, endpoint: str, index_name: str, - **kwargs # type: Any + **kwargs: Any ) -> None: if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") @@ -41,7 +39,8 @@ def __init__( self.endpoint = endpoint self.index_name = index_name - kwargs.setdefault('sdk_moniker', 'azure-search-documents/{}'.format(VERSION)) + self.api_version = "2020-06-30-Preview" + kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py index 0ed5830a3b77..7799d633940a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py @@ -1,119 +1,75 @@ # 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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional +from typing import Any from azure.core import AsyncPipelineClient from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin from msrest import Deserializer, Serializer from ._configuration import SearchClientConfiguration +from .operations import DocumentsOperations +from .. import models -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass -class SearchClient(MultiApiClientMixin, _SDKClient): +class SearchClient(object): """Client that can be used to query an index and upload, merge, or delete documents. - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - + :ivar documents: DocumentsOperations operations + :vartype documents: azure.search.documents.aio.operations.DocumentsOperations :param endpoint: The endpoint URL of the search service. :type endpoint: str :param index_name: The name of the index. :type index_name: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2020-06-30-Preview' - _PROFILE_TAG = "azure.search.documents.SearchClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - }}, - _PROFILE_TAG + " latest" - ) - def __init__( self, endpoint: str, index_name: str, - api_version: Optional[str] = None, - profile: KnownProfiles = KnownProfiles.default, - **kwargs # type: Any + **kwargs: Any ) -> None: - if api_version == '2020-06-30' or api_version == '2020-06-30-Preview': - base_url = '{endpoint}/indexes(\'{indexName}\')' - else: - raise ValueError("API version {} is not available".format(api_version)) + base_url = '{endpoint}/indexes(\'{indexName}\')' self._config = SearchClientConfiguration(endpoint, index_name, **kwargs) self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(SearchClient, self).__init__( - api_version=api_version, - profile=profile - ) - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: + self.documents = DocumentsOperations( + self._client, self._config, self._serialize, self._deserialize) - * 2020-06-30: :mod:`v2020_06.models` - * 2020-06-30-Preview: :mod:`v2020_06_preview.models` - """ - if api_version == '2020-06-30': - from ..v2020_06 import models - return models - elif api_version == '2020-06-30-Preview': - from ..v2020_06_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. - @property - def documents(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`DocumentsOperations` - * 2020-06-30-Preview: :class:`DocumentsOperations` + :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.pipeline.transport.AsyncHttpResponse """ - api_version = self._get_api_version('documents') - if api_version == '2020-06-30': - from ..v2020_06.aio.operations import DocumentsOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from ..v2020_06_preview.aio.operations import DocumentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'documents'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + 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'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response - async def close(self): + async def close(self) -> None: await self._client.close() - async def __aenter__(self): + + async def __aenter__(self) -> "SearchClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details): + + async def __aexit__(self, *exc_details) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/operations/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/__init__.py similarity index 100% rename from sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/operations/__init__.py rename to sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/__init__.py diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/operations/_documents_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py index 509e89d1e6ff..770f0a9c3b12 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/operations/_documents_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py @@ -24,7 +24,7 @@ class DocumentsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.v2020_06_preview.models + :type models: ~azure.search.documents.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -47,7 +47,7 @@ async def count( """Queries the number of documents in the index. :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: long, or the result of cls(response) :rtype: long @@ -113,12 +113,12 @@ async def search_get( match all documents. :type search_text: str :param search_options: Parameter group. - :type search_options: ~azure.search.documents.v2020_06_preview.models.SearchOptions + :type search_options: ~azure.search.documents.models.SearchOptions :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SearchDocumentsResult + :rtype: ~azure.search.documents.models.SearchDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] @@ -264,12 +264,12 @@ async def search_post( """Searches for documents in the index. :param search_request: The definition of the Search request. - :type search_request: ~azure.search.documents.v2020_06_preview.models.SearchRequest + :type search_request: ~azure.search.documents.models.SearchRequest :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SearchDocumentsResult + :rtype: ~azure.search.documents.models.SearchDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] @@ -339,7 +339,7 @@ async def get( retrieved will be missing from the returned document. :type selected_fields: list[str] :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: object, or the result of cls(response) :rtype: object @@ -412,12 +412,12 @@ async def suggest_get( that's part of the index definition. :type suggester_name: str :param suggest_options: Parameter group. - :type suggest_options: ~azure.search.documents.v2020_06_preview.models.SuggestOptions + :type suggest_options: ~azure.search.documents.models.SuggestOptions :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SuggestDocumentsResult + :rtype: ~azure.search.documents.models.SuggestDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] @@ -515,12 +515,12 @@ async def suggest_post( """Suggests documents in the index that match the given partial query text. :param suggest_request: The Suggest request. - :type suggest_request: ~azure.search.documents.v2020_06_preview.models.SuggestRequest + :type suggest_request: ~azure.search.documents.models.SuggestRequest :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SuggestDocumentsResult + :rtype: ~azure.search.documents.models.SuggestDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] @@ -584,12 +584,12 @@ async def index( """Sends a batch of document write actions to the index. :param actions: The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06_preview.models.IndexAction] + :type actions: list[~azure.search.documents.models.IndexAction] :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: IndexDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.IndexDocumentsResult + :rtype: ~azure.search.documents.models.IndexDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IndexDocumentsResult"] @@ -666,12 +666,12 @@ async def autocomplete_get( that's part of the index definition. :type suggester_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :param autocomplete_options: Parameter group. - :type autocomplete_options: ~azure.search.documents.v2020_06_preview.models.AutocompleteOptions + :type autocomplete_options: ~azure.search.documents.models.AutocompleteOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.AutocompleteResult + :rtype: ~azure.search.documents.models.AutocompleteResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] @@ -765,12 +765,12 @@ async def autocomplete_post( """Autocompletes incomplete query terms based on input text and matching terms in the index. :param autocomplete_request: The definition of the Autocomplete request. - :type autocomplete_request: ~azure.search.documents.v2020_06_preview.models.AutocompleteRequest + :type autocomplete_request: ~azure.search.documents.models.AutocompleteRequest :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.AutocompleteResult + :rtype: ~azure.search.documents.models.AutocompleteResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/models.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models.py deleted file mode 100644 index a85a4800fedc..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/models.py +++ /dev/null @@ -1,7 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -from .v2020_06_preview.models import * diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/__init__.py similarity index 100% rename from sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/__init__.py rename to sdk/search/azure-search-documents/azure/search/documents/_generated/models/__init__.py diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py similarity index 95% rename from sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/_models.py rename to sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py index 159ad824433d..54743d7d58ad 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py @@ -95,8 +95,7 @@ class AutocompleteOptions(msrest.serialization.Model): :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or - ~azure.search.documents.v2020_06_preview.models.AutocompleteMode + :type autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode :param filter: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. :type filter: str @@ -161,8 +160,7 @@ class AutocompleteRequest(msrest.serialization.Model): :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or - ~azure.search.documents.v2020_06_preview.models.AutocompleteMode + :type autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode :param filter: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. :type filter: str @@ -240,7 +238,7 @@ class AutocompleteResult(msrest.serialization.Model): autocomplete request, or null if minimumCoverage was not specified in the request. :vartype coverage: float :ivar results: Required. The list of returned Autocompleted items. - :vartype results: list[~azure.search.documents.v2020_06_preview.models.AutocompleteItem] + :vartype results: list[~azure.search.documents.models.AutocompleteItem] """ _validation = { @@ -338,7 +336,7 @@ class IndexAction(msrest.serialization.Model): :type additional_properties: dict[str, object] :param action_type: The operation to perform on a document in an indexing batch. Possible values include: "upload", "merge", "mergeOrUpload", "delete". - :type action_type: str or ~azure.search.documents.v2020_06_preview.models.IndexActionType + :type action_type: str or ~azure.search.documents.models.IndexActionType """ _attribute_map = { @@ -361,7 +359,7 @@ class IndexBatch(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param actions: Required. The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06_preview.models.IndexAction] + :type actions: list[~azure.search.documents.models.IndexAction] """ _validation = { @@ -389,7 +387,7 @@ class IndexDocumentsResult(msrest.serialization.Model): :ivar results: Required. The list of status information for each document in the indexing request. - :vartype results: list[~azure.search.documents.v2020_06_preview.models.IndexingResult] + :vartype results: list[~azure.search.documents.models.IndexingResult] """ _validation = { @@ -491,17 +489,17 @@ class SearchDocumentsResult(msrest.serialization.Model): :vartype coverage: float :ivar facets: The facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not include any facet expressions. - :vartype facets: dict[str, list[~azure.search.documents.v2020_06_preview.models.FacetResult]] + :vartype facets: dict[str, list[~azure.search.documents.models.FacetResult]] :ivar answers: The answers query results for the search operation; null if the answers query parameter was not specified or set to 'none'. - :vartype answers: dict[str, list[~azure.search.documents.v2020_06_preview.models.AnswerResult]] + :vartype answers: list[~azure.search.documents.models.AnswerResult] :ivar next_page_parameters: Continuation JSON payload returned when Azure Cognitive Search can't return all the requested results in a single Search response. You can use this JSON along with @odata.nextLink to formulate another POST Search request to get the next part of the search response. - :vartype next_page_parameters: ~azure.search.documents.v2020_06_preview.models.SearchRequest + :vartype next_page_parameters: ~azure.search.documents.models.SearchRequest :ivar results: Required. The sequence of results returned by the query. - :vartype results: list[~azure.search.documents.v2020_06_preview.models.SearchResult] + :vartype results: list[~azure.search.documents.models.SearchResult] :ivar next_link: Continuation URL returned when Azure Cognitive Search can't return all the requested results in a single Search response. You can use this URL to formulate another GET or POST Search request to get the next part of the search response. Make sure to use the same verb @@ -555,7 +553,7 @@ class SearchError(msrest.serialization.Model): :ivar message: Required. A human-readable representation of the error. :vartype message: str :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.search.documents.v2020_06_preview.models.SearchError] + :vartype details: list[~azure.search.documents.models.SearchError] """ _validation = { @@ -617,7 +615,7 @@ class SearchOptions(msrest.serialization.Model): :param query_type: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: "simple", "full", "semantic". - :type query_type: str or ~azure.search.documents.v2020_06_preview.models.QueryType + :type query_type: str or ~azure.search.documents.models.QueryType :param scoring_parameters: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be @@ -631,24 +629,23 @@ class SearchOptions(msrest.serialization.Model): each fielded search expression take precedence over any field names listed in this parameter. :type search_fields: list[str] :param query_language: The language of the query. Possible values include: "none", "en-us". - :type query_language: str or ~azure.search.documents.v2020_06_preview.models.QueryLanguage + :type query_language: str or ~azure.search.documents.models.QueryLanguage :param speller: Improve search recall by spell-correcting individual search query terms. Possible values include: "none", "lexicon". - :type speller: str or ~azure.search.documents.v2020_06_preview.models.Speller + :type speller: str or ~azure.search.documents.models.Speller :param answers: This parameter is only valid if the query type is 'semantic'. If set, the query returns answers extracted from key passages in the highest ranked documents. The number of answers returned can be configured by appending the pipe character '|' followed by the 'count-:code:``' option after the answers parameter value, such as 'extractive|count-3'. Default count is 1. Possible values include: "none", "extractive". - :type answers: str or ~azure.search.documents.v2020_06_preview.models.Answers + :type answers: str or ~azure.search.documents.models.Answers :param search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.v2020_06_preview.models.SearchMode + :type search_mode: str or ~azure.search.documents.models.SearchMode :param scoring_statistics: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. Possible values include: "local", "global". - :type scoring_statistics: str or - ~azure.search.documents.v2020_06_preview.models.ScoringStatistics + :type scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics :param session_id: A value to be used to create a sticky session, which can help to get more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can @@ -759,14 +756,13 @@ class SearchRequest(msrest.serialization.Model): :param query_type: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: "simple", "full", "semantic". - :type query_type: str or ~azure.search.documents.v2020_06_preview.models.QueryType + :type query_type: str or ~azure.search.documents.models.QueryType :param scoring_statistics: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries. Possible values include: "local", "global". - :type scoring_statistics: str or - ~azure.search.documents.v2020_06_preview.models.ScoringStatistics + :type scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics :param session_id: A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can @@ -792,16 +788,16 @@ class SearchRequest(msrest.serialization.Model): :type search_fields: str :param search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.v2020_06_preview.models.SearchMode + :type search_mode: str or ~azure.search.documents.models.SearchMode :param query_language: A value that specifies the language of the search query. Possible values include: "none", "en-us". - :type query_language: str or ~azure.search.documents.v2020_06_preview.models.QueryLanguage + :type query_language: str or ~azure.search.documents.models.QueryLanguage :param speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". - :type speller: str or ~azure.search.documents.v2020_06_preview.models.Speller + :type speller: str or ~azure.search.documents.models.Speller :param answers: A value that specifies whether answers should be returned as part of the search response. Possible values include: "none", "extractive". - :type answers: str or ~azure.search.documents.v2020_06_preview.models.Answers + :type answers: str or ~azure.search.documents.models.Answers :param select: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. :type select: str @@ -893,8 +889,7 @@ class SearchResult(msrest.serialization.Model): :ivar captions: Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'. - :vartype captions: dict[str, - list[~azure.search.documents.v2020_06_preview.models.CaptionResult]] + :vartype captions: list[~azure.search.documents.models.CaptionResult] """ _validation = { @@ -932,7 +927,7 @@ class SuggestDocumentsResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar results: Required. The sequence of results returned by the query. - :vartype results: list[~azure.search.documents.v2020_06_preview.models.SuggestResult] + :vartype results: list[~azure.search.documents.models.SuggestResult] :ivar coverage: A value indicating the percentage of the index that was included in the query, or null if minimumCoverage was not set in the request. :vartype coverage: float diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/_models_py3.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py similarity index 96% rename from sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/_models_py3.py rename to sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py index d33c4e5d01e5..df3ac3250f96 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/_models_py3.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py @@ -101,8 +101,7 @@ class AutocompleteOptions(msrest.serialization.Model): :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or - ~azure.search.documents.v2020_06_preview.models.AutocompleteMode + :type autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode :param filter: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. :type filter: str @@ -176,8 +175,7 @@ class AutocompleteRequest(msrest.serialization.Model): :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or - ~azure.search.documents.v2020_06_preview.models.AutocompleteMode + :type autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode :param filter: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. :type filter: str @@ -266,7 +264,7 @@ class AutocompleteResult(msrest.serialization.Model): autocomplete request, or null if minimumCoverage was not specified in the request. :vartype coverage: float :ivar results: Required. The list of returned Autocompleted items. - :vartype results: list[~azure.search.documents.v2020_06_preview.models.AutocompleteItem] + :vartype results: list[~azure.search.documents.models.AutocompleteItem] """ _validation = { @@ -368,7 +366,7 @@ class IndexAction(msrest.serialization.Model): :type additional_properties: dict[str, object] :param action_type: The operation to perform on a document in an indexing batch. Possible values include: "upload", "merge", "mergeOrUpload", "delete". - :type action_type: str or ~azure.search.documents.v2020_06_preview.models.IndexActionType + :type action_type: str or ~azure.search.documents.models.IndexActionType """ _attribute_map = { @@ -394,7 +392,7 @@ class IndexBatch(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param actions: Required. The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06_preview.models.IndexAction] + :type actions: list[~azure.search.documents.models.IndexAction] """ _validation = { @@ -424,7 +422,7 @@ class IndexDocumentsResult(msrest.serialization.Model): :ivar results: Required. The list of status information for each document in the indexing request. - :vartype results: list[~azure.search.documents.v2020_06_preview.models.IndexingResult] + :vartype results: list[~azure.search.documents.models.IndexingResult] """ _validation = { @@ -528,17 +526,17 @@ class SearchDocumentsResult(msrest.serialization.Model): :vartype coverage: float :ivar facets: The facet query results for the search operation, organized as a collection of buckets for each faceted field; null if the query did not include any facet expressions. - :vartype facets: dict[str, list[~azure.search.documents.v2020_06_preview.models.FacetResult]] + :vartype facets: dict[str, list[~azure.search.documents.models.FacetResult]] :ivar answers: The answers query results for the search operation; null if the answers query parameter was not specified or set to 'none'. - :vartype answers: dict[str, list[~azure.search.documents.v2020_06_preview.models.AnswerResult]] + :vartype answers: list[~azure.search.documents.models.AnswerResult] :ivar next_page_parameters: Continuation JSON payload returned when Azure Cognitive Search can't return all the requested results in a single Search response. You can use this JSON along with @odata.nextLink to formulate another POST Search request to get the next part of the search response. - :vartype next_page_parameters: ~azure.search.documents.v2020_06_preview.models.SearchRequest + :vartype next_page_parameters: ~azure.search.documents.models.SearchRequest :ivar results: Required. The sequence of results returned by the query. - :vartype results: list[~azure.search.documents.v2020_06_preview.models.SearchResult] + :vartype results: list[~azure.search.documents.models.SearchResult] :ivar next_link: Continuation URL returned when Azure Cognitive Search can't return all the requested results in a single Search response. You can use this URL to formulate another GET or POST Search request to get the next part of the search response. Make sure to use the same verb @@ -592,7 +590,7 @@ class SearchError(msrest.serialization.Model): :ivar message: Required. A human-readable representation of the error. :vartype message: str :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.search.documents.v2020_06_preview.models.SearchError] + :vartype details: list[~azure.search.documents.models.SearchError] """ _validation = { @@ -654,7 +652,7 @@ class SearchOptions(msrest.serialization.Model): :param query_type: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: "simple", "full", "semantic". - :type query_type: str or ~azure.search.documents.v2020_06_preview.models.QueryType + :type query_type: str or ~azure.search.documents.models.QueryType :param scoring_parameters: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be @@ -668,24 +666,23 @@ class SearchOptions(msrest.serialization.Model): each fielded search expression take precedence over any field names listed in this parameter. :type search_fields: list[str] :param query_language: The language of the query. Possible values include: "none", "en-us". - :type query_language: str or ~azure.search.documents.v2020_06_preview.models.QueryLanguage + :type query_language: str or ~azure.search.documents.models.QueryLanguage :param speller: Improve search recall by spell-correcting individual search query terms. Possible values include: "none", "lexicon". - :type speller: str or ~azure.search.documents.v2020_06_preview.models.Speller + :type speller: str or ~azure.search.documents.models.Speller :param answers: This parameter is only valid if the query type is 'semantic'. If set, the query returns answers extracted from key passages in the highest ranked documents. The number of answers returned can be configured by appending the pipe character '|' followed by the 'count-:code:``' option after the answers parameter value, such as 'extractive|count-3'. Default count is 1. Possible values include: "none", "extractive". - :type answers: str or ~azure.search.documents.v2020_06_preview.models.Answers + :type answers: str or ~azure.search.documents.models.Answers :param search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.v2020_06_preview.models.SearchMode + :type search_mode: str or ~azure.search.documents.models.SearchMode :param scoring_statistics: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. Possible values include: "local", "global". - :type scoring_statistics: str or - ~azure.search.documents.v2020_06_preview.models.ScoringStatistics + :type scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics :param session_id: A value to be used to create a sticky session, which can help to get more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can @@ -818,14 +815,13 @@ class SearchRequest(msrest.serialization.Model): :param query_type: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: "simple", "full", "semantic". - :type query_type: str or ~azure.search.documents.v2020_06_preview.models.QueryType + :type query_type: str or ~azure.search.documents.models.QueryType :param scoring_statistics: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries. Possible values include: "local", "global". - :type scoring_statistics: str or - ~azure.search.documents.v2020_06_preview.models.ScoringStatistics + :type scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics :param session_id: A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can @@ -851,16 +847,16 @@ class SearchRequest(msrest.serialization.Model): :type search_fields: str :param search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.v2020_06_preview.models.SearchMode + :type search_mode: str or ~azure.search.documents.models.SearchMode :param query_language: A value that specifies the language of the search query. Possible values include: "none", "en-us". - :type query_language: str or ~azure.search.documents.v2020_06_preview.models.QueryLanguage + :type query_language: str or ~azure.search.documents.models.QueryLanguage :param speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". - :type speller: str or ~azure.search.documents.v2020_06_preview.models.Speller + :type speller: str or ~azure.search.documents.models.Speller :param answers: A value that specifies whether answers should be returned as part of the search response. Possible values include: "none", "extractive". - :type answers: str or ~azure.search.documents.v2020_06_preview.models.Answers + :type answers: str or ~azure.search.documents.models.Answers :param select: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. :type select: str @@ -975,8 +971,7 @@ class SearchResult(msrest.serialization.Model): :ivar captions: Captions are the most representative passages from the document relatively to the search query. They are often used as document summary. Captions are only returned for queries of type 'semantic'. - :vartype captions: dict[str, - list[~azure.search.documents.v2020_06_preview.models.CaptionResult]] + :vartype captions: list[~azure.search.documents.models.CaptionResult] """ _validation = { @@ -1016,7 +1011,7 @@ class SuggestDocumentsResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar results: Required. The sequence of results returned by the query. - :vartype results: list[~azure.search.documents.v2020_06_preview.models.SuggestResult] + :vartype results: list[~azure.search.documents.models.SuggestResult] :ivar coverage: A value indicating the percentage of the index that was included in the query, or null if minimumCoverage was not set in the request. :vartype coverage: float diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/_search_client_enums.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py similarity index 100% rename from sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/models/_search_client_enums.py rename to sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/operations/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/operations/__init__.py similarity index 100% rename from sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/operations/__init__.py rename to sdk/search/azure-search-documents/azure/search/documents/_generated/operations/__init__.py diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/operations/_documents_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/operations/_documents_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/_generated/operations/_documents_operations.py index 19934c6a83f3..e1b20475293a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/operations/_documents_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/operations/_documents_operations.py @@ -28,7 +28,7 @@ class DocumentsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.v2020_06_preview.models + :type models: ~azure.search.documents.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -52,7 +52,7 @@ def count( """Queries the number of documents in the index. :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: long, or the result of cls(response) :rtype: long @@ -119,12 +119,12 @@ def search_get( match all documents. :type search_text: str :param search_options: Parameter group. - :type search_options: ~azure.search.documents.v2020_06_preview.models.SearchOptions + :type search_options: ~azure.search.documents.models.SearchOptions :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SearchDocumentsResult + :rtype: ~azure.search.documents.models.SearchDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] @@ -271,12 +271,12 @@ def search_post( """Searches for documents in the index. :param search_request: The definition of the Search request. - :type search_request: ~azure.search.documents.v2020_06_preview.models.SearchRequest + :type search_request: ~azure.search.documents.models.SearchRequest :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SearchDocumentsResult + :rtype: ~azure.search.documents.models.SearchDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] @@ -347,7 +347,7 @@ def get( retrieved will be missing from the returned document. :type selected_fields: list[str] :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: object, or the result of cls(response) :rtype: object @@ -421,12 +421,12 @@ def suggest_get( that's part of the index definition. :type suggester_name: str :param suggest_options: Parameter group. - :type suggest_options: ~azure.search.documents.v2020_06_preview.models.SuggestOptions + :type suggest_options: ~azure.search.documents.models.SuggestOptions :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SuggestDocumentsResult + :rtype: ~azure.search.documents.models.SuggestDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] @@ -525,12 +525,12 @@ def suggest_post( """Suggests documents in the index that match the given partial query text. :param suggest_request: The Suggest request. - :type suggest_request: ~azure.search.documents.v2020_06_preview.models.SuggestRequest + :type suggest_request: ~azure.search.documents.models.SuggestRequest :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SuggestDocumentsResult + :rtype: ~azure.search.documents.models.SuggestDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] @@ -595,12 +595,12 @@ def index( """Sends a batch of document write actions to the index. :param actions: The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06_preview.models.IndexAction] + :type actions: list[~azure.search.documents.models.IndexAction] :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: IndexDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.IndexDocumentsResult + :rtype: ~azure.search.documents.models.IndexDocumentsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IndexDocumentsResult"] @@ -678,12 +678,12 @@ def autocomplete_get( that's part of the index definition. :type suggester_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :param autocomplete_options: Parameter group. - :type autocomplete_options: ~azure.search.documents.v2020_06_preview.models.AutocompleteOptions + :type autocomplete_options: ~azure.search.documents.models.AutocompleteOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.AutocompleteResult + :rtype: ~azure.search.documents.models.AutocompleteResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] @@ -778,12 +778,12 @@ def autocomplete_post( """Autocompletes incomplete query terms based on input text and matching terms in the index. :param autocomplete_request: The definition of the Autocomplete request. - :type autocomplete_request: ~azure.search.documents.v2020_06_preview.models.AutocompleteRequest + :type autocomplete_request: ~azure.search.documents.models.AutocompleteRequest :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.AutocompleteResult + :rtype: ~azure.search.documents.models.AutocompleteResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/__init__.py deleted file mode 100644 index d58f5fc3b7f8..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._search_client import SearchClient -__all__ = ['SearchClient'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_configuration.py deleted file mode 100644 index fddf92d233ee..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_configuration.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -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 - -VERSION = "unknown" - -class SearchClientConfiguration(Configuration): - """Configuration for SearchClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - :param index_name: The name of the index. - :type index_name: str - """ - - def __init__( - self, - endpoint, # type: str - index_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - 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 = "2020-06-30" - kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - 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') diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_metadata.json b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_metadata.json deleted file mode 100644 index ad660b070241..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_metadata.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "chosen_version": "2020-06-30", - "total_api_version_list": ["2020-06-30"], - "client": { - "name": "SearchClient", - "filename": "_search_client", - "description": "Client that can be used to query an index and upload, merge, or delete documents.", - "base_url": null, - "custom_base_url": "\u0027{endpoint}/indexes(\\\u0027{indexName}\\\u0027)\u0027", - "azure_arm": false, - "has_lro_operations": false, - "client_side_validation": false, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"SearchClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"SearchClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "global_parameters": { - "sync": { - "endpoint": { - "signature": "endpoint, # type: str", - "description": "The endpoint URL of the search service.", - "docstring_type": "str", - "required": true - }, - "index_name": { - "signature": "index_name, # type: str", - "description": "The name of the index.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "endpoint": { - "signature": "endpoint: str,", - "description": "The endpoint URL of the search service.", - "docstring_type": "str", - "required": true - }, - "index_name": { - "signature": "index_name: str,", - "description": "The name of the index.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "endpoint, index_name", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": false, - "credential_scopes": null, - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}" - }, - "operation_groups": { - "documents": "DocumentsOperations" - }, - "operation_mixins": { - "sync_imports": "None", - "async_imports": "None", - "operations": { - } - } -} \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_search_client.py deleted file mode 100644 index 5f5703c8a1db..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/_search_client.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core import PipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - 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. - - :ivar documents: DocumentsOperations operations - :vartype documents: azure.search.documents.v2020_06.operations.DocumentsOperations - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - :param index_name: The name of the index. - :type index_name: 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, 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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.documents = DocumentsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse - """Runs the network request through the client's chained policies. - - :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.pipeline.transport.HttpResponse - """ - 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'), - } - 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 - self._client.close() - - def __enter__(self): - # type: () -> SearchClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/__init__.py deleted file mode 100644 index ec41d54fc046..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._search_client import SearchClient -__all__ = ['SearchClient'] diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/_configuration.py deleted file mode 100644 index 9d23ae394f82..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/_configuration.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies - -VERSION = "unknown" - -class SearchClientConfiguration(Configuration): - """Configuration for SearchClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - :param index_name: The name of the index. - :type index_name: str - """ - - def __init__( - self, - endpoint: str, - index_name: str, - **kwargs: Any - ) -> None: - 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 = "2020-06-30" - kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> 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.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/_search_client.py deleted file mode 100644 index 4fbbb31f1b54..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/_search_client.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any - -from azure.core import AsyncPipelineClient -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from msrest import Deserializer, Serializer - -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. - - :ivar documents: DocumentsOperations operations - :vartype documents: azure.search.documents.v2020_06.aio.operations.DocumentsOperations - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - :param index_name: The name of the index. - :type index_name: str - """ - - def __init__( - self, - endpoint: str, - index_name: str, - **kwargs: Any - ) -> None: - base_url = '{endpoint}/indexes(\'{indexName}\')' - self._config = SearchClientConfiguration(endpoint, index_name, **kwargs) - self._client = AsyncPipelineClient(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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.documents = DocumentsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: - """Runs the network request through the client's chained policies. - - :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.pipeline.transport.AsyncHttpResponse - """ - 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'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "SearchClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/operations/_documents_operations.py deleted file mode 100644 index 0152a36cdd8e..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/aio/operations/_documents_operations.py +++ /dev/null @@ -1,814 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DocumentsOperations: - """DocumentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def count( - self, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> int: - """Queries the number of documents in the index. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: long, or the result of cls(response) - :rtype: long - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[int] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.count.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('long', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - count.metadata = {'url': '/docs/$count'} # type: ignore - - async def search_get( - self, - search_text: Optional[str] = None, - search_options: Optional["_models.SearchOptions"] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchDocumentsResult": - """Searches for documents in the index. - - :param search_text: A full-text search query expression; Use "*" or omit this parameter to - match all documents. - :type search_text: str - :param search_options: Parameter group. - :type search_options: ~azure.search.documents.v2020_06.models.SearchOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _include_total_result_count = None - _facets = None - _filter = None - _highlight_fields = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _query_type = None - _scoring_parameters = None - _scoring_profile = None - _search_fields = None - _search_mode = None - _scoring_statistics = None - _session_id = None - _select = None - _skip = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if search_options is not None: - _include_total_result_count = search_options.include_total_result_count - _facets = search_options.facets - _filter = search_options.filter - _highlight_fields = search_options.highlight_fields - _highlight_post_tag = search_options.highlight_post_tag - _highlight_pre_tag = search_options.highlight_pre_tag - _minimum_coverage = search_options.minimum_coverage - _order_by = search_options.order_by - _query_type = search_options.query_type - _scoring_parameters = search_options.scoring_parameters - _scoring_profile = search_options.scoring_profile - _search_fields = search_options.search_fields - _search_mode = search_options.search_mode - _scoring_statistics = search_options.scoring_statistics - _session_id = search_options.session_id - _select = search_options.select - _skip = search_options.skip - _top = search_options.top - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.search_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if search_text is not None: - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - if _include_total_result_count is not None: - query_parameters['$count'] = self._serialize.query("include_total_result_count", _include_total_result_count, 'bool') - if _facets is not None: - query_parameters['facet'] = [self._serialize.query("facets", q, 'str') if q is not None else '' for q in _facets] - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _highlight_fields is not None: - query_parameters['highlight'] = self._serialize.query("highlight_fields", _highlight_fields, '[str]', div=',') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _query_type is not None: - query_parameters['queryType'] = self._serialize.query("query_type", _query_type, 'str') - if _scoring_parameters is not None: - query_parameters['scoringParameter'] = [self._serialize.query("scoring_parameters", q, 'str') if q is not None else '' for q in _scoring_parameters] - if _scoring_profile is not None: - query_parameters['scoringProfile'] = self._serialize.query("scoring_profile", _scoring_profile, 'str') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _search_mode is not None: - query_parameters['searchMode'] = self._serialize.query("search_mode", _search_mode, 'str') - if _scoring_statistics is not None: - query_parameters['scoringStatistics'] = self._serialize.query("scoring_statistics", _scoring_statistics, 'str') - if _session_id is not None: - query_parameters['sessionId'] = self._serialize.query("session_id", _session_id, 'str') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", _skip, 'int') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_get.metadata = {'url': '/docs'} # type: ignore - - async def search_post( - self, - search_request: "_models.SearchRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchDocumentsResult": - """Searches for documents in the index. - - :param search_request: The definition of the Search request. - :type search_request: ~azure.search.documents.v2020_06.models.SearchRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.search_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(search_request, 'SearchRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_post.metadata = {'url': '/docs/search.post.search'} # type: ignore - - async def get( - self, - key: str, - selected_fields: Optional[List[str]] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> object: - """Retrieves a document from the index. - - :param key: The key of the document to retrieve. - :type key: str - :param selected_fields: List of field names to retrieve for the document; Any field not - retrieved will be missing from the returned document. - :type selected_fields: list[str] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: object, or the result of cls(response) - :rtype: object - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[object] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'key': self._serialize.url("key", key, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if selected_fields is not None: - query_parameters['$select'] = self._serialize.query("selected_fields", selected_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('object', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/docs(\'{key}\')'} # type: ignore - - async def suggest_get( - self, - search_text: str, - suggester_name: str, - suggest_options: Optional["_models.SuggestOptions"] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SuggestDocumentsResult": - """Suggests documents in the index that match the given partial query text. - - :param search_text: The search text to use to suggest documents. Must be at least 1 character, - and no more than 100 characters. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param suggest_options: Parameter group. - :type suggest_options: ~azure.search.documents.v2020_06.models.SuggestOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _search_fields = None - _select = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if suggest_options is not None: - _filter = suggest_options.filter - _use_fuzzy_matching = suggest_options.use_fuzzy_matching - _highlight_post_tag = suggest_options.highlight_post_tag - _highlight_pre_tag = suggest_options.highlight_pre_tag - _minimum_coverage = suggest_options.minimum_coverage - _order_by = suggest_options.order_by - _search_fields = suggest_options.search_fields - _select = suggest_options.select - _top = suggest_options.top - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.suggest_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_get.metadata = {'url': '/docs/search.suggest'} # type: ignore - - async def suggest_post( - self, - suggest_request: "_models.SuggestRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SuggestDocumentsResult": - """Suggests documents in the index that match the given partial query text. - - :param suggest_request: The Suggest request. - :type suggest_request: ~azure.search.documents.v2020_06.models.SuggestRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.suggest_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(suggest_request, 'SuggestRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_post.metadata = {'url': '/docs/search.post.suggest'} # type: ignore - - async def index( - self, - actions: List["_models.IndexAction"], - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.IndexDocumentsResult": - """Sends a batch of document write actions to the index. - - :param actions: The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06.models.IndexAction] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IndexDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.IndexDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IndexDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - - _batch = _models.IndexBatch(actions=actions) - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.index.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_batch, 'IndexBatch') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if response.status_code == 207: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - index.metadata = {'url': '/docs/search.index'} # type: ignore - - async def autocomplete_get( - self, - search_text: str, - suggester_name: str, - request_options: Optional["_models.RequestOptions"] = None, - autocomplete_options: Optional["_models.AutocompleteOptions"] = None, - **kwargs - ) -> "_models.AutocompleteResult": - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param search_text: The incomplete term which should be auto-completed. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :param autocomplete_options: Parameter group. - :type autocomplete_options: ~azure.search.documents.v2020_06.models.AutocompleteOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - _autocomplete_mode = None - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _search_fields = None - _top = None - if autocomplete_options is not None: - _autocomplete_mode = autocomplete_options.autocomplete_mode - _filter = autocomplete_options.filter - _use_fuzzy_matching = autocomplete_options.use_fuzzy_matching - _highlight_post_tag = autocomplete_options.highlight_post_tag - _highlight_pre_tag = autocomplete_options.highlight_pre_tag - _minimum_coverage = autocomplete_options.minimum_coverage - _search_fields = autocomplete_options.search_fields - _top = autocomplete_options.top - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.autocomplete_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _autocomplete_mode is not None: - query_parameters['autocompleteMode'] = self._serialize.query("autocomplete_mode", _autocomplete_mode, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_get.metadata = {'url': '/docs/search.autocomplete'} # type: ignore - - async def autocomplete_post( - self, - autocomplete_request: "_models.AutocompleteRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.AutocompleteResult": - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param autocomplete_request: The definition of the Autocomplete request. - :type autocomplete_request: ~azure.search.documents.v2020_06.models.AutocompleteRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.autocomplete_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(autocomplete_request, 'AutocompleteRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_post.metadata = {'url': '/docs/search.post.autocomplete'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/__init__.py deleted file mode 100644 index abb65d224c74..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/__init__.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AutocompleteItem - from ._models_py3 import AutocompleteOptions - from ._models_py3 import AutocompleteRequest - from ._models_py3 import AutocompleteResult - from ._models_py3 import FacetResult - from ._models_py3 import IndexAction - from ._models_py3 import IndexBatch - from ._models_py3 import IndexDocumentsResult - from ._models_py3 import IndexingResult - from ._models_py3 import RequestOptions - from ._models_py3 import SearchDocumentsResult - from ._models_py3 import SearchError - from ._models_py3 import SearchOptions - from ._models_py3 import SearchRequest - from ._models_py3 import SearchResult - from ._models_py3 import SuggestDocumentsResult - from ._models_py3 import SuggestOptions - from ._models_py3 import SuggestRequest - from ._models_py3 import SuggestResult -except (SyntaxError, ImportError): - from ._models import AutocompleteItem # type: ignore - from ._models import AutocompleteOptions # type: ignore - from ._models import AutocompleteRequest # type: ignore - from ._models import AutocompleteResult # type: ignore - from ._models import FacetResult # type: ignore - from ._models import IndexAction # type: ignore - from ._models import IndexBatch # type: ignore - from ._models import IndexDocumentsResult # type: ignore - from ._models import IndexingResult # type: ignore - from ._models import RequestOptions # type: ignore - from ._models import SearchDocumentsResult # type: ignore - from ._models import SearchError # type: ignore - from ._models import SearchOptions # type: ignore - from ._models import SearchRequest # type: ignore - from ._models import SearchResult # type: ignore - from ._models import SuggestDocumentsResult # type: ignore - from ._models import SuggestOptions # type: ignore - from ._models import SuggestRequest # type: ignore - from ._models import SuggestResult # type: ignore - -from ._search_client_enums import ( - AutocompleteMode, - IndexActionType, - QueryType, - ScoringStatistics, - SearchMode, -) - -__all__ = [ - 'AutocompleteItem', - 'AutocompleteOptions', - 'AutocompleteRequest', - 'AutocompleteResult', - 'FacetResult', - 'IndexAction', - 'IndexBatch', - 'IndexDocumentsResult', - 'IndexingResult', - 'RequestOptions', - 'SearchDocumentsResult', - 'SearchError', - 'SearchOptions', - 'SearchRequest', - 'SearchResult', - 'SuggestDocumentsResult', - 'SuggestOptions', - 'SuggestRequest', - 'SuggestResult', - 'AutocompleteMode', - 'IndexActionType', - 'QueryType', - 'ScoringStatistics', - 'SearchMode', -] diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_models.py deleted file mode 100644 index 6c63a1b97280..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_models.py +++ /dev/null @@ -1,1001 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class AutocompleteItem(msrest.serialization.Model): - """The result of Autocomplete requests. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar text: Required. The completed term. - :vartype text: str - :ivar query_plus_text: Required. The query along with the completed term. - :vartype query_plus_text: str - """ - - _validation = { - 'text': {'required': True, 'readonly': True}, - 'query_plus_text': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'query_plus_text': {'key': 'queryPlusText', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AutocompleteItem, self).__init__(**kwargs) - self.text = None - self.query_plus_text = None - - -class AutocompleteOptions(msrest.serialization.Model): - """Parameter group. - - :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use - 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing - auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or ~azure.search.documents.v2020_06.models.AutocompleteMode - :param filter: An OData expression that filters the documents used to produce completed terms - for the Autocomplete result. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the - autocomplete query. Default is false. When set to true, the query will find terms even if - there's a substituted or missing character in the search text. While this provides a better - experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are - slower and consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. If omitted, hit highlighting is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. If omitted, hit highlighting is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by an autocomplete query in order for the query to be reported as a success. - This parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param search_fields: The list of field names to consider when querying for auto-completed - terms. Target fields must be included in the specified suggester. - :type search_fields: list[str] - :param top: The number of auto-completed terms to retrieve. This must be a value between 1 and - 100. The default is 5. - :type top: int - """ - - _attribute_map = { - 'autocomplete_mode': {'key': 'autocompleteMode', 'type': 'str'}, - 'filter': {'key': '$filter', 'type': 'str'}, - 'use_fuzzy_matching': {'key': 'UseFuzzyMatching', 'type': 'bool'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'search_fields': {'key': 'searchFields', 'type': '[str]'}, - 'top': {'key': '$top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(AutocompleteOptions, self).__init__(**kwargs) - self.autocomplete_mode = kwargs.get('autocomplete_mode', None) - self.filter = kwargs.get('filter', None) - self.use_fuzzy_matching = kwargs.get('use_fuzzy_matching', None) - self.highlight_post_tag = kwargs.get('highlight_post_tag', None) - self.highlight_pre_tag = kwargs.get('highlight_pre_tag', None) - self.minimum_coverage = kwargs.get('minimum_coverage', None) - self.search_fields = kwargs.get('search_fields', None) - self.top = kwargs.get('top', None) - - -class AutocompleteRequest(msrest.serialization.Model): - """Parameters for fuzzy matching, and other autocomplete query behaviors. - - All required parameters must be populated in order to send to Azure. - - :param search_text: Required. The search text on which to base autocomplete results. - :type search_text: str - :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use - 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing - auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or ~azure.search.documents.v2020_06.models.AutocompleteMode - :param filter: An OData expression that filters the documents used to produce completed terms - for the Autocomplete result. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the - autocomplete query. Default is false. When set to true, the query will autocomplete terms even - if there's a substituted or missing character in the search text. While this provides a better - experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are - slower and consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. If omitted, hit highlighting is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. If omitted, hit highlighting is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by an autocomplete query in order for the query to be reported as a success. - This parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param search_fields: The comma-separated list of field names to consider when querying for - auto-completed terms. Target fields must be included in the specified suggester. - :type search_fields: str - :param suggester_name: Required. The name of the suggester as specified in the suggesters - collection that's part of the index definition. - :type suggester_name: str - :param top: The number of auto-completed terms to retrieve. This must be a value between 1 and - 100. The default is 5. - :type top: int - """ - - _validation = { - 'search_text': {'required': True}, - 'suggester_name': {'required': True}, - } - - _attribute_map = { - 'search_text': {'key': 'search', 'type': 'str'}, - 'autocomplete_mode': {'key': 'autocompleteMode', 'type': 'str'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'use_fuzzy_matching': {'key': 'fuzzy', 'type': 'bool'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'search_fields': {'key': 'searchFields', 'type': 'str'}, - 'suggester_name': {'key': 'suggesterName', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(AutocompleteRequest, self).__init__(**kwargs) - self.search_text = kwargs['search_text'] - self.autocomplete_mode = kwargs.get('autocomplete_mode', None) - self.filter = kwargs.get('filter', None) - self.use_fuzzy_matching = kwargs.get('use_fuzzy_matching', None) - self.highlight_post_tag = kwargs.get('highlight_post_tag', None) - self.highlight_pre_tag = kwargs.get('highlight_pre_tag', None) - self.minimum_coverage = kwargs.get('minimum_coverage', None) - self.search_fields = kwargs.get('search_fields', None) - self.suggester_name = kwargs['suggester_name'] - self.top = kwargs.get('top', None) - - -class AutocompleteResult(msrest.serialization.Model): - """The result of Autocomplete query. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar coverage: A value indicating the percentage of the index that was considered by the - autocomplete request, or null if minimumCoverage was not specified in the request. - :vartype coverage: float - :ivar results: Required. The list of returned Autocompleted items. - :vartype results: list[~azure.search.documents.v2020_06.models.AutocompleteItem] - """ - - _validation = { - 'coverage': {'readonly': True}, - 'results': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'coverage': {'key': '@search\\.coverage', 'type': 'float'}, - 'results': {'key': 'value', 'type': '[AutocompleteItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AutocompleteResult, self).__init__(**kwargs) - self.coverage = None - self.results = None - - -class FacetResult(msrest.serialization.Model): - """A single bucket of a facet query result. Reports the number of documents with a field value falling within a particular range or having a particular value or interval. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :ivar count: The approximate count of documents falling within the bucket described by this - facet. - :vartype count: long - """ - - _validation = { - 'count': {'readonly': True}, - } - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'count': {'key': 'count', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(FacetResult, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.count = None - - -class IndexAction(msrest.serialization.Model): - """Represents an index action that operates on a document. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :param action_type: The operation to perform on a document in an indexing batch. Possible - values include: "upload", "merge", "mergeOrUpload", "delete". - :type action_type: str or ~azure.search.documents.v2020_06.models.IndexActionType - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'action_type': {'key': '@search\\.action', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexAction, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.action_type = kwargs.get('action_type', None) - - -class IndexBatch(msrest.serialization.Model): - """Contains a batch of document write actions to send to the index. - - All required parameters must be populated in order to send to Azure. - - :param actions: Required. The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06.models.IndexAction] - """ - - _validation = { - 'actions': {'required': True}, - } - - _attribute_map = { - 'actions': {'key': 'value', 'type': '[IndexAction]'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexBatch, self).__init__(**kwargs) - self.actions = kwargs['actions'] - - -class IndexDocumentsResult(msrest.serialization.Model): - """Response containing the status of operations for all documents in the indexing request. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar results: Required. The list of status information for each document in the indexing - request. - :vartype results: list[~azure.search.documents.v2020_06.models.IndexingResult] - """ - - _validation = { - 'results': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'results': {'key': 'value', 'type': '[IndexingResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexDocumentsResult, self).__init__(**kwargs) - self.results = None - - -class IndexingResult(msrest.serialization.Model): - """Status of an indexing operation for a single document. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar key: Required. The key of a document that was in the indexing request. - :vartype key: str - :ivar error_message: The error message explaining why the indexing operation failed for the - document identified by the key; null if indexing succeeded. - :vartype error_message: str - :ivar succeeded: Required. A value indicating whether the indexing operation succeeded for the - document identified by the key. - :vartype succeeded: bool - :ivar status_code: Required. The status code of the indexing operation. Possible values - include: 200 for a successful update or delete, 201 for successful document creation, 400 for a - malformed input document, 404 for document not found, 409 for a version conflict, 422 when the - index is temporarily unavailable, or 503 for when the service is too busy. - :vartype status_code: int - """ - - _validation = { - 'key': {'required': True, 'readonly': True}, - 'error_message': {'readonly': True}, - 'succeeded': {'required': True, 'readonly': True}, - 'status_code': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'succeeded': {'key': 'status', 'type': 'bool'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexingResult, self).__init__(**kwargs) - self.key = None - self.error_message = None - self.succeeded = None - self.status_code = None - - -class RequestOptions(msrest.serialization.Model): - """Parameter group. - - :param x_ms_client_request_id: The tracking ID sent with the request to help with debugging. - :type x_ms_client_request_id: str - """ - - _attribute_map = { - 'x_ms_client_request_id': {'key': 'x-ms-client-request-id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RequestOptions, self).__init__(**kwargs) - self.x_ms_client_request_id = kwargs.get('x_ms_client_request_id', None) - - -class SearchDocumentsResult(msrest.serialization.Model): - """Response containing search results from an index. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar count: The total count of results found by the search operation, or null if the count was - not requested. If present, the count may be greater than the number of results in this - response. This can happen if you use the $top or $skip parameters, or if Azure Cognitive Search - can't return all the requested documents in a single Search response. - :vartype count: long - :ivar coverage: A value indicating the percentage of the index that was included in the query, - or null if minimumCoverage was not specified in the request. - :vartype coverage: float - :ivar facets: The facet query results for the search operation, organized as a collection of - buckets for each faceted field; null if the query did not include any facet expressions. - :vartype facets: dict[str, list[~azure.search.documents.v2020_06.models.FacetResult]] - :ivar next_page_parameters: Continuation JSON payload returned when Azure Cognitive Search - can't return all the requested results in a single Search response. You can use this JSON along - with @odata.nextLink to formulate another POST Search request to get the next part of the - search response. - :vartype next_page_parameters: ~azure.search.documents.v2020_06.models.SearchRequest - :ivar results: Required. The sequence of results returned by the query. - :vartype results: list[~azure.search.documents.v2020_06.models.SearchResult] - :ivar next_link: Continuation URL returned when Azure Cognitive Search can't return all the - requested results in a single Search response. You can use this URL to formulate another GET or - POST Search request to get the next part of the search response. Make sure to use the same verb - (GET or POST) as the request that produced this response. - :vartype next_link: str - """ - - _validation = { - 'count': {'readonly': True}, - 'coverage': {'readonly': True}, - 'facets': {'readonly': True}, - 'next_page_parameters': {'readonly': True}, - 'results': {'required': True, 'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': '@odata\\.count', 'type': 'long'}, - 'coverage': {'key': '@search\\.coverage', 'type': 'float'}, - 'facets': {'key': '@search\\.facets', 'type': '{[FacetResult]}'}, - 'next_page_parameters': {'key': '@search\\.nextPageParameters', 'type': 'SearchRequest'}, - 'results': {'key': 'value', 'type': '[SearchResult]'}, - 'next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchDocumentsResult, self).__init__(**kwargs) - self.count = None - self.coverage = None - self.facets = None - self.next_page_parameters = None - self.results = None - self.next_link = None - - -class SearchError(msrest.serialization.Model): - """Describes an error condition for the Azure Cognitive Search API. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code: One of a server-defined set of error codes. - :vartype code: str - :ivar message: Required. A human-readable representation of the error. - :vartype message: str - :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.search.documents.v2020_06.models.SearchError] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'required': True, 'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[SearchError]'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchError, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None - - -class SearchOptions(msrest.serialization.Model): - """Parameter group. - - :param include_total_result_count: A value that specifies whether to fetch the total count of - results. Default is false. Setting this value to true may have a performance impact. Note that - the count returned is an approximation. - :type include_total_result_count: bool - :param facets: The list of facet expressions to apply to the search query. Each facet - expression contains a field name, optionally followed by a comma-separated list of name:value - pairs. - :type facets: list[str] - :param filter: The OData $filter expression to apply to the search query. - :type filter: str - :param highlight_fields: The list of field names to use for hit highlights. Only searchable - fields can be used for hit highlighting. - :type highlight_fields: list[str] - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. Default is </em>. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. Default is <em>. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a search query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one - replica. The default is 100. - :type minimum_coverage: float - :param order_by: The list of OData $orderby expressions by which to sort the results. Each - expression can be either a field name or a call to either the geo.distance() or the - search.score() functions. Each expression can be followed by asc to indicate ascending, and - desc to indicate descending. The default is ascending order. Ties will be broken by the match - scores of documents. If no OrderBy is specified, the default sort order is descending by - document match score. There can be at most 32 $orderby clauses. - :type order_by: list[str] - :param query_type: A value that specifies the syntax of the search query. The default is - 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: - "simple", "full". - :type query_type: str or ~azure.search.documents.v2020_06.models.QueryType - :param scoring_parameters: The list of parameter values to be used in scoring functions (for - example, referencePointParameter) using the format name-values. For example, if the scoring - profile defines a function with a parameter called 'mylocation' the parameter string would be - "mylocation--122.2,44.8" (without the quotes). - :type scoring_parameters: list[str] - :param scoring_profile: The name of a scoring profile to evaluate match scores for matching - documents in order to sort the results. - :type scoring_profile: str - :param search_fields: The list of field names to which to scope the full-text search. When - using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of - each fielded search expression take precedence over any field names listed in this parameter. - :type search_fields: list[str] - :param search_mode: A value that specifies whether any or all of the search terms must be - matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.v2020_06.models.SearchMode - :param scoring_statistics: A value that specifies whether we want to calculate scoring - statistics (such as document frequency) globally for more consistent scoring, or locally, for - lower latency. Possible values include: "local", "global". - :type scoring_statistics: str or ~azure.search.documents.v2020_06.models.ScoringStatistics - :param session_id: A value to be used to create a sticky session, which can help to get more - consistent results. As long as the same sessionId is used, a best-effort attempt will be made - to target the same replica set. Be wary that reusing the same sessionID values repeatedly can - interfere with the load balancing of the requests across replicas and adversely affect the - performance of the search service. The value used as sessionId cannot start with a '_' - character. - :type session_id: str - :param select: The list of fields to retrieve. If unspecified, all fields marked as retrievable - in the schema are included. - :type select: list[str] - :param skip: The number of search results to skip. This value cannot be greater than 100,000. - If you need to scan documents in sequence, but cannot use $skip due to this limitation, - consider using $orderby on a totally-ordered key and $filter with a range query instead. - :type skip: int - :param top: The number of search results to retrieve. This can be used in conjunction with - $skip to implement client-side paging of search results. If results are truncated due to - server-side paging, the response will include a continuation token that can be used to issue - another Search request for the next page of results. - :type top: int - """ - - _attribute_map = { - 'include_total_result_count': {'key': 'IncludeTotalResultCount', 'type': 'bool'}, - 'facets': {'key': 'Facets', 'type': '[str]'}, - 'filter': {'key': '$filter', 'type': 'str'}, - 'highlight_fields': {'key': 'HighlightFields', 'type': '[str]'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'order_by': {'key': 'OrderBy', 'type': '[str]'}, - 'query_type': {'key': 'queryType', 'type': 'str'}, - 'scoring_parameters': {'key': 'ScoringParameters', 'type': '[str]'}, - 'scoring_profile': {'key': 'scoringProfile', 'type': 'str'}, - 'search_fields': {'key': 'searchFields', 'type': '[str]'}, - 'search_mode': {'key': 'searchMode', 'type': 'str'}, - 'scoring_statistics': {'key': 'scoringStatistics', 'type': 'str'}, - 'session_id': {'key': 'sessionId', 'type': 'str'}, - 'select': {'key': '$select', 'type': '[str]'}, - 'skip': {'key': '$skip', 'type': 'int'}, - 'top': {'key': '$top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchOptions, self).__init__(**kwargs) - self.include_total_result_count = kwargs.get('include_total_result_count', None) - self.facets = kwargs.get('facets', None) - self.filter = kwargs.get('filter', None) - self.highlight_fields = kwargs.get('highlight_fields', None) - self.highlight_post_tag = kwargs.get('highlight_post_tag', None) - self.highlight_pre_tag = kwargs.get('highlight_pre_tag', None) - self.minimum_coverage = kwargs.get('minimum_coverage', None) - self.order_by = kwargs.get('order_by', None) - self.query_type = kwargs.get('query_type', None) - self.scoring_parameters = kwargs.get('scoring_parameters', None) - self.scoring_profile = kwargs.get('scoring_profile', None) - self.search_fields = kwargs.get('search_fields', None) - self.search_mode = kwargs.get('search_mode', None) - self.scoring_statistics = kwargs.get('scoring_statistics', None) - self.session_id = kwargs.get('session_id', None) - self.select = kwargs.get('select', None) - self.skip = kwargs.get('skip', None) - self.top = kwargs.get('top', None) - - -class SearchRequest(msrest.serialization.Model): - """Parameters for filtering, sorting, faceting, paging, and other search query behaviors. - - :param include_total_result_count: A value that specifies whether to fetch the total count of - results. Default is false. Setting this value to true may have a performance impact. Note that - the count returned is an approximation. - :type include_total_result_count: bool - :param facets: The list of facet expressions to apply to the search query. Each facet - expression contains a field name, optionally followed by a comma-separated list of name:value - pairs. - :type facets: list[str] - :param filter: The OData $filter expression to apply to the search query. - :type filter: str - :param highlight_fields: The comma-separated list of field names to use for hit highlights. - Only searchable fields can be used for hit highlighting. - :type highlight_fields: str - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. Default is </em>. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. Default is <em>. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a search query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one - replica. The default is 100. - :type minimum_coverage: float - :param order_by: The comma-separated list of OData $orderby expressions by which to sort the - results. Each expression can be either a field name or a call to either the geo.distance() or - the search.score() functions. Each expression can be followed by asc to indicate ascending, or - desc to indicate descending. The default is ascending order. Ties will be broken by the match - scores of documents. If no $orderby is specified, the default sort order is descending by - document match score. There can be at most 32 $orderby clauses. - :type order_by: str - :param query_type: A value that specifies the syntax of the search query. The default is - 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: - "simple", "full". - :type query_type: str or ~azure.search.documents.v2020_06.models.QueryType - :param scoring_statistics: A value that specifies whether we want to calculate scoring - statistics (such as document frequency) globally for more consistent scoring, or locally, for - lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally - before scoring. Using global scoring statistics can increase latency of search queries. - Possible values include: "local", "global". - :type scoring_statistics: str or ~azure.search.documents.v2020_06.models.ScoringStatistics - :param session_id: A value to be used to create a sticky session, which can help getting more - consistent results. As long as the same sessionId is used, a best-effort attempt will be made - to target the same replica set. Be wary that reusing the same sessionID values repeatedly can - interfere with the load balancing of the requests across replicas and adversely affect the - performance of the search service. The value used as sessionId cannot start with a '_' - character. - :type session_id: str - :param scoring_parameters: The list of parameter values to be used in scoring functions (for - example, referencePointParameter) using the format name-values. For example, if the scoring - profile defines a function with a parameter called 'mylocation' the parameter string would be - "mylocation--122.2,44.8" (without the quotes). - :type scoring_parameters: list[str] - :param scoring_profile: The name of a scoring profile to evaluate match scores for matching - documents in order to sort the results. - :type scoring_profile: str - :param search_text: A full-text search query expression; Use "*" or omit this parameter to - match all documents. - :type search_text: str - :param search_fields: The comma-separated list of field names to which to scope the full-text - search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the - field names of each fielded search expression take precedence over any field names listed in - this parameter. - :type search_fields: str - :param search_mode: A value that specifies whether any or all of the search terms must be - matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.v2020_06.models.SearchMode - :param select: The comma-separated list of fields to retrieve. If unspecified, all fields - marked as retrievable in the schema are included. - :type select: str - :param skip: The number of search results to skip. This value cannot be greater than 100,000. - If you need to scan documents in sequence, but cannot use skip due to this limitation, consider - using orderby on a totally-ordered key and filter with a range query instead. - :type skip: int - :param top: The number of search results to retrieve. This can be used in conjunction with - $skip to implement client-side paging of search results. If results are truncated due to - server-side paging, the response will include a continuation token that can be used to issue - another Search request for the next page of results. - :type top: int - """ - - _attribute_map = { - 'include_total_result_count': {'key': 'count', 'type': 'bool'}, - 'facets': {'key': 'facets', 'type': '[str]'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'highlight_fields': {'key': 'highlight', 'type': 'str'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'order_by': {'key': 'orderby', 'type': 'str'}, - 'query_type': {'key': 'queryType', 'type': 'str'}, - 'scoring_statistics': {'key': 'scoringStatistics', 'type': 'str'}, - 'session_id': {'key': 'sessionId', 'type': 'str'}, - 'scoring_parameters': {'key': 'scoringParameters', 'type': '[str]'}, - 'scoring_profile': {'key': 'scoringProfile', 'type': 'str'}, - 'search_text': {'key': 'search', 'type': 'str'}, - 'search_fields': {'key': 'searchFields', 'type': 'str'}, - 'search_mode': {'key': 'searchMode', 'type': 'str'}, - 'select': {'key': 'select', 'type': 'str'}, - 'skip': {'key': 'skip', 'type': 'int'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchRequest, self).__init__(**kwargs) - self.include_total_result_count = kwargs.get('include_total_result_count', None) - self.facets = kwargs.get('facets', None) - self.filter = kwargs.get('filter', None) - self.highlight_fields = kwargs.get('highlight_fields', None) - self.highlight_post_tag = kwargs.get('highlight_post_tag', None) - self.highlight_pre_tag = kwargs.get('highlight_pre_tag', None) - self.minimum_coverage = kwargs.get('minimum_coverage', None) - self.order_by = kwargs.get('order_by', None) - self.query_type = kwargs.get('query_type', None) - self.scoring_statistics = kwargs.get('scoring_statistics', None) - self.session_id = kwargs.get('session_id', None) - self.scoring_parameters = kwargs.get('scoring_parameters', None) - self.scoring_profile = kwargs.get('scoring_profile', None) - self.search_text = kwargs.get('search_text', None) - self.search_fields = kwargs.get('search_fields', None) - self.search_mode = kwargs.get('search_mode', None) - self.select = kwargs.get('select', None) - self.skip = kwargs.get('skip', None) - self.top = kwargs.get('top', None) - - -class SearchResult(msrest.serialization.Model): - """Contains a document found by a search query, plus associated metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :ivar score: Required. The relevance score of the document compared to other documents returned - by the query. - :vartype score: float - :ivar highlights: Text fragments from the document that indicate the matching search terms, - organized by each applicable field; null if hit highlighting was not enabled for the query. - :vartype highlights: dict[str, list[str]] - """ - - _validation = { - 'score': {'required': True, 'readonly': True}, - 'highlights': {'readonly': True}, - } - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'score': {'key': '@search\\.score', 'type': 'float'}, - 'highlights': {'key': '@search\\.highlights', 'type': '{[str]}'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchResult, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.score = None - self.highlights = None - - -class SuggestDocumentsResult(msrest.serialization.Model): - """Response containing suggestion query results from an index. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar results: Required. The sequence of results returned by the query. - :vartype results: list[~azure.search.documents.v2020_06.models.SuggestResult] - :ivar coverage: A value indicating the percentage of the index that was included in the query, - or null if minimumCoverage was not set in the request. - :vartype coverage: float - """ - - _validation = { - 'results': {'required': True, 'readonly': True}, - 'coverage': {'readonly': True}, - } - - _attribute_map = { - 'results': {'key': 'value', 'type': '[SuggestResult]'}, - 'coverage': {'key': '@search\\.coverage', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(SuggestDocumentsResult, self).__init__(**kwargs) - self.results = None - self.coverage = None - - -class SuggestOptions(msrest.serialization.Model): - """Parameter group. - - :param filter: An OData expression that filters the documents considered for suggestions. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestions - query. Default is false. When set to true, the query will find terms even if there's a - substituted or missing character in the search text. While this provides a better experience in - some scenarios, it comes at a performance cost as fuzzy suggestions queries are slower and - consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a suggestions query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param order_by: The list of OData $orderby expressions by which to sort the results. Each - expression can be either a field name or a call to either the geo.distance() or the - search.score() functions. Each expression can be followed by asc to indicate ascending, or desc - to indicate descending. The default is ascending order. Ties will be broken by the match scores - of documents. If no $orderby is specified, the default sort order is descending by document - match score. There can be at most 32 $orderby clauses. - :type order_by: list[str] - :param search_fields: The list of field names to search for the specified search text. Target - fields must be included in the specified suggester. - :type search_fields: list[str] - :param select: The list of fields to retrieve. If unspecified, only the key field will be - included in the results. - :type select: list[str] - :param top: The number of suggestions to retrieve. The value must be a number between 1 and - 100. The default is 5. - :type top: int - """ - - _attribute_map = { - 'filter': {'key': '$filter', 'type': 'str'}, - 'use_fuzzy_matching': {'key': 'UseFuzzyMatching', 'type': 'bool'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'order_by': {'key': 'OrderBy', 'type': '[str]'}, - 'search_fields': {'key': 'searchFields', 'type': '[str]'}, - 'select': {'key': '$select', 'type': '[str]'}, - 'top': {'key': '$top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SuggestOptions, self).__init__(**kwargs) - self.filter = kwargs.get('filter', None) - self.use_fuzzy_matching = kwargs.get('use_fuzzy_matching', None) - self.highlight_post_tag = kwargs.get('highlight_post_tag', None) - self.highlight_pre_tag = kwargs.get('highlight_pre_tag', None) - self.minimum_coverage = kwargs.get('minimum_coverage', None) - self.order_by = kwargs.get('order_by', None) - self.search_fields = kwargs.get('search_fields', None) - self.select = kwargs.get('select', None) - self.top = kwargs.get('top', None) - - -class SuggestRequest(msrest.serialization.Model): - """Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors. - - All required parameters must be populated in order to send to Azure. - - :param filter: An OData expression that filters the documents considered for suggestions. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestion - query. Default is false. When set to true, the query will find suggestions even if there's a - substituted or missing character in the search text. While this provides a better experience in - some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and - consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a suggestion query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param order_by: The comma-separated list of OData $orderby expressions by which to sort the - results. Each expression can be either a field name or a call to either the geo.distance() or - the search.score() functions. Each expression can be followed by asc to indicate ascending, or - desc to indicate descending. The default is ascending order. Ties will be broken by the match - scores of documents. If no $orderby is specified, the default sort order is descending by - document match score. There can be at most 32 $orderby clauses. - :type order_by: str - :param search_text: Required. The search text to use to suggest documents. Must be at least 1 - character, and no more than 100 characters. - :type search_text: str - :param search_fields: The comma-separated list of field names to search for the specified - search text. Target fields must be included in the specified suggester. - :type search_fields: str - :param select: The comma-separated list of fields to retrieve. If unspecified, only the key - field will be included in the results. - :type select: str - :param suggester_name: Required. The name of the suggester as specified in the suggesters - collection that's part of the index definition. - :type suggester_name: str - :param top: The number of suggestions to retrieve. This must be a value between 1 and 100. The - default is 5. - :type top: int - """ - - _validation = { - 'search_text': {'required': True}, - 'suggester_name': {'required': True}, - } - - _attribute_map = { - 'filter': {'key': 'filter', 'type': 'str'}, - 'use_fuzzy_matching': {'key': 'fuzzy', 'type': 'bool'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'order_by': {'key': 'orderby', 'type': 'str'}, - 'search_text': {'key': 'search', 'type': 'str'}, - 'search_fields': {'key': 'searchFields', 'type': 'str'}, - 'select': {'key': 'select', 'type': 'str'}, - 'suggester_name': {'key': 'suggesterName', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SuggestRequest, self).__init__(**kwargs) - self.filter = kwargs.get('filter', None) - self.use_fuzzy_matching = kwargs.get('use_fuzzy_matching', None) - self.highlight_post_tag = kwargs.get('highlight_post_tag', None) - self.highlight_pre_tag = kwargs.get('highlight_pre_tag', None) - self.minimum_coverage = kwargs.get('minimum_coverage', None) - self.order_by = kwargs.get('order_by', None) - self.search_text = kwargs['search_text'] - self.search_fields = kwargs.get('search_fields', None) - self.select = kwargs.get('select', None) - self.suggester_name = kwargs['suggester_name'] - self.top = kwargs.get('top', None) - - -class SuggestResult(msrest.serialization.Model): - """A result containing a document found by a suggestion query, plus associated metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :ivar text: Required. The text of the suggestion result. - :vartype text: str - """ - - _validation = { - 'text': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'text': {'key': '@search\\.text', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SuggestResult, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.text = None diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_models_py3.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_models_py3.py deleted file mode 100644 index 9f4f2b36bda3..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_models_py3.py +++ /dev/null @@ -1,1099 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._search_client_enums import * - - -class AutocompleteItem(msrest.serialization.Model): - """The result of Autocomplete requests. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar text: Required. The completed term. - :vartype text: str - :ivar query_plus_text: Required. The query along with the completed term. - :vartype query_plus_text: str - """ - - _validation = { - 'text': {'required': True, 'readonly': True}, - 'query_plus_text': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'query_plus_text': {'key': 'queryPlusText', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AutocompleteItem, self).__init__(**kwargs) - self.text = None - self.query_plus_text = None - - -class AutocompleteOptions(msrest.serialization.Model): - """Parameter group. - - :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use - 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing - auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or ~azure.search.documents.v2020_06.models.AutocompleteMode - :param filter: An OData expression that filters the documents used to produce completed terms - for the Autocomplete result. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the - autocomplete query. Default is false. When set to true, the query will find terms even if - there's a substituted or missing character in the search text. While this provides a better - experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are - slower and consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. If omitted, hit highlighting is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. If omitted, hit highlighting is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by an autocomplete query in order for the query to be reported as a success. - This parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param search_fields: The list of field names to consider when querying for auto-completed - terms. Target fields must be included in the specified suggester. - :type search_fields: list[str] - :param top: The number of auto-completed terms to retrieve. This must be a value between 1 and - 100. The default is 5. - :type top: int - """ - - _attribute_map = { - 'autocomplete_mode': {'key': 'autocompleteMode', 'type': 'str'}, - 'filter': {'key': '$filter', 'type': 'str'}, - 'use_fuzzy_matching': {'key': 'UseFuzzyMatching', 'type': 'bool'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'search_fields': {'key': 'searchFields', 'type': '[str]'}, - 'top': {'key': '$top', 'type': 'int'}, - } - - def __init__( - self, - *, - autocomplete_mode: Optional[Union[str, "AutocompleteMode"]] = None, - filter: Optional[str] = None, - use_fuzzy_matching: Optional[bool] = None, - highlight_post_tag: Optional[str] = None, - highlight_pre_tag: Optional[str] = None, - minimum_coverage: Optional[float] = None, - search_fields: Optional[List[str]] = None, - top: Optional[int] = None, - **kwargs - ): - super(AutocompleteOptions, self).__init__(**kwargs) - self.autocomplete_mode = autocomplete_mode - self.filter = filter - self.use_fuzzy_matching = use_fuzzy_matching - self.highlight_post_tag = highlight_post_tag - self.highlight_pre_tag = highlight_pre_tag - self.minimum_coverage = minimum_coverage - self.search_fields = search_fields - self.top = top - - -class AutocompleteRequest(msrest.serialization.Model): - """Parameters for fuzzy matching, and other autocomplete query behaviors. - - All required parameters must be populated in order to send to Azure. - - :param search_text: Required. The search text on which to base autocomplete results. - :type search_text: str - :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use - 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing - auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or ~azure.search.documents.v2020_06.models.AutocompleteMode - :param filter: An OData expression that filters the documents used to produce completed terms - for the Autocomplete result. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the - autocomplete query. Default is false. When set to true, the query will autocomplete terms even - if there's a substituted or missing character in the search text. While this provides a better - experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are - slower and consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. If omitted, hit highlighting is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. If omitted, hit highlighting is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by an autocomplete query in order for the query to be reported as a success. - This parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param search_fields: The comma-separated list of field names to consider when querying for - auto-completed terms. Target fields must be included in the specified suggester. - :type search_fields: str - :param suggester_name: Required. The name of the suggester as specified in the suggesters - collection that's part of the index definition. - :type suggester_name: str - :param top: The number of auto-completed terms to retrieve. This must be a value between 1 and - 100. The default is 5. - :type top: int - """ - - _validation = { - 'search_text': {'required': True}, - 'suggester_name': {'required': True}, - } - - _attribute_map = { - 'search_text': {'key': 'search', 'type': 'str'}, - 'autocomplete_mode': {'key': 'autocompleteMode', 'type': 'str'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'use_fuzzy_matching': {'key': 'fuzzy', 'type': 'bool'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'search_fields': {'key': 'searchFields', 'type': 'str'}, - 'suggester_name': {'key': 'suggesterName', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - *, - search_text: str, - suggester_name: str, - autocomplete_mode: Optional[Union[str, "AutocompleteMode"]] = None, - filter: Optional[str] = None, - use_fuzzy_matching: Optional[bool] = None, - highlight_post_tag: Optional[str] = None, - highlight_pre_tag: Optional[str] = None, - minimum_coverage: Optional[float] = None, - search_fields: Optional[str] = None, - top: Optional[int] = None, - **kwargs - ): - super(AutocompleteRequest, self).__init__(**kwargs) - self.search_text = search_text - self.autocomplete_mode = autocomplete_mode - self.filter = filter - self.use_fuzzy_matching = use_fuzzy_matching - self.highlight_post_tag = highlight_post_tag - self.highlight_pre_tag = highlight_pre_tag - self.minimum_coverage = minimum_coverage - self.search_fields = search_fields - self.suggester_name = suggester_name - self.top = top - - -class AutocompleteResult(msrest.serialization.Model): - """The result of Autocomplete query. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar coverage: A value indicating the percentage of the index that was considered by the - autocomplete request, or null if minimumCoverage was not specified in the request. - :vartype coverage: float - :ivar results: Required. The list of returned Autocompleted items. - :vartype results: list[~azure.search.documents.v2020_06.models.AutocompleteItem] - """ - - _validation = { - 'coverage': {'readonly': True}, - 'results': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'coverage': {'key': '@search\\.coverage', 'type': 'float'}, - 'results': {'key': 'value', 'type': '[AutocompleteItem]'}, - } - - def __init__( - self, - **kwargs - ): - super(AutocompleteResult, self).__init__(**kwargs) - self.coverage = None - self.results = None - - -class FacetResult(msrest.serialization.Model): - """A single bucket of a facet query result. Reports the number of documents with a field value falling within a particular range or having a particular value or interval. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :ivar count: The approximate count of documents falling within the bucket described by this - facet. - :vartype count: long - """ - - _validation = { - 'count': {'readonly': True}, - } - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'count': {'key': 'count', 'type': 'long'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, object]] = None, - **kwargs - ): - super(FacetResult, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.count = None - - -class IndexAction(msrest.serialization.Model): - """Represents an index action that operates on a document. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :param action_type: The operation to perform on a document in an indexing batch. Possible - values include: "upload", "merge", "mergeOrUpload", "delete". - :type action_type: str or ~azure.search.documents.v2020_06.models.IndexActionType - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'action_type': {'key': '@search\\.action', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, object]] = None, - action_type: Optional[Union[str, "IndexActionType"]] = None, - **kwargs - ): - super(IndexAction, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.action_type = action_type - - -class IndexBatch(msrest.serialization.Model): - """Contains a batch of document write actions to send to the index. - - All required parameters must be populated in order to send to Azure. - - :param actions: Required. The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06.models.IndexAction] - """ - - _validation = { - 'actions': {'required': True}, - } - - _attribute_map = { - 'actions': {'key': 'value', 'type': '[IndexAction]'}, - } - - def __init__( - self, - *, - actions: List["IndexAction"], - **kwargs - ): - super(IndexBatch, self).__init__(**kwargs) - self.actions = actions - - -class IndexDocumentsResult(msrest.serialization.Model): - """Response containing the status of operations for all documents in the indexing request. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar results: Required. The list of status information for each document in the indexing - request. - :vartype results: list[~azure.search.documents.v2020_06.models.IndexingResult] - """ - - _validation = { - 'results': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'results': {'key': 'value', 'type': '[IndexingResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexDocumentsResult, self).__init__(**kwargs) - self.results = None - - -class IndexingResult(msrest.serialization.Model): - """Status of an indexing operation for a single document. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar key: Required. The key of a document that was in the indexing request. - :vartype key: str - :ivar error_message: The error message explaining why the indexing operation failed for the - document identified by the key; null if indexing succeeded. - :vartype error_message: str - :ivar succeeded: Required. A value indicating whether the indexing operation succeeded for the - document identified by the key. - :vartype succeeded: bool - :ivar status_code: Required. The status code of the indexing operation. Possible values - include: 200 for a successful update or delete, 201 for successful document creation, 400 for a - malformed input document, 404 for document not found, 409 for a version conflict, 422 when the - index is temporarily unavailable, or 503 for when the service is too busy. - :vartype status_code: int - """ - - _validation = { - 'key': {'required': True, 'readonly': True}, - 'error_message': {'readonly': True}, - 'succeeded': {'required': True, 'readonly': True}, - 'status_code': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'succeeded': {'key': 'status', 'type': 'bool'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexingResult, self).__init__(**kwargs) - self.key = None - self.error_message = None - self.succeeded = None - self.status_code = None - - -class RequestOptions(msrest.serialization.Model): - """Parameter group. - - :param x_ms_client_request_id: The tracking ID sent with the request to help with debugging. - :type x_ms_client_request_id: str - """ - - _attribute_map = { - 'x_ms_client_request_id': {'key': 'x-ms-client-request-id', 'type': 'str'}, - } - - def __init__( - self, - *, - x_ms_client_request_id: Optional[str] = None, - **kwargs - ): - super(RequestOptions, self).__init__(**kwargs) - self.x_ms_client_request_id = x_ms_client_request_id - - -class SearchDocumentsResult(msrest.serialization.Model): - """Response containing search results from an index. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar count: The total count of results found by the search operation, or null if the count was - not requested. If present, the count may be greater than the number of results in this - response. This can happen if you use the $top or $skip parameters, or if Azure Cognitive Search - can't return all the requested documents in a single Search response. - :vartype count: long - :ivar coverage: A value indicating the percentage of the index that was included in the query, - or null if minimumCoverage was not specified in the request. - :vartype coverage: float - :ivar facets: The facet query results for the search operation, organized as a collection of - buckets for each faceted field; null if the query did not include any facet expressions. - :vartype facets: dict[str, list[~azure.search.documents.v2020_06.models.FacetResult]] - :ivar next_page_parameters: Continuation JSON payload returned when Azure Cognitive Search - can't return all the requested results in a single Search response. You can use this JSON along - with @odata.nextLink to formulate another POST Search request to get the next part of the - search response. - :vartype next_page_parameters: ~azure.search.documents.v2020_06.models.SearchRequest - :ivar results: Required. The sequence of results returned by the query. - :vartype results: list[~azure.search.documents.v2020_06.models.SearchResult] - :ivar next_link: Continuation URL returned when Azure Cognitive Search can't return all the - requested results in a single Search response. You can use this URL to formulate another GET or - POST Search request to get the next part of the search response. Make sure to use the same verb - (GET or POST) as the request that produced this response. - :vartype next_link: str - """ - - _validation = { - 'count': {'readonly': True}, - 'coverage': {'readonly': True}, - 'facets': {'readonly': True}, - 'next_page_parameters': {'readonly': True}, - 'results': {'required': True, 'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': '@odata\\.count', 'type': 'long'}, - 'coverage': {'key': '@search\\.coverage', 'type': 'float'}, - 'facets': {'key': '@search\\.facets', 'type': '{[FacetResult]}'}, - 'next_page_parameters': {'key': '@search\\.nextPageParameters', 'type': 'SearchRequest'}, - 'results': {'key': 'value', 'type': '[SearchResult]'}, - 'next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchDocumentsResult, self).__init__(**kwargs) - self.count = None - self.coverage = None - self.facets = None - self.next_page_parameters = None - self.results = None - self.next_link = None - - -class SearchError(msrest.serialization.Model): - """Describes an error condition for the Azure Cognitive Search API. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code: One of a server-defined set of error codes. - :vartype code: str - :ivar message: Required. A human-readable representation of the error. - :vartype message: str - :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.search.documents.v2020_06.models.SearchError] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'required': True, 'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[SearchError]'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchError, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None - - -class SearchOptions(msrest.serialization.Model): - """Parameter group. - - :param include_total_result_count: A value that specifies whether to fetch the total count of - results. Default is false. Setting this value to true may have a performance impact. Note that - the count returned is an approximation. - :type include_total_result_count: bool - :param facets: The list of facet expressions to apply to the search query. Each facet - expression contains a field name, optionally followed by a comma-separated list of name:value - pairs. - :type facets: list[str] - :param filter: The OData $filter expression to apply to the search query. - :type filter: str - :param highlight_fields: The list of field names to use for hit highlights. Only searchable - fields can be used for hit highlighting. - :type highlight_fields: list[str] - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. Default is </em>. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. Default is <em>. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a search query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one - replica. The default is 100. - :type minimum_coverage: float - :param order_by: The list of OData $orderby expressions by which to sort the results. Each - expression can be either a field name or a call to either the geo.distance() or the - search.score() functions. Each expression can be followed by asc to indicate ascending, and - desc to indicate descending. The default is ascending order. Ties will be broken by the match - scores of documents. If no OrderBy is specified, the default sort order is descending by - document match score. There can be at most 32 $orderby clauses. - :type order_by: list[str] - :param query_type: A value that specifies the syntax of the search query. The default is - 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: - "simple", "full". - :type query_type: str or ~azure.search.documents.v2020_06.models.QueryType - :param scoring_parameters: The list of parameter values to be used in scoring functions (for - example, referencePointParameter) using the format name-values. For example, if the scoring - profile defines a function with a parameter called 'mylocation' the parameter string would be - "mylocation--122.2,44.8" (without the quotes). - :type scoring_parameters: list[str] - :param scoring_profile: The name of a scoring profile to evaluate match scores for matching - documents in order to sort the results. - :type scoring_profile: str - :param search_fields: The list of field names to which to scope the full-text search. When - using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of - each fielded search expression take precedence over any field names listed in this parameter. - :type search_fields: list[str] - :param search_mode: A value that specifies whether any or all of the search terms must be - matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.v2020_06.models.SearchMode - :param scoring_statistics: A value that specifies whether we want to calculate scoring - statistics (such as document frequency) globally for more consistent scoring, or locally, for - lower latency. Possible values include: "local", "global". - :type scoring_statistics: str or ~azure.search.documents.v2020_06.models.ScoringStatistics - :param session_id: A value to be used to create a sticky session, which can help to get more - consistent results. As long as the same sessionId is used, a best-effort attempt will be made - to target the same replica set. Be wary that reusing the same sessionID values repeatedly can - interfere with the load balancing of the requests across replicas and adversely affect the - performance of the search service. The value used as sessionId cannot start with a '_' - character. - :type session_id: str - :param select: The list of fields to retrieve. If unspecified, all fields marked as retrievable - in the schema are included. - :type select: list[str] - :param skip: The number of search results to skip. This value cannot be greater than 100,000. - If you need to scan documents in sequence, but cannot use $skip due to this limitation, - consider using $orderby on a totally-ordered key and $filter with a range query instead. - :type skip: int - :param top: The number of search results to retrieve. This can be used in conjunction with - $skip to implement client-side paging of search results. If results are truncated due to - server-side paging, the response will include a continuation token that can be used to issue - another Search request for the next page of results. - :type top: int - """ - - _attribute_map = { - 'include_total_result_count': {'key': 'IncludeTotalResultCount', 'type': 'bool'}, - 'facets': {'key': 'Facets', 'type': '[str]'}, - 'filter': {'key': '$filter', 'type': 'str'}, - 'highlight_fields': {'key': 'HighlightFields', 'type': '[str]'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'order_by': {'key': 'OrderBy', 'type': '[str]'}, - 'query_type': {'key': 'queryType', 'type': 'str'}, - 'scoring_parameters': {'key': 'ScoringParameters', 'type': '[str]'}, - 'scoring_profile': {'key': 'scoringProfile', 'type': 'str'}, - 'search_fields': {'key': 'searchFields', 'type': '[str]'}, - 'search_mode': {'key': 'searchMode', 'type': 'str'}, - 'scoring_statistics': {'key': 'scoringStatistics', 'type': 'str'}, - 'session_id': {'key': 'sessionId', 'type': 'str'}, - 'select': {'key': '$select', 'type': '[str]'}, - 'skip': {'key': '$skip', 'type': 'int'}, - 'top': {'key': '$top', 'type': 'int'}, - } - - def __init__( - self, - *, - include_total_result_count: Optional[bool] = None, - facets: Optional[List[str]] = None, - filter: Optional[str] = None, - highlight_fields: Optional[List[str]] = None, - highlight_post_tag: Optional[str] = None, - highlight_pre_tag: Optional[str] = None, - minimum_coverage: Optional[float] = None, - order_by: Optional[List[str]] = None, - query_type: Optional[Union[str, "QueryType"]] = None, - scoring_parameters: Optional[List[str]] = None, - scoring_profile: Optional[str] = None, - search_fields: Optional[List[str]] = None, - search_mode: Optional[Union[str, "SearchMode"]] = None, - scoring_statistics: Optional[Union[str, "ScoringStatistics"]] = None, - session_id: Optional[str] = None, - select: Optional[List[str]] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs - ): - super(SearchOptions, self).__init__(**kwargs) - self.include_total_result_count = include_total_result_count - self.facets = facets - self.filter = filter - self.highlight_fields = highlight_fields - self.highlight_post_tag = highlight_post_tag - self.highlight_pre_tag = highlight_pre_tag - self.minimum_coverage = minimum_coverage - self.order_by = order_by - self.query_type = query_type - self.scoring_parameters = scoring_parameters - self.scoring_profile = scoring_profile - self.search_fields = search_fields - self.search_mode = search_mode - self.scoring_statistics = scoring_statistics - self.session_id = session_id - self.select = select - self.skip = skip - self.top = top - - -class SearchRequest(msrest.serialization.Model): - """Parameters for filtering, sorting, faceting, paging, and other search query behaviors. - - :param include_total_result_count: A value that specifies whether to fetch the total count of - results. Default is false. Setting this value to true may have a performance impact. Note that - the count returned is an approximation. - :type include_total_result_count: bool - :param facets: The list of facet expressions to apply to the search query. Each facet - expression contains a field name, optionally followed by a comma-separated list of name:value - pairs. - :type facets: list[str] - :param filter: The OData $filter expression to apply to the search query. - :type filter: str - :param highlight_fields: The comma-separated list of field names to use for hit highlights. - Only searchable fields can be used for hit highlighting. - :type highlight_fields: str - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. Default is </em>. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. Default is <em>. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a search query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one - replica. The default is 100. - :type minimum_coverage: float - :param order_by: The comma-separated list of OData $orderby expressions by which to sort the - results. Each expression can be either a field name or a call to either the geo.distance() or - the search.score() functions. Each expression can be followed by asc to indicate ascending, or - desc to indicate descending. The default is ascending order. Ties will be broken by the match - scores of documents. If no $orderby is specified, the default sort order is descending by - document match score. There can be at most 32 $orderby clauses. - :type order_by: str - :param query_type: A value that specifies the syntax of the search query. The default is - 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: - "simple", "full". - :type query_type: str or ~azure.search.documents.v2020_06.models.QueryType - :param scoring_statistics: A value that specifies whether we want to calculate scoring - statistics (such as document frequency) globally for more consistent scoring, or locally, for - lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally - before scoring. Using global scoring statistics can increase latency of search queries. - Possible values include: "local", "global". - :type scoring_statistics: str or ~azure.search.documents.v2020_06.models.ScoringStatistics - :param session_id: A value to be used to create a sticky session, which can help getting more - consistent results. As long as the same sessionId is used, a best-effort attempt will be made - to target the same replica set. Be wary that reusing the same sessionID values repeatedly can - interfere with the load balancing of the requests across replicas and adversely affect the - performance of the search service. The value used as sessionId cannot start with a '_' - character. - :type session_id: str - :param scoring_parameters: The list of parameter values to be used in scoring functions (for - example, referencePointParameter) using the format name-values. For example, if the scoring - profile defines a function with a parameter called 'mylocation' the parameter string would be - "mylocation--122.2,44.8" (without the quotes). - :type scoring_parameters: list[str] - :param scoring_profile: The name of a scoring profile to evaluate match scores for matching - documents in order to sort the results. - :type scoring_profile: str - :param search_text: A full-text search query expression; Use "*" or omit this parameter to - match all documents. - :type search_text: str - :param search_fields: The comma-separated list of field names to which to scope the full-text - search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the - field names of each fielded search expression take precedence over any field names listed in - this parameter. - :type search_fields: str - :param search_mode: A value that specifies whether any or all of the search terms must be - matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.v2020_06.models.SearchMode - :param select: The comma-separated list of fields to retrieve. If unspecified, all fields - marked as retrievable in the schema are included. - :type select: str - :param skip: The number of search results to skip. This value cannot be greater than 100,000. - If you need to scan documents in sequence, but cannot use skip due to this limitation, consider - using orderby on a totally-ordered key and filter with a range query instead. - :type skip: int - :param top: The number of search results to retrieve. This can be used in conjunction with - $skip to implement client-side paging of search results. If results are truncated due to - server-side paging, the response will include a continuation token that can be used to issue - another Search request for the next page of results. - :type top: int - """ - - _attribute_map = { - 'include_total_result_count': {'key': 'count', 'type': 'bool'}, - 'facets': {'key': 'facets', 'type': '[str]'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'highlight_fields': {'key': 'highlight', 'type': 'str'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'order_by': {'key': 'orderby', 'type': 'str'}, - 'query_type': {'key': 'queryType', 'type': 'str'}, - 'scoring_statistics': {'key': 'scoringStatistics', 'type': 'str'}, - 'session_id': {'key': 'sessionId', 'type': 'str'}, - 'scoring_parameters': {'key': 'scoringParameters', 'type': '[str]'}, - 'scoring_profile': {'key': 'scoringProfile', 'type': 'str'}, - 'search_text': {'key': 'search', 'type': 'str'}, - 'search_fields': {'key': 'searchFields', 'type': 'str'}, - 'search_mode': {'key': 'searchMode', 'type': 'str'}, - 'select': {'key': 'select', 'type': 'str'}, - 'skip': {'key': 'skip', 'type': 'int'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - *, - include_total_result_count: Optional[bool] = None, - facets: Optional[List[str]] = None, - filter: Optional[str] = None, - highlight_fields: Optional[str] = None, - highlight_post_tag: Optional[str] = None, - highlight_pre_tag: Optional[str] = None, - minimum_coverage: Optional[float] = None, - order_by: Optional[str] = None, - query_type: Optional[Union[str, "QueryType"]] = None, - scoring_statistics: Optional[Union[str, "ScoringStatistics"]] = None, - session_id: Optional[str] = None, - scoring_parameters: Optional[List[str]] = None, - scoring_profile: Optional[str] = None, - search_text: Optional[str] = None, - search_fields: Optional[str] = None, - search_mode: Optional[Union[str, "SearchMode"]] = None, - select: Optional[str] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs - ): - super(SearchRequest, self).__init__(**kwargs) - self.include_total_result_count = include_total_result_count - self.facets = facets - self.filter = filter - self.highlight_fields = highlight_fields - self.highlight_post_tag = highlight_post_tag - self.highlight_pre_tag = highlight_pre_tag - self.minimum_coverage = minimum_coverage - self.order_by = order_by - self.query_type = query_type - self.scoring_statistics = scoring_statistics - self.session_id = session_id - self.scoring_parameters = scoring_parameters - self.scoring_profile = scoring_profile - self.search_text = search_text - self.search_fields = search_fields - self.search_mode = search_mode - self.select = select - self.skip = skip - self.top = top - - -class SearchResult(msrest.serialization.Model): - """Contains a document found by a search query, plus associated metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :ivar score: Required. The relevance score of the document compared to other documents returned - by the query. - :vartype score: float - :ivar highlights: Text fragments from the document that indicate the matching search terms, - organized by each applicable field; null if hit highlighting was not enabled for the query. - :vartype highlights: dict[str, list[str]] - """ - - _validation = { - 'score': {'required': True, 'readonly': True}, - 'highlights': {'readonly': True}, - } - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'score': {'key': '@search\\.score', 'type': 'float'}, - 'highlights': {'key': '@search\\.highlights', 'type': '{[str]}'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, object]] = None, - **kwargs - ): - super(SearchResult, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.score = None - self.highlights = None - - -class SuggestDocumentsResult(msrest.serialization.Model): - """Response containing suggestion query results from an index. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar results: Required. The sequence of results returned by the query. - :vartype results: list[~azure.search.documents.v2020_06.models.SuggestResult] - :ivar coverage: A value indicating the percentage of the index that was included in the query, - or null if minimumCoverage was not set in the request. - :vartype coverage: float - """ - - _validation = { - 'results': {'required': True, 'readonly': True}, - 'coverage': {'readonly': True}, - } - - _attribute_map = { - 'results': {'key': 'value', 'type': '[SuggestResult]'}, - 'coverage': {'key': '@search\\.coverage', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(SuggestDocumentsResult, self).__init__(**kwargs) - self.results = None - self.coverage = None - - -class SuggestOptions(msrest.serialization.Model): - """Parameter group. - - :param filter: An OData expression that filters the documents considered for suggestions. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestions - query. Default is false. When set to true, the query will find terms even if there's a - substituted or missing character in the search text. While this provides a better experience in - some scenarios, it comes at a performance cost as fuzzy suggestions queries are slower and - consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a suggestions query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param order_by: The list of OData $orderby expressions by which to sort the results. Each - expression can be either a field name or a call to either the geo.distance() or the - search.score() functions. Each expression can be followed by asc to indicate ascending, or desc - to indicate descending. The default is ascending order. Ties will be broken by the match scores - of documents. If no $orderby is specified, the default sort order is descending by document - match score. There can be at most 32 $orderby clauses. - :type order_by: list[str] - :param search_fields: The list of field names to search for the specified search text. Target - fields must be included in the specified suggester. - :type search_fields: list[str] - :param select: The list of fields to retrieve. If unspecified, only the key field will be - included in the results. - :type select: list[str] - :param top: The number of suggestions to retrieve. The value must be a number between 1 and - 100. The default is 5. - :type top: int - """ - - _attribute_map = { - 'filter': {'key': '$filter', 'type': 'str'}, - 'use_fuzzy_matching': {'key': 'UseFuzzyMatching', 'type': 'bool'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'order_by': {'key': 'OrderBy', 'type': '[str]'}, - 'search_fields': {'key': 'searchFields', 'type': '[str]'}, - 'select': {'key': '$select', 'type': '[str]'}, - 'top': {'key': '$top', 'type': 'int'}, - } - - def __init__( - self, - *, - filter: Optional[str] = None, - use_fuzzy_matching: Optional[bool] = None, - highlight_post_tag: Optional[str] = None, - highlight_pre_tag: Optional[str] = None, - minimum_coverage: Optional[float] = None, - order_by: Optional[List[str]] = None, - search_fields: Optional[List[str]] = None, - select: Optional[List[str]] = None, - top: Optional[int] = None, - **kwargs - ): - super(SuggestOptions, self).__init__(**kwargs) - self.filter = filter - self.use_fuzzy_matching = use_fuzzy_matching - self.highlight_post_tag = highlight_post_tag - self.highlight_pre_tag = highlight_pre_tag - self.minimum_coverage = minimum_coverage - self.order_by = order_by - self.search_fields = search_fields - self.select = select - self.top = top - - -class SuggestRequest(msrest.serialization.Model): - """Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors. - - All required parameters must be populated in order to send to Azure. - - :param filter: An OData expression that filters the documents considered for suggestions. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestion - query. Default is false. When set to true, the query will find suggestions even if there's a - substituted or missing character in the search text. While this provides a better experience in - some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and - consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with - highlightPreTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with - highlightPostTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a suggestion query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param order_by: The comma-separated list of OData $orderby expressions by which to sort the - results. Each expression can be either a field name or a call to either the geo.distance() or - the search.score() functions. Each expression can be followed by asc to indicate ascending, or - desc to indicate descending. The default is ascending order. Ties will be broken by the match - scores of documents. If no $orderby is specified, the default sort order is descending by - document match score. There can be at most 32 $orderby clauses. - :type order_by: str - :param search_text: Required. The search text to use to suggest documents. Must be at least 1 - character, and no more than 100 characters. - :type search_text: str - :param search_fields: The comma-separated list of field names to search for the specified - search text. Target fields must be included in the specified suggester. - :type search_fields: str - :param select: The comma-separated list of fields to retrieve. If unspecified, only the key - field will be included in the results. - :type select: str - :param suggester_name: Required. The name of the suggester as specified in the suggesters - collection that's part of the index definition. - :type suggester_name: str - :param top: The number of suggestions to retrieve. This must be a value between 1 and 100. The - default is 5. - :type top: int - """ - - _validation = { - 'search_text': {'required': True}, - 'suggester_name': {'required': True}, - } - - _attribute_map = { - 'filter': {'key': 'filter', 'type': 'str'}, - 'use_fuzzy_matching': {'key': 'fuzzy', 'type': 'bool'}, - 'highlight_post_tag': {'key': 'highlightPostTag', 'type': 'str'}, - 'highlight_pre_tag': {'key': 'highlightPreTag', 'type': 'str'}, - 'minimum_coverage': {'key': 'minimumCoverage', 'type': 'float'}, - 'order_by': {'key': 'orderby', 'type': 'str'}, - 'search_text': {'key': 'search', 'type': 'str'}, - 'search_fields': {'key': 'searchFields', 'type': 'str'}, - 'select': {'key': 'select', 'type': 'str'}, - 'suggester_name': {'key': 'suggesterName', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'int'}, - } - - def __init__( - self, - *, - search_text: str, - suggester_name: str, - filter: Optional[str] = None, - use_fuzzy_matching: Optional[bool] = None, - highlight_post_tag: Optional[str] = None, - highlight_pre_tag: Optional[str] = None, - minimum_coverage: Optional[float] = None, - order_by: Optional[str] = None, - search_fields: Optional[str] = None, - select: Optional[str] = None, - top: Optional[int] = None, - **kwargs - ): - super(SuggestRequest, self).__init__(**kwargs) - self.filter = filter - self.use_fuzzy_matching = use_fuzzy_matching - self.highlight_post_tag = highlight_post_tag - self.highlight_pre_tag = highlight_pre_tag - self.minimum_coverage = minimum_coverage - self.order_by = order_by - self.search_text = search_text - self.search_fields = search_fields - self.select = select - self.suggester_name = suggester_name - self.top = top - - -class SuggestResult(msrest.serialization.Model): - """A result containing a document found by a suggestion query, plus associated metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :ivar text: Required. The text of the suggestion result. - :vartype text: str - """ - - _validation = { - 'text': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'text': {'key': '@search\\.text', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, object]] = None, - **kwargs - ): - super(SuggestResult, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.text = None diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_search_client_enums.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_search_client_enums.py deleted file mode 100644 index 55dfae9b60ad..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/models/_search_client_enums.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AutocompleteMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles - and 'oneTermWithContext' to use the current context in producing autocomplete terms. - """ - - #: Only one term is suggested. If the query has two terms, only the last term is completed. For - #: example, if the input is 'washington medic', the suggested terms could include 'medicaid', - #: 'medicare', and 'medicine'. - ONE_TERM = "oneTerm" - #: Matching two-term phrases in the index will be suggested. For example, if the input is 'medic', - #: the suggested terms could include 'medicare coverage' and 'medical assistant'. - TWO_TERMS = "twoTerms" - #: Completes the last term in a query with two or more terms, where the last two terms are a - #: phrase that exists in the index. For example, if the input is 'washington medic', the suggested - #: terms could include 'washington medicaid' and 'washington medical'. - ONE_TERM_WITH_CONTEXT = "oneTermWithContext" - -class IndexActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The operation to perform on a document in an indexing batch. - """ - - #: Inserts the document into the index if it is new and updates it if it exists. All fields are - #: replaced in the update case. - UPLOAD = "upload" - #: Merges the specified field values with an existing document. If the document does not exist, - #: the merge will fail. Any field you specify in a merge will replace the existing field in the - #: document. This also applies to collections of primitive and complex types. - MERGE = "merge" - #: Behaves like merge if a document with the given key already exists in the index. If the - #: document does not exist, it behaves like upload with a new document. - MERGE_OR_UPLOAD = "mergeOrUpload" - #: Removes the specified document from the index. Any field you specify in a delete operation - #: other than the key field will be ignored. If you want to remove an individual field from a - #: document, use merge instead and set the field explicitly to null. - DELETE = "delete" - -class QueryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query - uses the Lucene query syntax. - """ - - #: Uses the simple query syntax for searches. Search text is interpreted using a simple query - #: language that allows for symbols such as +, * and "". Queries are evaluated across all - #: searchable fields by default, unless the searchFields parameter is specified. - SIMPLE = "simple" - #: Uses the full Lucene query syntax for searches. Search text is interpreted using the Lucene - #: query language which allows field-specific and weighted searches, as well as other advanced - #: features. - FULL = "full" - -class ScoringStatistics(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """A value that specifies whether we want to calculate scoring statistics (such as document - frequency) globally for more consistent scoring, or locally, for lower latency. The default is - 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global - scoring statistics can increase latency of search queries. - """ - - #: The scoring statistics will be calculated locally for lower latency. - LOCAL = "local" - #: The scoring statistics will be calculated globally for more consistent scoring. - GLOBAL_ENUM = "global" - -class SearchMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies whether any or all of the search terms must be matched in order to count the document - as a match. - """ - - #: Any of the search terms must be matched in order to count the document as a match. - ANY = "any" - #: All of the search terms must be matched in order to count the document as a match. - ALL = "all" diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/operations/_documents_operations.py deleted file mode 100644 index ed84d22812c9..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/operations/_documents_operations.py +++ /dev/null @@ -1,827 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class DocumentsOperations(object): - """DocumentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def count( - self, - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> int - """Queries the number of documents in the index. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: long, or the result of cls(response) - :rtype: long - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[int] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.count.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('long', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - count.metadata = {'url': '/docs/$count'} # type: ignore - - def search_get( - self, - search_text=None, # type: Optional[str] - search_options=None, # type: Optional["_models.SearchOptions"] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchDocumentsResult" - """Searches for documents in the index. - - :param search_text: A full-text search query expression; Use "*" or omit this parameter to - match all documents. - :type search_text: str - :param search_options: Parameter group. - :type search_options: ~azure.search.documents.v2020_06.models.SearchOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _include_total_result_count = None - _facets = None - _filter = None - _highlight_fields = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _query_type = None - _scoring_parameters = None - _scoring_profile = None - _search_fields = None - _search_mode = None - _scoring_statistics = None - _session_id = None - _select = None - _skip = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if search_options is not None: - _include_total_result_count = search_options.include_total_result_count - _facets = search_options.facets - _filter = search_options.filter - _highlight_fields = search_options.highlight_fields - _highlight_post_tag = search_options.highlight_post_tag - _highlight_pre_tag = search_options.highlight_pre_tag - _minimum_coverage = search_options.minimum_coverage - _order_by = search_options.order_by - _query_type = search_options.query_type - _scoring_parameters = search_options.scoring_parameters - _scoring_profile = search_options.scoring_profile - _search_fields = search_options.search_fields - _search_mode = search_options.search_mode - _scoring_statistics = search_options.scoring_statistics - _session_id = search_options.session_id - _select = search_options.select - _skip = search_options.skip - _top = search_options.top - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.search_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if search_text is not None: - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - if _include_total_result_count is not None: - query_parameters['$count'] = self._serialize.query("include_total_result_count", _include_total_result_count, 'bool') - if _facets is not None: - query_parameters['facet'] = [self._serialize.query("facets", q, 'str') if q is not None else '' for q in _facets] - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _highlight_fields is not None: - query_parameters['highlight'] = self._serialize.query("highlight_fields", _highlight_fields, '[str]', div=',') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _query_type is not None: - query_parameters['queryType'] = self._serialize.query("query_type", _query_type, 'str') - if _scoring_parameters is not None: - query_parameters['scoringParameter'] = [self._serialize.query("scoring_parameters", q, 'str') if q is not None else '' for q in _scoring_parameters] - if _scoring_profile is not None: - query_parameters['scoringProfile'] = self._serialize.query("scoring_profile", _scoring_profile, 'str') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _search_mode is not None: - query_parameters['searchMode'] = self._serialize.query("search_mode", _search_mode, 'str') - if _scoring_statistics is not None: - query_parameters['scoringStatistics'] = self._serialize.query("scoring_statistics", _scoring_statistics, 'str') - if _session_id is not None: - query_parameters['sessionId'] = self._serialize.query("session_id", _session_id, 'str') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", _skip, 'int') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_get.metadata = {'url': '/docs'} # type: ignore - - def search_post( - self, - search_request, # type: "_models.SearchRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchDocumentsResult" - """Searches for documents in the index. - - :param search_request: The definition of the Search request. - :type search_request: ~azure.search.documents.v2020_06.models.SearchRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.search_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(search_request, 'SearchRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_post.metadata = {'url': '/docs/search.post.search'} # type: ignore - - def get( - self, - key, # type: str - selected_fields=None, # type: Optional[List[str]] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> object - """Retrieves a document from the index. - - :param key: The key of the document to retrieve. - :type key: str - :param selected_fields: List of field names to retrieve for the document; Any field not - retrieved will be missing from the returned document. - :type selected_fields: list[str] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: object, or the result of cls(response) - :rtype: object - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[object] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'key': self._serialize.url("key", key, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if selected_fields is not None: - query_parameters['$select'] = self._serialize.query("selected_fields", selected_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('object', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/docs(\'{key}\')'} # type: ignore - - def suggest_get( - self, - search_text, # type: str - suggester_name, # type: str - suggest_options=None, # type: Optional["_models.SuggestOptions"] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SuggestDocumentsResult" - """Suggests documents in the index that match the given partial query text. - - :param search_text: The search text to use to suggest documents. Must be at least 1 character, - and no more than 100 characters. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param suggest_options: Parameter group. - :type suggest_options: ~azure.search.documents.v2020_06.models.SuggestOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _search_fields = None - _select = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if suggest_options is not None: - _filter = suggest_options.filter - _use_fuzzy_matching = suggest_options.use_fuzzy_matching - _highlight_post_tag = suggest_options.highlight_post_tag - _highlight_pre_tag = suggest_options.highlight_pre_tag - _minimum_coverage = suggest_options.minimum_coverage - _order_by = suggest_options.order_by - _search_fields = suggest_options.search_fields - _select = suggest_options.select - _top = suggest_options.top - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.suggest_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_get.metadata = {'url': '/docs/search.suggest'} # type: ignore - - def suggest_post( - self, - suggest_request, # type: "_models.SuggestRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SuggestDocumentsResult" - """Suggests documents in the index that match the given partial query text. - - :param suggest_request: The Suggest request. - :type suggest_request: ~azure.search.documents.v2020_06.models.SuggestRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.suggest_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(suggest_request, 'SuggestRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_post.metadata = {'url': '/docs/search.post.suggest'} # type: ignore - - def index( - self, - actions, # type: List["_models.IndexAction"] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.IndexDocumentsResult" - """Sends a batch of document write actions to the index. - - :param actions: The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06.models.IndexAction] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IndexDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.IndexDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IndexDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - - _batch = _models.IndexBatch(actions=actions) - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.index.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_batch, 'IndexBatch') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if response.status_code == 207: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - index.metadata = {'url': '/docs/search.index'} # type: ignore - - def autocomplete_get( - self, - search_text, # type: str - suggester_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - autocomplete_options=None, # type: Optional["_models.AutocompleteOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.AutocompleteResult" - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param search_text: The incomplete term which should be auto-completed. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :param autocomplete_options: Parameter group. - :type autocomplete_options: ~azure.search.documents.v2020_06.models.AutocompleteOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - _autocomplete_mode = None - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _search_fields = None - _top = None - if autocomplete_options is not None: - _autocomplete_mode = autocomplete_options.autocomplete_mode - _filter = autocomplete_options.filter - _use_fuzzy_matching = autocomplete_options.use_fuzzy_matching - _highlight_post_tag = autocomplete_options.highlight_post_tag - _highlight_pre_tag = autocomplete_options.highlight_pre_tag - _minimum_coverage = autocomplete_options.minimum_coverage - _search_fields = autocomplete_options.search_fields - _top = autocomplete_options.top - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.autocomplete_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _autocomplete_mode is not None: - query_parameters['autocompleteMode'] = self._serialize.query("autocomplete_mode", _autocomplete_mode, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_get.metadata = {'url': '/docs/search.autocomplete'} # type: ignore - - def autocomplete_post( - self, - autocomplete_request, # type: "_models.AutocompleteRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.AutocompleteResult" - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param autocomplete_request: The definition of the Autocomplete request. - :type autocomplete_request: ~azure.search.documents.v2020_06.models.AutocompleteRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.autocomplete_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(autocomplete_request, 'AutocompleteRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_post.metadata = {'url': '/docs/search.post.autocomplete'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/py.typed b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/__init__.py deleted file mode 100644 index d58f5fc3b7f8..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._search_client import SearchClient -__all__ = ['SearchClient'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_configuration.py deleted file mode 100644 index fa5c32c24b1a..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_configuration.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -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 - -VERSION = "unknown" - -class SearchClientConfiguration(Configuration): - """Configuration for SearchClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - :param index_name: The name of the index. - :type index_name: str - """ - - def __init__( - self, - endpoint, # type: str - index_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - 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 = "2020-06-30-Preview" - kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - 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') diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_metadata.json b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_metadata.json deleted file mode 100644 index ddb80473dfce..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_metadata.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "chosen_version": "2020-06-30-Preview", - "total_api_version_list": ["2020-06-30-Preview"], - "client": { - "name": "SearchClient", - "filename": "_search_client", - "description": "Client that can be used to query an index and upload, merge, or delete documents.", - "base_url": null, - "custom_base_url": "\u0027{endpoint}/indexes(\\\u0027{indexName}\\\u0027)\u0027", - "azure_arm": false, - "has_lro_operations": false, - "client_side_validation": false, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"SearchClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"SearchClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "global_parameters": { - "sync": { - "endpoint": { - "signature": "endpoint, # type: str", - "description": "The endpoint URL of the search service.", - "docstring_type": "str", - "required": true - }, - "index_name": { - "signature": "index_name, # type: str", - "description": "The name of the index.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "endpoint": { - "signature": "endpoint: str,", - "description": "The endpoint URL of the search service.", - "docstring_type": "str", - "required": true - }, - "index_name": { - "signature": "index_name: str,", - "description": "The name of the index.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "endpoint, index_name", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": false, - "credential_scopes": null, - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}" - }, - "operation_groups": { - "documents": "DocumentsOperations" - }, - "operation_mixins": { - "sync_imports": "None", - "async_imports": "None", - "operations": { - } - } -} \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_search_client.py deleted file mode 100644 index ad996852f74e..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/_search_client.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core import PipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - 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. - - :ivar documents: DocumentsOperations operations - :vartype documents: azure.search.documents.v2020_06_preview.operations.DocumentsOperations - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - :param index_name: The name of the index. - :type index_name: 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, 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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.documents = DocumentsOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse - """Runs the network request through the client's chained policies. - - :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.pipeline.transport.HttpResponse - """ - 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'), - } - 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 - self._client.close() - - def __enter__(self): - # type: () -> SearchClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/__init__.py deleted file mode 100644 index ec41d54fc046..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._search_client import SearchClient -__all__ = ['SearchClient'] diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/_configuration.py deleted file mode 100644 index 07e344b9c7df..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/_configuration.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies - -VERSION = "unknown" - -class SearchClientConfiguration(Configuration): - """Configuration for SearchClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - :param index_name: The name of the index. - :type index_name: str - """ - - def __init__( - self, - endpoint: str, - index_name: str, - **kwargs: Any - ) -> None: - 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 = "2020-06-30-Preview" - kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> 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.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/_search_client.py deleted file mode 100644 index 4a5a4031c963..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/_search_client.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any - -from azure.core import AsyncPipelineClient -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from msrest import Deserializer, Serializer - -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. - - :ivar documents: DocumentsOperations operations - :vartype documents: azure.search.documents.v2020_06_preview.aio.operations.DocumentsOperations - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - :param index_name: The name of the index. - :type index_name: str - """ - - def __init__( - self, - endpoint: str, - index_name: str, - **kwargs: Any - ) -> None: - base_url = '{endpoint}/indexes(\'{indexName}\')' - self._config = SearchClientConfiguration(endpoint, index_name, **kwargs) - self._client = AsyncPipelineClient(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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.documents = DocumentsOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: - """Runs the network request through the client's chained policies. - - :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.pipeline.transport.AsyncHttpResponse - """ - 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'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "SearchClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/operations/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/operations/__init__.py deleted file mode 100644 index 76022eb9d305..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/aio/operations/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._documents_operations import DocumentsOperations - -__all__ = [ - 'DocumentsOperations', -] diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/operations/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/operations/__init__.py deleted file mode 100644 index 76022eb9d305..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/operations/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._documents_operations import DocumentsOperations - -__all__ = [ - 'DocumentsOperations', -] diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/py.typed b/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/v2020_06_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_configuration.py index 892c22e13cf9..ceafaf49bb0d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_configuration.py @@ -1,24 +1,22 @@ # 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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- + from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from ._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any +VERSION = "unknown" + class SearchClientConfiguration(Configuration): """Configuration for SearchClient. @@ -40,7 +38,8 @@ def __init__( super(SearchClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - kwargs.setdefault('sdk_moniker', 'azure-search-documents/{}'.format(VERSION)) + self.api_version = "2020-06-30-Preview" + kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_operations_mixin.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_operations_mixin.py deleted file mode 100644 index e437c18a8dd4..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_operations_mixin.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -from msrest import Serializer, Deserializer -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - -class SearchClientOperationsMixin(object): - - def get_service_statistics( - self, - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - """Gets service level statistics for a search service. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServiceStatistics, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceStatistics - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = self._get_api_version('get_service_statistics') - if api_version == '2020-06-30': - from .v2020_06.operations import SearchClientOperationsMixin as OperationClass - elif api_version == '2020-06-30-Preview': - from .v2020_06_preview.operations import SearchClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'get_service_statistics'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.get_service_statistics(request_options, **kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py index 092bc5ba346b..63cfd315c9e9 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py @@ -1,186 +1,102 @@ # 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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import TYPE_CHECKING from azure.core import PipelineClient -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin from msrest import Deserializer, Serializer -from ._configuration import SearchClientConfiguration -from ._operations_mixin import SearchClientOperationsMixin - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional + from typing import Any from azure.core.pipeline.transport import HttpRequest, HttpResponse -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass +from ._configuration import SearchClientConfiguration +from .operations import DataSourcesOperations +from .operations import IndexersOperations +from .operations import SkillsetsOperations +from .operations import SynonymMapsOperations +from .operations import IndexesOperations +from .operations import SearchClientOperationsMixin +from . import models -class SearchClient(SearchClientOperationsMixin, MultiApiClientMixin, _SDKClient): - """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. +class SearchClient(SearchClientOperationsMixin): + """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. + :ivar data_sources: DataSourcesOperations operations + :vartype data_sources: azure.search.documents.indexes.operations.DataSourcesOperations + :ivar indexers: IndexersOperations operations + :vartype indexers: azure.search.documents.indexes.operations.IndexersOperations + :ivar skillsets: SkillsetsOperations operations + :vartype skillsets: azure.search.documents.indexes.operations.SkillsetsOperations + :ivar synonym_maps: SynonymMapsOperations operations + :vartype synonym_maps: azure.search.documents.indexes.operations.SynonymMapsOperations + :ivar indexes: IndexesOperations operations + :vartype indexes: azure.search.documents.indexes.operations.IndexesOperations :param endpoint: The endpoint URL of the search service. :type endpoint: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2020-06-30-Preview' - _PROFILE_TAG = "azure.search.documents.SearchClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - }}, - _PROFILE_TAG + " latest" - ) - def __init__( self, endpoint, # type: str - api_version=None, # type: Optional[str] - profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): - if api_version == '2020-06-30' or api_version == '2020-06-30-Preview': - base_url = '{endpoint}' - else: - raise ValueError("API version {} is not available".format(api_version)) + # type: (...) -> None + base_url = '{endpoint}' self._config = SearchClientConfiguration(endpoint, **kwargs) self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) - super(SearchClient, self).__init__( - api_version=api_version, - profile=profile - ) - - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: - - * 2020-06-30: :mod:`v2020_06.models` - * 2020-06-30-Preview: :mod:`v2020_06_preview.models` - """ - if api_version == '2020-06-30': - from .v2020_06 import models - return models - elif api_version == '2020-06-30-Preview': - from .v2020_06_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def data_sources(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`DataSourcesOperations` - * 2020-06-30-Preview: :class:`DataSourcesOperations` - """ - api_version = self._get_api_version('data_sources') - if api_version == '2020-06-30': - from .v2020_06.operations import DataSourcesOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from .v2020_06_preview.operations import DataSourcesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_sources'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def indexers(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`IndexersOperations` - * 2020-06-30-Preview: :class:`IndexersOperations` - """ - api_version = self._get_api_version('indexers') - if api_version == '2020-06-30': - from .v2020_06.operations import IndexersOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from .v2020_06_preview.operations import IndexersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'indexers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def indexes(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`IndexesOperations` - * 2020-06-30-Preview: :class:`IndexesOperations` + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.data_sources = DataSourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.indexers = IndexersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.skillsets = SkillsetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.synonym_maps = SynonymMapsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :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.pipeline.transport.HttpResponse """ - api_version = self._get_api_version('indexes') - if api_version == '2020-06-30': - from .v2020_06.operations import IndexesOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from .v2020_06_preview.operations import IndexesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'indexes'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def skillsets(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`SkillsetsOperations` - * 2020-06-30-Preview: :class:`SkillsetsOperations` - """ - api_version = self._get_api_version('skillsets') - if api_version == '2020-06-30': - from .v2020_06.operations import SkillsetsOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from .v2020_06_preview.operations import SkillsetsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'skillsets'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def synonym_maps(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`SynonymMapsOperations` - * 2020-06-30-Preview: :class:`SynonymMapsOperations` - """ - api_version = self._get_api_version('synonym_maps') - if api_version == '2020-06-30': - from .v2020_06.operations import SynonymMapsOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from .v2020_06_preview.operations import SynonymMapsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'synonym_maps'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + 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 self._client.close() + def __enter__(self): + # type: () -> SearchClient self._client.__enter__() return self + def __exit__(self, *exc_details): + # type: (Any) -> None self._client.__exit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_version.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_version.py deleted file mode 100644 index a30a458f8b5b..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_version.py +++ /dev/null @@ -1,8 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -VERSION = "0.1.0" \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_configuration.py index 9c4fd3780adf..b82610021e5f 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_configuration.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_configuration.py @@ -1,19 +1,17 @@ # 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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- + from typing import Any from azure.core.configuration import Configuration from azure.core.pipeline import policies -from .._version import VERSION +VERSION = "unknown" class SearchClientConfiguration(Configuration): """Configuration for SearchClient. @@ -28,14 +26,15 @@ class SearchClientConfiguration(Configuration): def __init__( self, endpoint: str, - **kwargs # type: Any + **kwargs: Any ) -> None: if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") super(SearchClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - kwargs.setdefault('sdk_moniker', 'azure-search-documents/{}'.format(VERSION)) + self.api_version = "2020-06-30-Preview" + kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_operations_mixin.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_operations_mixin.py deleted file mode 100644 index d22e8d8fafd1..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_operations_mixin.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -from msrest import Serializer, Deserializer -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - - -class SearchClientOperationsMixin(object): - - async def get_service_statistics( - self, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.ServiceStatistics": - """Gets service level statistics for a search service. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServiceStatistics, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceStatistics - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = self._get_api_version('get_service_statistics') - if api_version == '2020-06-30': - from ..v2020_06.aio.operations import SearchClientOperationsMixin as OperationClass - elif api_version == '2020-06-30-Preview': - from ..v2020_06_preview.aio.operations import SearchClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'get_service_statistics'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.get_service_statistics(request_options, **kwargs) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py index 919bb7f82014..b8dfb1e0acc0 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py @@ -1,181 +1,92 @@ # 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. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional +from typing import Any from azure.core import AsyncPipelineClient from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin from msrest import Deserializer, Serializer from ._configuration import SearchClientConfiguration -from ._operations_mixin import SearchClientOperationsMixin +from .operations import DataSourcesOperations +from .operations import IndexersOperations +from .operations import SkillsetsOperations +from .operations import SynonymMapsOperations +from .operations import IndexesOperations +from .operations import SearchClientOperationsMixin +from .. import models -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass -class SearchClient(SearchClientOperationsMixin, MultiApiClientMixin, _SDKClient): +class SearchClient(SearchClientOperationsMixin): """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - + :ivar data_sources: DataSourcesOperations operations + :vartype data_sources: azure.search.documents.indexes.aio.operations.DataSourcesOperations + :ivar indexers: IndexersOperations operations + :vartype indexers: azure.search.documents.indexes.aio.operations.IndexersOperations + :ivar skillsets: SkillsetsOperations operations + :vartype skillsets: azure.search.documents.indexes.aio.operations.SkillsetsOperations + :ivar synonym_maps: SynonymMapsOperations operations + :vartype synonym_maps: azure.search.documents.indexes.aio.operations.SynonymMapsOperations + :ivar indexes: IndexesOperations operations + :vartype indexes: azure.search.documents.indexes.aio.operations.IndexesOperations :param endpoint: The endpoint URL of the search service. :type endpoint: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2020-06-30-Preview' - _PROFILE_TAG = "azure.search.documents.SearchClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - }}, - _PROFILE_TAG + " latest" - ) - def __init__( self, endpoint: str, - api_version: Optional[str] = None, - profile: KnownProfiles = KnownProfiles.default, - **kwargs # type: Any + **kwargs: Any ) -> None: - if api_version == '2020-06-30' or api_version == '2020-06-30-Preview': - base_url = '{endpoint}' - else: - raise ValueError("API version {} is not available".format(api_version)) + base_url = '{endpoint}' self._config = SearchClientConfiguration(endpoint, **kwargs) self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(SearchClient, self).__init__( - api_version=api_version, - profile=profile - ) - - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: - - * 2020-06-30: :mod:`v2020_06.models` - * 2020-06-30-Preview: :mod:`v2020_06_preview.models` - """ - if api_version == '2020-06-30': - from ..v2020_06 import models - return models - elif api_version == '2020-06-30-Preview': - from ..v2020_06_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def data_sources(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`DataSourcesOperations` - * 2020-06-30-Preview: :class:`DataSourcesOperations` - """ - api_version = self._get_api_version('data_sources') - if api_version == '2020-06-30': - from ..v2020_06.aio.operations import DataSourcesOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from ..v2020_06_preview.aio.operations import DataSourcesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'data_sources'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def indexers(self): - """Instance depends on the API version: - * 2020-06-30: :class:`IndexersOperations` - * 2020-06-30-Preview: :class:`IndexersOperations` + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.data_sources = DataSourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.indexers = IndexersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.skillsets = SkillsetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.synonym_maps = SynonymMapsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :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.pipeline.transport.AsyncHttpResponse """ - api_version = self._get_api_version('indexers') - if api_version == '2020-06-30': - from ..v2020_06.aio.operations import IndexersOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from ..v2020_06_preview.aio.operations import IndexersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'indexers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def indexes(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`IndexesOperations` - * 2020-06-30-Preview: :class:`IndexesOperations` - """ - api_version = self._get_api_version('indexes') - if api_version == '2020-06-30': - from ..v2020_06.aio.operations import IndexesOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from ..v2020_06_preview.aio.operations import IndexesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'indexes'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def skillsets(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`SkillsetsOperations` - * 2020-06-30-Preview: :class:`SkillsetsOperations` - """ - api_version = self._get_api_version('skillsets') - if api_version == '2020-06-30': - from ..v2020_06.aio.operations import SkillsetsOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from ..v2020_06_preview.aio.operations import SkillsetsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'skillsets'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def synonym_maps(self): - """Instance depends on the API version: - - * 2020-06-30: :class:`SynonymMapsOperations` - * 2020-06-30-Preview: :class:`SynonymMapsOperations` - """ - api_version = self._get_api_version('synonym_maps') - if api_version == '2020-06-30': - from ..v2020_06.aio.operations import SynonymMapsOperations as OperationClass - elif api_version == '2020-06-30-Preview': - from ..v2020_06_preview.aio.operations import SynonymMapsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'synonym_maps'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - async def close(self): + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: await self._client.close() - async def __aenter__(self): + + async def __aenter__(self) -> "SearchClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details): + + async def __aexit__(self, *exc_details) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/__init__.py similarity index 100% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/__init__.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/__init__.py diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_data_sources_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_data_sources_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py index a2f83fd94073..3ef592ec0482 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_data_sources_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py @@ -24,7 +24,7 @@ class DataSourcesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -53,7 +53,7 @@ async def create_or_update( :param data_source_name: The name of the datasource to create or update. :type data_source_name: str :param data_source: The definition of the datasource to create or update. - :type data_source: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :type data_source: ~azure.search.documents.indexes.models.SearchIndexerDataSource :param if_match: Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value. :type if_match: str @@ -61,10 +61,10 @@ async def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] @@ -148,7 +148,7 @@ async def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -213,10 +213,10 @@ async def get( :param data_source_name: The name of the datasource to retrieve. :type data_source_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] @@ -279,10 +279,10 @@ async def list( properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ListDataSourcesResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ListDataSourcesResult + :rtype: ~azure.search.documents.indexes.models.ListDataSourcesResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListDataSourcesResult"] @@ -342,12 +342,12 @@ async def create( """Creates a new datasource. :param data_source: The definition of the datasource to create. - :type data_source: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :type data_source: ~azure.search.documents.indexes.models.SearchIndexerDataSource :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_indexers_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_indexers_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py index 736371d94059..fe9d684efe69 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_indexers_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py @@ -24,7 +24,7 @@ class IndexersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -50,7 +50,7 @@ async def reset( :param indexer_name: The name of the indexer to reset. :type indexer_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -111,7 +111,7 @@ async def run( :param indexer_name: The name of the indexer to run. :type indexer_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -175,7 +175,7 @@ async def create_or_update( :param indexer_name: The name of the indexer to create or update. :type indexer_name: str :param indexer: The definition of the indexer to create or update. - :type indexer: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :param if_match: Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value. :type if_match: str @@ -183,10 +183,10 @@ async def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :rtype: ~azure.search.documents.indexes.models.SearchIndexer :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] @@ -270,7 +270,7 @@ async def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -335,10 +335,10 @@ async def get( :param indexer_name: The name of the indexer to retrieve. :type indexer_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :rtype: ~azure.search.documents.indexes.models.SearchIndexer :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] @@ -401,10 +401,10 @@ async def list( properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ListIndexersResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ListIndexersResult + :rtype: ~azure.search.documents.indexes.models.ListIndexersResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexersResult"] @@ -464,12 +464,12 @@ async def create( """Creates a new indexer. :param indexer: The definition of the indexer to create. - :type indexer: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :rtype: ~azure.search.documents.indexes.models.SearchIndexer :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] @@ -534,10 +534,10 @@ async def get_status( :param indexer_name: The name of the indexer for which to retrieve status. :type indexer_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerStatus, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerStatus + :rtype: ~azure.search.documents.indexes.models.SearchIndexerStatus :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerStatus"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_indexes_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_indexes_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py index 142b807ffcde..c846ddf13c34 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_indexes_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py @@ -25,7 +25,7 @@ class IndexesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,12 +49,12 @@ async def create( """Creates a new search index. :param index: The definition of the index to create. - :type index: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :type index: ~azure.search.documents.indexes.models.SearchIndex :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] @@ -121,10 +121,10 @@ def list( default is all properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListIndexesResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.v2020_06_preview.models.ListIndexesResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.ListIndexesResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexesResult"] @@ -210,7 +210,7 @@ async def create_or_update( :param index_name: The definition of the index to create or update. :type index_name: str :param index: The definition of the index to create or update. - :type index: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :type index: ~azure.search.documents.indexes.models.SearchIndex :param allow_index_downtime: Allows new analyzers, tokenizers, token filters, or char filters to be added to an index by taking the index offline for at least a few seconds. This temporarily causes indexing and query requests to fail. Performance and write availability of @@ -224,10 +224,10 @@ async def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] @@ -315,7 +315,7 @@ async def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -380,10 +380,10 @@ async def get( :param index_name: The name of the index to retrieve. :type index_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] @@ -444,10 +444,10 @@ async def get_statistics( :param index_name: The name of the index for which to retrieve statistics. :type index_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: GetIndexStatisticsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.GetIndexStatisticsResult + :rtype: ~azure.search.documents.indexes.models.GetIndexStatisticsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GetIndexStatisticsResult"] @@ -509,12 +509,12 @@ async def analyze( :param index_name: The name of the index for which to test an analyzer. :type index_name: str :param request: The text and analyzer or analysis components to test. - :type request: ~azure.search.documents.indexes.v2020_06_preview.models.AnalyzeRequest + :type request: ~azure.search.documents.indexes.models.AnalyzeRequest :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.AnalyzeResult + :rtype: ~azure.search.documents.indexes.models.AnalyzeResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeResult"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_search_client_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py similarity index 95% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_search_client_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py index e33d9f5319ba..423fceea864a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_search_client_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py @@ -27,10 +27,10 @@ async def get_service_statistics( """Gets service level statistics for a search service. :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceStatistics, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceStatistics + :rtype: ~azure.search.documents.indexes.models.ServiceStatistics :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceStatistics"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_skillsets_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_skillsets_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py index 7065b94f82d0..01a6fd2182e5 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_skillsets_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py @@ -24,7 +24,7 @@ class SkillsetsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,7 +54,7 @@ async def create_or_update( :type skillset_name: str :param skillset: The skillset containing one or more skills to create or update in a search service. - :type skillset: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset :param if_match: Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value. :type if_match: str @@ -62,10 +62,10 @@ async def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] @@ -149,7 +149,7 @@ async def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -214,10 +214,10 @@ async def get( :param skillset_name: The name of the skillset to retrieve. :type skillset_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] @@ -280,10 +280,10 @@ async def list( properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ListSkillsetsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ListSkillsetsResult + :rtype: ~azure.search.documents.indexes.models.ListSkillsetsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListSkillsetsResult"] @@ -343,12 +343,12 @@ async def create( """Creates a new skillset in a search service. :param skillset: The skillset containing one or more skills to create in a search service. - :type skillset: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_synonym_maps_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_synonym_maps_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py index 66aa2688a2e7..f2c9e19c871b 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_synonym_maps_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py @@ -24,7 +24,7 @@ class SynonymMapsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -53,7 +53,7 @@ async def create_or_update( :param synonym_map_name: The name of the synonym map to create or update. :type synonym_map_name: str :param synonym_map: The definition of the synonym map to create or update. - :type synonym_map: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap :param if_match: Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value. :type if_match: str @@ -61,10 +61,10 @@ async def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :rtype: ~azure.search.documents.indexes.models.SynonymMap :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] @@ -148,7 +148,7 @@ async def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -213,10 +213,10 @@ async def get( :param synonym_map_name: The name of the synonym map to retrieve. :type synonym_map_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :rtype: ~azure.search.documents.indexes.models.SynonymMap :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] @@ -279,10 +279,10 @@ async def list( properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ListSynonymMapsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ListSynonymMapsResult + :rtype: ~azure.search.documents.indexes.models.ListSynonymMapsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListSynonymMapsResult"] @@ -342,12 +342,12 @@ async def create( """Creates a new synonym map. :param synonym_map: The definition of the synonym map to create. - :type synonym_map: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :rtype: ~azure.search.documents.indexes.models.SynonymMap :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models.py deleted file mode 100644 index a85a4800fedc..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models.py +++ /dev/null @@ -1,7 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -from .v2020_06_preview.models import * diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py similarity index 100% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/__init__.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py similarity index 93% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/_models.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py index abaf240c8e0c..874f89a7aa73 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py @@ -65,8 +65,8 @@ class AnalyzeRequest(msrest.serialization.Model): :param analyzer: The name of the analyzer to use to break the given text. If this parameter is not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters are mutually exclusive. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", - "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- - Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", + "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", + "zh-Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", @@ -74,30 +74,26 @@ class AnalyzeRequest(msrest.serialization.Model): "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", - "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- - PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", + "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", + "pt-PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzerName + :type analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName :param tokenizer: The name of the tokenizer to use to break the given text. If this parameter is not specified, you must specify an analyzer instead. The tokenizer and analyzer parameters are mutually exclusive. Possible values include: "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalTokenizerName + :type tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName :param token_filters: An optional list of token filters to use when breaking the given text. This parameter can only be set when using the tokenizer parameter. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenFilterName] + :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] :param char_filters: An optional list of character filters to use when breaking the given text. This parameter can only be set when using the tokenizer parameter. - :type char_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.CharFilterName] + :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -130,7 +126,7 @@ class AnalyzeResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param tokens: Required. The list of tokens returned by the analyzer specified in the request. - :type tokens: list[~azure.search.documents.indexes.v2020_06_preview.models.AnalyzedTokenInfo] + :type tokens: list[~azure.search.documents.indexes.models.AnalyzedTokenInfo] """ _validation = { @@ -380,7 +376,7 @@ class CjkBigramTokenFilter(TokenFilter): :type name: str :param ignore_scripts: The scripts to ignore. :type ignore_scripts: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.CjkBigramTokenFilterScripts] + ~azure.search.documents.indexes.models.CjkBigramTokenFilterScripts] :param output_unigrams: A value indicating whether to output both unigrams and bigrams (if true), or just bigrams (if false). Default is false. :type output_unigrams: bool @@ -654,12 +650,10 @@ class SearchIndexerSkill(msrest.serialization.Model): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -714,12 +708,10 @@ class ConditionalSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -751,8 +743,9 @@ class CorsOptions(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param allowed_origins: Required. The list of origins from which JavaScript code will be - granted access to your index. Can contain a list of hosts of the form {protocol}://{fully- - qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not recommended). + granted access to your index. Can contain a list of hosts of the form + {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not + recommended). :type allowed_origins: list[str] :param max_age_in_seconds: The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes. @@ -834,18 +827,15 @@ class CustomAnalyzer(LexicalAnalyzer): "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalTokenizerName + :type tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName :param token_filters: A list of token filters used to filter out or modify the tokens generated by a tokenizer. For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenFilterName] + :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] :param char_filters: A list of character filters used to prepare input text before it is processed by the tokenizer. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. - :type char_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.CharFilterName] + :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -922,7 +912,7 @@ class CustomEntity(msrest.serialization.Model): :type default_fuzzy_edit_distance: int :param aliases: An array of complex objects that can be used to specify alternative spellings or synonyms to the root entity name. - :type aliases: list[~azure.search.documents.indexes.v2020_06_preview.models.CustomEntityAlias] + :type aliases: list[~azure.search.documents.indexes.models.CustomEntityAlias] """ _validation = { @@ -1020,24 +1010,21 @@ class CustomEntityLookupSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.CustomEntityLookupSkillLanguage + ~azure.search.documents.indexes.models.CustomEntityLookupSkillLanguage :param entities_definition_uri: Path to a JSON or CSV file containing all the target text to match against. This entity definition is read at the beginning of an indexer run. Any updates to this file during an indexer run will not take effect until subsequent runs. This config must be accessible over HTTPS. :type entities_definition_uri: str :param inline_entities_definition: The inline CustomEntity definition. - :type inline_entities_definition: - list[~azure.search.documents.indexes.v2020_06_preview.models.CustomEntity] + :type inline_entities_definition: list[~azure.search.documents.indexes.models.CustomEntity] :param global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is not set in CustomEntity, this value will be the default value. :type global_default_case_sensitive: bool @@ -1132,13 +1119,11 @@ class CustomNormalizer(LexicalNormalizer): :param token_filters: A list of token filters used to filter out or modify the input token. For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenFilterName] + :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] :param char_filters: A list of character filters used to prepare input text before it is processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. - :type char_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.CharFilterName] + :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -1158,7 +1143,6 @@ def __init__( **kwargs ): super(CustomNormalizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.CustomNormalizer' self.token_filters = kwargs.get('token_filters', None) self.char_filters = kwargs.get('char_filters', None) @@ -1357,8 +1341,7 @@ class ScoringFunction(msrest.serialization.Model): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation """ _validation = { @@ -1405,11 +1388,9 @@ class DistanceScoringFunction(ScoringFunction): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation :param parameters: Required. Parameter values for the distance scoring function. - :type parameters: - ~azure.search.documents.indexes.v2020_06_preview.models.DistanceScoringParameters + :type parameters: ~azure.search.documents.indexes.models.DistanceScoringParameters """ _validation = { @@ -1488,12 +1469,10 @@ class DocumentExtractionSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. :type parsing_mode: str :param data_to_extract: The type of data to be extracted for the skill. Will be set to @@ -1551,8 +1530,7 @@ class EdgeNGramTokenFilter(TokenFilter): :type max_gram: int :param side: Specifies which side of the input the n-gram should be generated from. Default is "front". Possible values include: "front", "back". - :type side: str or - ~azure.search.documents.indexes.v2020_06_preview.models.EdgeNGramTokenFilterSide + :type side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide """ _validation = { @@ -1598,8 +1576,7 @@ class EdgeNGramTokenFilterV2(TokenFilter): :type max_gram: int :param side: Specifies which side of the input the n-gram should be generated from. Default is "front". Possible values include: "front", "back". - :type side: str or - ~azure.search.documents.indexes.v2020_06_preview.models.EdgeNGramTokenFilterSide + :type side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide """ _validation = { @@ -1646,8 +1623,7 @@ class EdgeNGramTokenizer(LexicalTokenizer): :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. :type max_gram: int :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenCharacterKind] + :type token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] """ _validation = { @@ -1732,20 +1708,17 @@ class EntityRecognitionSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param categories: A list of entity categories that should be extracted. - :type categories: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.EntityCategory] + :type categories: list[str or ~azure.search.documents.indexes.models.EntityCategory] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "ar", "cs", "zh-Hans", "zh-Hant", "da", "nl", "en", "fi", "fr", "de", "el", "hu", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv", "tr". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.EntityRecognitionSkillLanguage + ~azure.search.documents.indexes.models.EntityRecognitionSkillLanguage :param include_typeless_entities: Determines whether or not to include entities which are well known but don't conform to a pre-defined type. If this configuration is not set (default), set to null or set to false, entities which don't conform to one of the pre-defined types will not @@ -1799,8 +1772,7 @@ class FieldMapping(msrest.serialization.Model): name by default. :type target_field_name: str :param mapping_function: A function to apply to each source field value before indexing. - :type mapping_function: - ~azure.search.documents.indexes.v2020_06_preview.models.FieldMappingFunction + :type mapping_function: ~azure.search.documents.indexes.models.FieldMappingFunction """ _validation = { @@ -1869,11 +1841,9 @@ class FreshnessScoringFunction(ScoringFunction): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation :param parameters: Required. Parameter values for the freshness scoring function. - :type parameters: - ~azure.search.documents.indexes.v2020_06_preview.models.FreshnessScoringParameters + :type parameters: ~azure.search.documents.indexes.models.FreshnessScoringParameters """ _validation = { @@ -2009,21 +1979,18 @@ class ImageAnalysisSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "en", "es", "ja", "pt", "zh". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ImageAnalysisSkillLanguage + ~azure.search.documents.indexes.models.ImageAnalysisSkillLanguage :param visual_features: A list of visual features. - :type visual_features: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.VisualFeature] + :type visual_features: list[str or ~azure.search.documents.indexes.models.VisualFeature] :param details: A string indicating which domain-specific details to return. - :type details: list[str or ~azure.search.documents.indexes.v2020_06_preview.models.ImageDetail] + :type details: list[str or ~azure.search.documents.indexes.models.ImageDetail] """ _validation = { @@ -2064,8 +2031,7 @@ class IndexerExecutionResult(msrest.serialization.Model): :ivar status: Required. The outcome of this indexer execution. Possible values include: "transientFailure", "success", "inProgress", "reset". - :vartype status: str or - ~azure.search.documents.indexes.v2020_06_preview.models.IndexerExecutionStatus + :vartype status: str or ~azure.search.documents.indexes.models.IndexerExecutionStatus :ivar error_message: The error message indicating the top-level error, if any. :vartype error_message: str :ivar start_time: The start time of this indexer execution. @@ -2073,11 +2039,9 @@ class IndexerExecutionResult(msrest.serialization.Model): :ivar end_time: The end time of this indexer execution, if the execution has already completed. :vartype end_time: ~datetime.datetime :ivar errors: Required. The item-level indexing errors. - :vartype errors: - list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerError] + :vartype errors: list[~azure.search.documents.indexes.models.SearchIndexerError] :ivar warnings: Required. The item-level indexing warnings. - :vartype warnings: - list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerWarning] + :vartype warnings: list[~azure.search.documents.indexes.models.SearchIndexerWarning] :ivar item_count: Required. The number of items that were processed during this indexer execution. This includes both successfully processed items and items where indexing was attempted but failed. @@ -2148,8 +2112,7 @@ class IndexingParameters(msrest.serialization.Model): :type max_failed_items_per_batch: int :param configuration: A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - :type configuration: - ~azure.search.documents.indexes.v2020_06_preview.models.IndexingParametersConfiguration + :type configuration: ~azure.search.documents.indexes.models.IndexingParametersConfiguration """ _attribute_map = { @@ -2179,8 +2142,7 @@ class IndexingParametersConfiguration(msrest.serialization.Model): :param parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. Possible values include: "default", "text", "delimitedText", "json", "jsonArray", "jsonLines". Default value: "default". - :type parsing_mode: str or - ~azure.search.documents.indexes.v2020_06_preview.models.BlobIndexerParsingMode + :type parsing_mode: str or ~azure.search.documents.indexes.models.BlobIndexerParsingMode :param excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore when processing from Azure blob storage. For example, you could exclude ".png, .mp4" to skip over those files during indexing. @@ -2218,14 +2180,12 @@ class IndexingParametersConfiguration(msrest.serialization.Model): than "none". This applies to embedded image content in a .PDF or other application, or image files such as .jpg and .png, in Azure blobs. Possible values include: "storageMetadata", "allMetadata", "contentAndMetadata". Default value: "contentAndMetadata". - :type data_to_extract: str or - ~azure.search.documents.indexes.v2020_06_preview.models.BlobIndexerDataToExtract + :type data_to_extract: str or ~azure.search.documents.indexes.models.BlobIndexerDataToExtract :param image_action: Determines how to process embedded images and image files in Azure blob storage. Setting the "imageAction" configuration to any value other than "none" requires that a skillset also be attached to that indexer. Possible values include: "none", "generateNormalizedImages", "generateNormalizedImagePerPage". Default value: "none". - :type image_action: str or - ~azure.search.documents.indexes.v2020_06_preview.models.BlobIndexerImageAction + :type image_action: str or ~azure.search.documents.indexes.models.BlobIndexerImageAction :param allow_skillset_to_read_file_data: If true, will create a path //document//file_data that is an object representing the original file data downloaded from your blob data source. This allows you to pass the original file data to a custom skill for processing within the @@ -2234,11 +2194,11 @@ class IndexingParametersConfiguration(msrest.serialization.Model): :param pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files in Azure blob storage. Possible values include: "none", "detectAngles". Default value: "none". :type pdf_text_rotation_algorithm: str or - ~azure.search.documents.indexes.v2020_06_preview.models.BlobIndexerPDFTextRotationAlgorithm + ~azure.search.documents.indexes.models.BlobIndexerPDFTextRotationAlgorithm :param execution_environment: Specifies the environment in which the indexer should execute. Possible values include: "standard", "private". Default value: "standard". :type execution_environment: str or - ~azure.search.documents.indexes.v2020_06_preview.models.IndexerExecutionEnvironment + ~azure.search.documents.indexes.models.IndexerExecutionEnvironment :param query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL database data sources, specified in the format "hh:mm:ss". :type query_timeout: str @@ -2329,8 +2289,7 @@ class InputFieldMappingEntry(msrest.serialization.Model): :param source_context: The source context used for selecting recursive inputs. :type source_context: str :param inputs: The recursive inputs used when creating a complex type. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] """ _validation = { @@ -2417,20 +2376,22 @@ class KeyPhraseExtractionSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", "pt- - PT", "pt-BR", "ru", "es", "sv". + Possible values include: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", + "pt-PT", "pt-BR", "ru", "es", "sv". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.KeyPhraseExtractionSkillLanguage + ~azure.search.documents.indexes.models.KeyPhraseExtractionSkillLanguage :param max_key_phrase_count: A number indicating how many key phrases to return. If absent, all identified key phrases will be returned. :type max_key_phrase_count: int + :param model_version: The version of the model to use when calling the Text Analytics service. + It will default to the latest available when not specified. We recommend you do not specify + this value unless absolutely necessary. + :type model_version: str """ _validation = { @@ -2448,6 +2409,7 @@ class KeyPhraseExtractionSkill(SearchIndexerSkill): 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, 'max_key_phrase_count': {'key': 'maxKeyPhraseCount', 'type': 'int'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, } def __init__( @@ -2458,6 +2420,7 @@ def __init__( self.odata_type = '#Microsoft.Skills.Text.KeyPhraseExtractionSkill' # type: str self.default_language_code = kwargs.get('default_language_code', None) self.max_key_phrase_count = kwargs.get('max_key_phrase_count', None) + self.model_version = kwargs.get('model_version', None) class KeywordMarkerTokenFilter(TokenFilter): @@ -2596,12 +2559,17 @@ class LanguageDetectionSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :param default_country_hint: A country code to use as a hint to the language detection model if + it cannot disambiguate the language. + :type default_country_hint: str + :param model_version: The version of the model to use when calling the Text Analytics service. + It will default to the latest available when not specified. We recommend you do not specify + this value unless absolutely necessary. + :type model_version: str """ _validation = { @@ -2617,6 +2585,8 @@ class LanguageDetectionSkill(SearchIndexerSkill): 'context': {'key': 'context', 'type': 'str'}, 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, + 'default_country_hint': {'key': 'defaultCountryHint', 'type': 'str'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, } def __init__( @@ -2625,6 +2595,8 @@ def __init__( ): super(LanguageDetectionSkill, self).__init__(**kwargs) self.odata_type = '#Microsoft.Skills.Text.LanguageDetectionSkill' # type: str + self.default_country_hint = kwargs.get('default_country_hint', None) + self.model_version = kwargs.get('model_version', None) class LengthTokenFilter(TokenFilter): @@ -2719,8 +2691,7 @@ class ListDataSourcesResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar data_sources: Required. The datasources in the Search service. - :vartype data_sources: - list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource] + :vartype data_sources: list[~azure.search.documents.indexes.models.SearchIndexerDataSource] """ _validation = { @@ -2747,7 +2718,7 @@ class ListIndexersResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar indexers: Required. The indexers in the Search service. - :vartype indexers: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer] + :vartype indexers: list[~azure.search.documents.indexes.models.SearchIndexer] """ _validation = { @@ -2774,7 +2745,7 @@ class ListIndexesResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar indexes: Required. The indexes in the Search service. - :vartype indexes: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex] + :vartype indexes: list[~azure.search.documents.indexes.models.SearchIndex] """ _validation = { @@ -2801,8 +2772,7 @@ class ListSkillsetsResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar skillsets: Required. The skillsets defined in the Search service. - :vartype skillsets: - list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset] + :vartype skillsets: list[~azure.search.documents.indexes.models.SearchIndexerSkillset] """ _validation = { @@ -2829,7 +2799,7 @@ class ListSynonymMapsResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar synonym_maps: Required. The synonym maps in the Search service. - :vartype synonym_maps: list[~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap] + :vartype synonym_maps: list[~azure.search.documents.indexes.models.SynonymMap] """ _validation = { @@ -2981,11 +2951,9 @@ class MagnitudeScoringFunction(ScoringFunction): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation :param parameters: Required. Parameter values for the magnitude scoring function. - :type parameters: - ~azure.search.documents.indexes.v2020_06_preview.models.MagnitudeScoringParameters + :type parameters: ~azure.search.documents.indexes.models.MagnitudeScoringParameters """ _validation = { @@ -3105,12 +3073,10 @@ class MergeSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is an empty space. :type insert_pre_tag: str @@ -3174,7 +3140,7 @@ class MicrosoftLanguageStemmingTokenizer(LexicalTokenizer): "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovak", "slovenian", "spanish", "swedish", "tamil", "telugu", "turkish", "ukrainian", "urdu". :type language: str or - ~azure.search.documents.indexes.v2020_06_preview.models.MicrosoftStemmingTokenizerLanguage + ~azure.search.documents.indexes.models.MicrosoftStemmingTokenizerLanguage """ _validation = { @@ -3229,8 +3195,7 @@ class MicrosoftLanguageTokenizer(LexicalTokenizer): "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovenian", "spanish", "swedish", "tamil", "telugu", "thai", "ukrainian", "urdu", "vietnamese". - :type language: str or - ~azure.search.documents.indexes.v2020_06_preview.models.MicrosoftTokenizerLanguage + :type language: str or ~azure.search.documents.indexes.models.MicrosoftTokenizerLanguage """ _validation = { @@ -3360,8 +3325,7 @@ class NGramTokenizer(LexicalTokenizer): :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. :type max_gram: int :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenCharacterKind] + :type token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] """ _validation = { @@ -3410,18 +3374,15 @@ class OcrSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "zh-Hans", "zh-Hant", "cs", "da", "nl", "en", "fi", "fr", "de", "el", - "hu", "it", "ja", "ko", "nb", "pl", "pt", "ru", "es", "sv", "tr", "ar", "ro", "sr-Cyrl", "sr- - Latn", "sk". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.OcrSkillLanguage + "hu", "it", "ja", "ko", "nb", "pl", "pt", "ru", "es", "sv", "tr", "ar", "ro", "sr-Cyrl", + "sr-Latn", "sk". + :type default_language_code: str or ~azure.search.documents.indexes.models.OcrSkillLanguage :param should_detect_orientation: A value indicating to turn orientation detection on or not. Default is false. :type should_detect_orientation: bool @@ -3557,7 +3518,7 @@ class PatternAnalyzer(LexicalAnalyzer): :type pattern: str :param flags: Regular expression flags. Possible values include: "CANON_EQ", "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.v2020_06_preview.models.RegexFlags + :type flags: str or ~azure.search.documents.indexes.models.RegexFlags :param stopwords: A list of stopwords. :type stopwords: list[str] """ @@ -3731,7 +3692,7 @@ class PatternTokenizer(LexicalTokenizer): :type pattern: str :param flags: Regular expression flags. Possible values include: "CANON_EQ", "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.v2020_06_preview.models.RegexFlags + :type flags: str or ~azure.search.documents.indexes.models.RegexFlags :param group: The zero-based ordinal of the matching group in the regular expression pattern to extract into tokens. Use -1 if you want to use the entire pattern to split the input into tokens, irrespective of matching groups. Default is -1. @@ -3777,7 +3738,7 @@ class PhoneticTokenFilter(TokenFilter): :param encoder: The phonetic encoder to use. Default is "metaphone". Possible values include: "metaphone", "doubleMetaphone", "soundex", "refinedSoundex", "caverphone1", "caverphone2", "cologne", "nysiis", "koelnerPhonetik", "haasePhonetik", "beiderMorse". - :type encoder: str or ~azure.search.documents.indexes.v2020_06_preview.models.PhoneticEncoder + :type encoder: str or ~azure.search.documents.indexes.models.PhoneticEncoder :param replace_original_tokens: A value indicating whether encoded tokens should replace original tokens. If false, encoded tokens are added as synonyms. Default is true. :type replace_original_tokens: bool @@ -3862,14 +3823,14 @@ class ScoringProfile(msrest.serialization.Model): :type name: str :param text_weights: Parameters that boost scoring based on text matches in certain index fields. - :type text_weights: ~azure.search.documents.indexes.v2020_06_preview.models.TextWeights + :type text_weights: ~azure.search.documents.indexes.models.TextWeights :param functions: The collection of functions that influence the scoring of documents. - :type functions: list[~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunction] + :type functions: list[~azure.search.documents.indexes.models.ScoringFunction] :param function_aggregation: A value indicating how the results of individual scoring functions should be combined. Defaults to "Sum". Ignored if there are no scoring functions. Possible values include: "sum", "average", "minimum", "maximum", "firstMatching". :type function_aggregation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionAggregation + ~azure.search.documents.indexes.models.ScoringFunctionAggregation """ _validation = { @@ -3906,7 +3867,7 @@ class SearchError(msrest.serialization.Model): :ivar message: Required. A human-readable representation of the error. :vartype message: str :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchError] + :vartype details: list[~azure.search.documents.indexes.models.SearchError] """ _validation = { @@ -3942,7 +3903,7 @@ class SearchField(msrest.serialization.Model): :param type: Required. The data type of the field. Possible values include: "Edm.String", "Edm.Int32", "Edm.Int64", "Edm.Double", "Edm.Boolean", "Edm.DateTimeOffset", "Edm.GeographyPoint", "Edm.ComplexType". - :type type: str or ~azure.search.documents.indexes.v2020_06_preview.models.SearchFieldDataType + :type type: str or ~azure.search.documents.indexes.models.SearchFieldDataType :param key: A value indicating whether the field uniquely identifies documents in the index. Exactly one top-level field in each index must be chosen as the key field and it must be of type Edm.String. Key fields can be used to look up documents directly and update or delete @@ -3994,8 +3955,8 @@ class SearchField(msrest.serialization.Model): with searchable fields and it can't be set together with either searchAnalyzer or indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", - "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- - Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", + "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", + "zh-Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", @@ -4003,47 +3964,45 @@ class SearchField(msrest.serialization.Model): "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", - "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- - PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", + "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", + "pt-PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzerName + :type analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName :param search_analyzer: The name of the analyzer used at search time for the field. This option can be used only with searchable fields. It must be set together with indexAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. This analyzer can be updated on an existing field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", - "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", "zh- - Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", - "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", - "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", - "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", "he.microsoft", "hi.microsoft", - "hi.lucene", "hu.microsoft", "hu.lucene", "is.microsoft", "id.microsoft", "id.lucene", - "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", "kn.microsoft", - "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", - "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", "fa.lucene", "pl.microsoft", - "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", "pt-PT.lucene", - "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr- - cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", + "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", + "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", + "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", + "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", + "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", "he.microsoft", + "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", "is.microsoft", "id.microsoft", + "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", + "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", + "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", "fa.lucene", + "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", + "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", + "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type search_analyzer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzerName + :type search_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName :param index_analyzer: The name of the analyzer used at indexing time for the field. This option can be used only with searchable fields. It must be set together with searchAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", - "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh- - Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", + "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", + "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", @@ -4052,20 +4011,18 @@ class SearchField(msrest.serialization.Model): "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", - "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr- - cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", + "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", + "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type index_analyzer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzerName + :type index_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName :param normalizer: The name of the normalizer to use for the field. This option can be used only with fields with filterable, sortable, or facetable enabled. Once the normalizer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "asciifolding", "elision", "lowercase", "standard", "uppercase". - :type normalizer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalNormalizerName + :type normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName :param synonym_maps: A list of the names of synonym maps to associate with this field. This option can be used only with searchable fields. Currently only one synonym map per field is supported. Assigning a synonym map to a field ensures that query terms targeting that field are @@ -4074,7 +4031,7 @@ class SearchField(msrest.serialization.Model): :type synonym_maps: list[str] :param fields: A list of sub-fields if this is a field of type Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty for simple fields. - :type fields: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchField] + :type fields: list[~azure.search.documents.indexes.models.SearchField] """ _validation = { @@ -4128,30 +4085,27 @@ class SearchIndex(msrest.serialization.Model): :param name: Required. The name of the index. :type name: str :param fields: Required. The fields of the index. - :type fields: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchField] + :type fields: list[~azure.search.documents.indexes.models.SearchField] :param scoring_profiles: The scoring profiles for the index. - :type scoring_profiles: - list[~azure.search.documents.indexes.v2020_06_preview.models.ScoringProfile] + :type scoring_profiles: list[~azure.search.documents.indexes.models.ScoringProfile] :param default_scoring_profile: The name of the scoring profile to use if none is specified in the query. If this property is not set and no scoring profile is specified in the query, then default scoring (tf-idf) will be used. :type default_scoring_profile: str :param cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. - :type cors_options: ~azure.search.documents.indexes.v2020_06_preview.models.CorsOptions + :type cors_options: ~azure.search.documents.indexes.models.CorsOptions :param suggesters: The suggesters for the index. - :type suggesters: list[~azure.search.documents.indexes.v2020_06_preview.models.Suggester] + :type suggesters: list[~azure.search.documents.indexes.models.Suggester] :param analyzers: The analyzers for the index. - :type analyzers: list[~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzer] + :type analyzers: list[~azure.search.documents.indexes.models.LexicalAnalyzer] :param tokenizers: The tokenizers for the index. - :type tokenizers: - list[~azure.search.documents.indexes.v2020_06_preview.models.LexicalTokenizer] + :type tokenizers: list[~azure.search.documents.indexes.models.LexicalTokenizer] :param token_filters: The token filters for the index. - :type token_filters: list[~azure.search.documents.indexes.v2020_06_preview.models.TokenFilter] + :type token_filters: list[~azure.search.documents.indexes.models.TokenFilter] :param char_filters: The character filters for the index. - :type char_filters: list[~azure.search.documents.indexes.v2020_06_preview.models.CharFilter] + :type char_filters: list[~azure.search.documents.indexes.models.CharFilter] :param normalizers: The normalizers for the index. - :type normalizers: - list[~azure.search.documents.indexes.v2020_06_preview.models.LexicalNormalizer] + :type normalizers: list[~azure.search.documents.indexes.models.LexicalNormalizer] :param encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive @@ -4160,13 +4114,12 @@ class SearchIndex(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey :param similarity: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. - :type similarity: ~azure.search.documents.indexes.v2020_06_preview.models.Similarity + :type similarity: ~azure.search.documents.indexes.models.Similarity :param e_tag: The ETag of the index. :type e_tag: str """ @@ -4231,17 +4184,15 @@ class SearchIndexer(msrest.serialization.Model): :param target_index_name: Required. The name of the index to which this indexer writes data. :type target_index_name: str :param schedule: The schedule for this indexer. - :type schedule: ~azure.search.documents.indexes.v2020_06_preview.models.IndexingSchedule + :type schedule: ~azure.search.documents.indexes.models.IndexingSchedule :param parameters: Parameters for indexer execution. - :type parameters: ~azure.search.documents.indexes.v2020_06_preview.models.IndexingParameters + :type parameters: ~azure.search.documents.indexes.models.IndexingParameters :param field_mappings: Defines mappings between fields in the data source and corresponding target fields in the index. - :type field_mappings: - list[~azure.search.documents.indexes.v2020_06_preview.models.FieldMapping] + :type field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] :param output_field_mappings: Output field mappings are applied after enrichment and immediately before indexing. - :type output_field_mappings: - list[~azure.search.documents.indexes.v2020_06_preview.models.FieldMapping] + :type output_field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] :param is_disabled: A value indicating whether the indexer is disabled. Default is false. :type is_disabled: bool :param e_tag: The ETag of the indexer. @@ -4255,8 +4206,7 @@ class SearchIndexer(msrest.serialization.Model): rotate your encryption key; Your indexer definition (and indexer execution status) will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -4341,20 +4291,17 @@ class SearchIndexerDataSource(msrest.serialization.Model): :type description: str :param type: Required. The type of the datasource. Possible values include: "azuresql", "cosmosdb", "azureblob", "azuretable", "mysql", "adlsgen2". - :type type: str or - ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSourceType + :type type: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceType :param credentials: Required. Credentials for the datasource. - :type credentials: - ~azure.search.documents.indexes.v2020_06_preview.models.DataSourceCredentials + :type credentials: ~azure.search.documents.indexes.models.DataSourceCredentials :param container: Required. The data container for the datasource. - :type container: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataContainer + :type container: ~azure.search.documents.indexes.models.SearchIndexerDataContainer :param data_change_detection_policy: The data change detection policy for the datasource. :type data_change_detection_policy: - ~azure.search.documents.indexes.v2020_06_preview.models.DataChangeDetectionPolicy + ~azure.search.documents.indexes.models.DataChangeDetectionPolicy :param data_deletion_detection_policy: The data deletion detection policy for the datasource. :type data_deletion_detection_policy: - ~azure.search.documents.indexes.v2020_06_preview.models.DataDeletionDetectionPolicy + ~azure.search.documents.indexes.models.DataDeletionDetectionPolicy :param e_tag: The ETag of the data source. :type e_tag: str :param encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -4366,8 +4313,7 @@ class SearchIndexerDataSource(msrest.serialization.Model): encryption key; Your datasource definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -4512,11 +4458,11 @@ class SearchIndexerSkillset(msrest.serialization.Model): :param description: The description of the skillset. :type description: str :param skills: Required. A list of skills in the skillset. - :type skills: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkill] + :type skills: list[~azure.search.documents.indexes.models.SearchIndexerSkill] :param cognitive_services_account: Details about cognitive services to be used when running skills. :type cognitive_services_account: - ~azure.search.documents.indexes.v2020_06_preview.models.CognitiveServicesAccount + ~azure.search.documents.indexes.models.CognitiveServicesAccount :param e_tag: The ETag of the skillset. :type e_tag: str :param encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -4528,8 +4474,7 @@ class SearchIndexerSkillset(msrest.serialization.Model): encryption key; Your skillset definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -4568,16 +4513,14 @@ class SearchIndexerStatus(msrest.serialization.Model): :ivar status: Required. Overall indexer status. Possible values include: "unknown", "error", "running". - :vartype status: str or ~azure.search.documents.indexes.v2020_06_preview.models.IndexerStatus + :vartype status: str or ~azure.search.documents.indexes.models.IndexerStatus :ivar last_result: The result of the most recent or an in-progress indexer execution. - :vartype last_result: - ~azure.search.documents.indexes.v2020_06_preview.models.IndexerExecutionResult + :vartype last_result: ~azure.search.documents.indexes.models.IndexerExecutionResult :ivar execution_history: Required. History of the recent indexer executions, sorted in reverse chronological order. - :vartype execution_history: - list[~azure.search.documents.indexes.v2020_06_preview.models.IndexerExecutionResult] + :vartype execution_history: list[~azure.search.documents.indexes.models.IndexerExecutionResult] :ivar limits: Required. The execution limits for the indexer. - :vartype limits: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerLimits + :vartype limits: ~azure.search.documents.indexes.models.SearchIndexerLimits """ _validation = { @@ -4668,13 +4611,13 @@ class SearchResourceEncryptionKey(msrest.serialization.Model): your data at rest. :type key_version: str :param vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, that - contains the key to be used to encrypt your data at rest. An example URI might be https://my- - keyvault-name.vault.azure.net. + contains the key to be used to encrypt your data at rest. An example URI might be + https://my-keyvault-name.vault.azure.net. :type vault_uri: str :param access_credentials: Optional Azure Active Directory credentials used for accessing your Azure Key Vault. Not required if using managed identity instead. :type access_credentials: - ~azure.search.documents.indexes.v2020_06_preview.models.AzureActiveDirectoryApplicationCredentials + ~azure.search.documents.indexes.models.AzureActiveDirectoryApplicationCredentials """ _validation = { @@ -4721,17 +4664,15 @@ class SentimentSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "nl", "en", "fi", "fr", "de", "el", "it", "no", "pl", "pt-PT", "ru", "es", "sv", "tr". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.SentimentSkillLanguage + ~azure.search.documents.indexes.models.SentimentSkillLanguage """ _validation = { @@ -4765,22 +4706,19 @@ class ServiceCounters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param document_counter: Required. Total number of documents across all indexes in the service. - :type document_counter: ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type document_counter: ~azure.search.documents.indexes.models.ResourceCounter :param index_counter: Required. Total number of indexes. - :type index_counter: ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type index_counter: ~azure.search.documents.indexes.models.ResourceCounter :param indexer_counter: Required. Total number of indexers. - :type indexer_counter: ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type indexer_counter: ~azure.search.documents.indexes.models.ResourceCounter :param data_source_counter: Required. Total number of data sources. - :type data_source_counter: - ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type data_source_counter: ~azure.search.documents.indexes.models.ResourceCounter :param storage_size_counter: Required. Total size of used storage in bytes. - :type storage_size_counter: - ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type storage_size_counter: ~azure.search.documents.indexes.models.ResourceCounter :param synonym_map_counter: Required. Total number of synonym maps. - :type synonym_map_counter: - ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type synonym_map_counter: ~azure.search.documents.indexes.models.ResourceCounter :param skillset_counter: Required. Total number of skillsets. - :type skillset_counter: ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type skillset_counter: ~azure.search.documents.indexes.models.ResourceCounter """ _validation = { @@ -4857,9 +4795,9 @@ class ServiceStatistics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param counters: Required. Service level resource counters. - :type counters: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceCounters + :type counters: ~azure.search.documents.indexes.models.ServiceCounters :param limits: Required. Service level general limits. - :type limits: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceLimits + :type limits: ~azure.search.documents.indexes.models.ServiceLimits """ _validation = { @@ -4901,12 +4839,10 @@ class ShaperSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -5012,8 +4948,7 @@ class SnowballTokenFilter(TokenFilter): "catalan", "danish", "dutch", "english", "finnish", "french", "german", "german2", "hungarian", "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", "russian", "spanish", "swedish", "turkish". - :type language: str or - ~azure.search.documents.indexes.v2020_06_preview.models.SnowballTokenFilterLanguage + :type language: str or ~azure.search.documents.indexes.models.SnowballTokenFilterLanguage """ _validation = { @@ -5091,20 +5026,16 @@ class SplitSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.SplitSkillLanguage + :type default_language_code: str or ~azure.search.documents.indexes.models.SplitSkillLanguage :param text_split_mode: A value indicating which split mode to perform. Possible values include: "pages", "sentences". - :type text_split_mode: str or - ~azure.search.documents.indexes.v2020_06_preview.models.TextSplitMode + :type text_split_mode: str or ~azure.search.documents.indexes.models.TextSplitMode :param maximum_page_length: The desired maximum page length. Default is 10000. :type maximum_page_length: int """ @@ -5223,8 +5154,7 @@ class StemmerTokenFilter(TokenFilter): "latvian", "norwegian", "lightNorwegian", "minimalNorwegian", "lightNynorsk", "minimalNynorsk", "portuguese", "lightPortuguese", "minimalPortuguese", "portugueseRslp", "romanian", "russian", "lightRussian", "spanish", "lightSpanish", "swedish", "lightSwedish", "turkish". - :type language: str or - ~azure.search.documents.indexes.v2020_06_preview.models.StemmerTokenFilterLanguage + :type language: str or ~azure.search.documents.indexes.models.StemmerTokenFilterLanguage """ _validation = { @@ -5305,8 +5235,7 @@ class StopwordsTokenFilter(TokenFilter): "finnish", "french", "galician", "german", "greek", "hindi", "hungarian", "indonesian", "irish", "italian", "latvian", "norwegian", "persian", "portuguese", "romanian", "russian", "sorani", "spanish", "swedish", "thai", "turkish". - :type stopwords_list: str or - ~azure.search.documents.indexes.v2020_06_preview.models.StopwordsList + :type stopwords_list: str or ~azure.search.documents.indexes.models.StopwordsList :param ignore_case: A value indicating whether to ignore case. If true, all words are converted to lower case first. Default is false. :type ignore_case: bool @@ -5404,8 +5333,7 @@ class SynonymMap(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey :param e_tag: The ETag of the synonym map. :type e_tag: str """ @@ -5509,10 +5437,9 @@ class TagScoringFunction(ScoringFunction): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation :param parameters: Required. Parameter values for the tag scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06_preview.models.TagScoringParameters + :type parameters: ~azure.search.documents.indexes.models.TagScoringParameters """ _validation = { @@ -5585,12 +5512,10 @@ class TextTranslationSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_to_language_code: Required. The language code to translate documents into for documents that don't specify the to language explicitly. Possible values include: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", @@ -5599,7 +5524,7 @@ class TextTranslationSkill(SearchIndexerSkill): "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua". :type default_to_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.TextTranslationSkillLanguage + ~azure.search.documents.indexes.models.TextTranslationSkillLanguage :param default_from_language_code: The language code to translate documents from for documents that don't specify the from language explicitly. Possible values include: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", @@ -5608,7 +5533,7 @@ class TextTranslationSkill(SearchIndexerSkill): "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua". :type default_from_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.TextTranslationSkillLanguage + ~azure.search.documents.indexes.models.TextTranslationSkillLanguage :param suggested_from: The language code to translate documents from when neither the fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is unsuccessful. Default is en. Possible values include: "af", @@ -5618,7 +5543,7 @@ class TextTranslationSkill(SearchIndexerSkill): "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua". :type suggested_from: str or - ~azure.search.documents.indexes.v2020_06_preview.models.TextTranslationSkillLanguage + ~azure.search.documents.indexes.models.TextTranslationSkillLanguage """ _validation = { @@ -5809,12 +5734,10 @@ class WebApiSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param uri: Required. The url for the Web API. :type uri: str :param http_headers: The headers required to make the http request. diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/_models_py3.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py similarity index 93% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/_models_py3.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py index 1a1887cff703..bf15c74d5053 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/_models_py3.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py @@ -70,8 +70,8 @@ class AnalyzeRequest(msrest.serialization.Model): :param analyzer: The name of the analyzer to use to break the given text. If this parameter is not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters are mutually exclusive. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", - "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- - Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", + "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", + "zh-Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", @@ -79,30 +79,26 @@ class AnalyzeRequest(msrest.serialization.Model): "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", - "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- - PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", + "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", + "pt-PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzerName + :type analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName :param tokenizer: The name of the tokenizer to use to break the given text. If this parameter is not specified, you must specify an analyzer instead. The tokenizer and analyzer parameters are mutually exclusive. Possible values include: "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalTokenizerName + :type tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName :param token_filters: An optional list of token filters to use when breaking the given text. This parameter can only be set when using the tokenizer parameter. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenFilterName] + :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] :param char_filters: An optional list of character filters to use when breaking the given text. This parameter can only be set when using the tokenizer parameter. - :type char_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.CharFilterName] + :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -141,7 +137,7 @@ class AnalyzeResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param tokens: Required. The list of tokens returned by the analyzer specified in the request. - :type tokens: list[~azure.search.documents.indexes.v2020_06_preview.models.AnalyzedTokenInfo] + :type tokens: list[~azure.search.documents.indexes.models.AnalyzedTokenInfo] """ _validation = { @@ -406,7 +402,7 @@ class CjkBigramTokenFilter(TokenFilter): :type name: str :param ignore_scripts: The scripts to ignore. :type ignore_scripts: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.CjkBigramTokenFilterScripts] + ~azure.search.documents.indexes.models.CjkBigramTokenFilterScripts] :param output_unigrams: A value indicating whether to output both unigrams and bigrams (if true), or just bigrams (if false). Default is false. :type output_unigrams: bool @@ -699,12 +695,10 @@ class SearchIndexerSkill(msrest.serialization.Model): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -765,12 +759,10 @@ class ConditionalSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -808,8 +800,9 @@ class CorsOptions(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param allowed_origins: Required. The list of origins from which JavaScript code will be - granted access to your index. Can contain a list of hosts of the form {protocol}://{fully- - qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not recommended). + granted access to your index. Can contain a list of hosts of the form + {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not + recommended). :type allowed_origins: list[str] :param max_age_in_seconds: The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes. @@ -896,18 +889,15 @@ class CustomAnalyzer(LexicalAnalyzer): "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalTokenizerName + :type tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName :param token_filters: A list of token filters used to filter out or modify the tokens generated by a tokenizer. For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenFilterName] + :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] :param char_filters: A list of character filters used to prepare input text before it is processed by the tokenizer. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. - :type char_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.CharFilterName] + :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -989,7 +979,7 @@ class CustomEntity(msrest.serialization.Model): :type default_fuzzy_edit_distance: int :param aliases: An array of complex objects that can be used to specify alternative spellings or synonyms to the root entity name. - :type aliases: list[~azure.search.documents.indexes.v2020_06_preview.models.CustomEntityAlias] + :type aliases: list[~azure.search.documents.indexes.models.CustomEntityAlias] """ _validation = { @@ -1105,24 +1095,21 @@ class CustomEntityLookupSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.CustomEntityLookupSkillLanguage + ~azure.search.documents.indexes.models.CustomEntityLookupSkillLanguage :param entities_definition_uri: Path to a JSON or CSV file containing all the target text to match against. This entity definition is read at the beginning of an indexer run. Any updates to this file during an indexer run will not take effect until subsequent runs. This config must be accessible over HTTPS. :type entities_definition_uri: str :param inline_entities_definition: The inline CustomEntity definition. - :type inline_entities_definition: - list[~azure.search.documents.indexes.v2020_06_preview.models.CustomEntity] + :type inline_entities_definition: list[~azure.search.documents.indexes.models.CustomEntity] :param global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is not set in CustomEntity, this value will be the default value. :type global_default_case_sensitive: bool @@ -1232,13 +1219,11 @@ class CustomNormalizer(LexicalNormalizer): :param token_filters: A list of token filters used to filter out or modify the input token. For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenFilterName] + :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] :param char_filters: A list of character filters used to prepare input text before it is processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. - :type char_filters: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.CharFilterName] + :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -1263,7 +1248,6 @@ def __init__( **kwargs ): super(CustomNormalizer, self).__init__(odata_type=odata_type, name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.CustomNormalizer' self.token_filters = token_filters self.char_filters = char_filters @@ -1473,8 +1457,7 @@ class ScoringFunction(msrest.serialization.Model): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation """ _validation = { @@ -1525,11 +1508,9 @@ class DistanceScoringFunction(ScoringFunction): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation :param parameters: Required. Parameter values for the distance scoring function. - :type parameters: - ~azure.search.documents.indexes.v2020_06_preview.models.DistanceScoringParameters + :type parameters: ~azure.search.documents.indexes.models.DistanceScoringParameters """ _validation = { @@ -1616,12 +1597,10 @@ class DocumentExtractionSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. :type parsing_mode: str :param data_to_extract: The type of data to be extracted for the skill. Will be set to @@ -1688,8 +1667,7 @@ class EdgeNGramTokenFilter(TokenFilter): :type max_gram: int :param side: Specifies which side of the input the n-gram should be generated from. Default is "front". Possible values include: "front", "back". - :type side: str or - ~azure.search.documents.indexes.v2020_06_preview.models.EdgeNGramTokenFilterSide + :type side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide """ _validation = { @@ -1740,8 +1718,7 @@ class EdgeNGramTokenFilterV2(TokenFilter): :type max_gram: int :param side: Specifies which side of the input the n-gram should be generated from. Default is "front". Possible values include: "front", "back". - :type side: str or - ~azure.search.documents.indexes.v2020_06_preview.models.EdgeNGramTokenFilterSide + :type side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide """ _validation = { @@ -1793,8 +1770,7 @@ class EdgeNGramTokenizer(LexicalTokenizer): :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. :type max_gram: int :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenCharacterKind] + :type token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] """ _validation = { @@ -1887,20 +1863,17 @@ class EntityRecognitionSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param categories: A list of entity categories that should be extracted. - :type categories: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.EntityCategory] + :type categories: list[str or ~azure.search.documents.indexes.models.EntityCategory] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "ar", "cs", "zh-Hans", "zh-Hant", "da", "nl", "en", "fi", "fr", "de", "el", "hu", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv", "tr". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.EntityRecognitionSkillLanguage + ~azure.search.documents.indexes.models.EntityRecognitionSkillLanguage :param include_typeless_entities: Determines whether or not to include entities which are well known but don't conform to a pre-defined type. If this configuration is not set (default), set to null or set to false, entities which don't conform to one of the pre-defined types will not @@ -1964,8 +1937,7 @@ class FieldMapping(msrest.serialization.Model): name by default. :type target_field_name: str :param mapping_function: A function to apply to each source field value before indexing. - :type mapping_function: - ~azure.search.documents.indexes.v2020_06_preview.models.FieldMappingFunction + :type mapping_function: ~azure.search.documents.indexes.models.FieldMappingFunction """ _validation = { @@ -2041,11 +2013,9 @@ class FreshnessScoringFunction(ScoringFunction): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation :param parameters: Required. Parameter values for the freshness scoring function. - :type parameters: - ~azure.search.documents.indexes.v2020_06_preview.models.FreshnessScoringParameters + :type parameters: ~azure.search.documents.indexes.models.FreshnessScoringParameters """ _validation = { @@ -2190,21 +2160,18 @@ class ImageAnalysisSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "en", "es", "ja", "pt", "zh". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ImageAnalysisSkillLanguage + ~azure.search.documents.indexes.models.ImageAnalysisSkillLanguage :param visual_features: A list of visual features. - :type visual_features: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.VisualFeature] + :type visual_features: list[str or ~azure.search.documents.indexes.models.VisualFeature] :param details: A string indicating which domain-specific details to return. - :type details: list[str or ~azure.search.documents.indexes.v2020_06_preview.models.ImageDetail] + :type details: list[str or ~azure.search.documents.indexes.models.ImageDetail] """ _validation = { @@ -2254,8 +2221,7 @@ class IndexerExecutionResult(msrest.serialization.Model): :ivar status: Required. The outcome of this indexer execution. Possible values include: "transientFailure", "success", "inProgress", "reset". - :vartype status: str or - ~azure.search.documents.indexes.v2020_06_preview.models.IndexerExecutionStatus + :vartype status: str or ~azure.search.documents.indexes.models.IndexerExecutionStatus :ivar error_message: The error message indicating the top-level error, if any. :vartype error_message: str :ivar start_time: The start time of this indexer execution. @@ -2263,11 +2229,9 @@ class IndexerExecutionResult(msrest.serialization.Model): :ivar end_time: The end time of this indexer execution, if the execution has already completed. :vartype end_time: ~datetime.datetime :ivar errors: Required. The item-level indexing errors. - :vartype errors: - list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerError] + :vartype errors: list[~azure.search.documents.indexes.models.SearchIndexerError] :ivar warnings: Required. The item-level indexing warnings. - :vartype warnings: - list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerWarning] + :vartype warnings: list[~azure.search.documents.indexes.models.SearchIndexerWarning] :ivar item_count: Required. The number of items that were processed during this indexer execution. This includes both successfully processed items and items where indexing was attempted but failed. @@ -2338,8 +2302,7 @@ class IndexingParameters(msrest.serialization.Model): :type max_failed_items_per_batch: int :param configuration: A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - :type configuration: - ~azure.search.documents.indexes.v2020_06_preview.models.IndexingParametersConfiguration + :type configuration: ~azure.search.documents.indexes.models.IndexingParametersConfiguration """ _attribute_map = { @@ -2374,8 +2337,7 @@ class IndexingParametersConfiguration(msrest.serialization.Model): :param parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. Possible values include: "default", "text", "delimitedText", "json", "jsonArray", "jsonLines". Default value: "default". - :type parsing_mode: str or - ~azure.search.documents.indexes.v2020_06_preview.models.BlobIndexerParsingMode + :type parsing_mode: str or ~azure.search.documents.indexes.models.BlobIndexerParsingMode :param excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore when processing from Azure blob storage. For example, you could exclude ".png, .mp4" to skip over those files during indexing. @@ -2413,14 +2375,12 @@ class IndexingParametersConfiguration(msrest.serialization.Model): than "none". This applies to embedded image content in a .PDF or other application, or image files such as .jpg and .png, in Azure blobs. Possible values include: "storageMetadata", "allMetadata", "contentAndMetadata". Default value: "contentAndMetadata". - :type data_to_extract: str or - ~azure.search.documents.indexes.v2020_06_preview.models.BlobIndexerDataToExtract + :type data_to_extract: str or ~azure.search.documents.indexes.models.BlobIndexerDataToExtract :param image_action: Determines how to process embedded images and image files in Azure blob storage. Setting the "imageAction" configuration to any value other than "none" requires that a skillset also be attached to that indexer. Possible values include: "none", "generateNormalizedImages", "generateNormalizedImagePerPage". Default value: "none". - :type image_action: str or - ~azure.search.documents.indexes.v2020_06_preview.models.BlobIndexerImageAction + :type image_action: str or ~azure.search.documents.indexes.models.BlobIndexerImageAction :param allow_skillset_to_read_file_data: If true, will create a path //document//file_data that is an object representing the original file data downloaded from your blob data source. This allows you to pass the original file data to a custom skill for processing within the @@ -2429,11 +2389,11 @@ class IndexingParametersConfiguration(msrest.serialization.Model): :param pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files in Azure blob storage. Possible values include: "none", "detectAngles". Default value: "none". :type pdf_text_rotation_algorithm: str or - ~azure.search.documents.indexes.v2020_06_preview.models.BlobIndexerPDFTextRotationAlgorithm + ~azure.search.documents.indexes.models.BlobIndexerPDFTextRotationAlgorithm :param execution_environment: Specifies the environment in which the indexer should execute. Possible values include: "standard", "private". Default value: "standard". :type execution_environment: str or - ~azure.search.documents.indexes.v2020_06_preview.models.IndexerExecutionEnvironment + ~azure.search.documents.indexes.models.IndexerExecutionEnvironment :param query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL database data sources, specified in the format "hh:mm:ss". :type query_timeout: str @@ -2545,8 +2505,7 @@ class InputFieldMappingEntry(msrest.serialization.Model): :param source_context: The source context used for selecting recursive inputs. :type source_context: str :param inputs: The recursive inputs used when creating a complex type. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] """ _validation = { @@ -2642,20 +2601,22 @@ class KeyPhraseExtractionSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", "pt- - PT", "pt-BR", "ru", "es", "sv". + Possible values include: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", + "pt-PT", "pt-BR", "ru", "es", "sv". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.KeyPhraseExtractionSkillLanguage + ~azure.search.documents.indexes.models.KeyPhraseExtractionSkillLanguage :param max_key_phrase_count: A number indicating how many key phrases to return. If absent, all identified key phrases will be returned. :type max_key_phrase_count: int + :param model_version: The version of the model to use when calling the Text Analytics service. + It will default to the latest available when not specified. We recommend you do not specify + this value unless absolutely necessary. + :type model_version: str """ _validation = { @@ -2673,6 +2634,7 @@ class KeyPhraseExtractionSkill(SearchIndexerSkill): 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, 'max_key_phrase_count': {'key': 'maxKeyPhraseCount', 'type': 'int'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, } def __init__( @@ -2685,12 +2647,14 @@ def __init__( context: Optional[str] = None, default_language_code: Optional[Union[str, "KeyPhraseExtractionSkillLanguage"]] = None, max_key_phrase_count: Optional[int] = None, + model_version: Optional[str] = None, **kwargs ): super(KeyPhraseExtractionSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) self.odata_type = '#Microsoft.Skills.Text.KeyPhraseExtractionSkill' # type: str self.default_language_code = default_language_code self.max_key_phrase_count = max_key_phrase_count + self.model_version = model_version class KeywordMarkerTokenFilter(TokenFilter): @@ -2839,12 +2803,17 @@ class LanguageDetectionSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :param default_country_hint: A country code to use as a hint to the language detection model if + it cannot disambiguate the language. + :type default_country_hint: str + :param model_version: The version of the model to use when calling the Text Analytics service. + It will default to the latest available when not specified. We recommend you do not specify + this value unless absolutely necessary. + :type model_version: str """ _validation = { @@ -2860,6 +2829,8 @@ class LanguageDetectionSkill(SearchIndexerSkill): 'context': {'key': 'context', 'type': 'str'}, 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, + 'default_country_hint': {'key': 'defaultCountryHint', 'type': 'str'}, + 'model_version': {'key': 'modelVersion', 'type': 'str'}, } def __init__( @@ -2870,10 +2841,14 @@ def __init__( name: Optional[str] = None, description: Optional[str] = None, context: Optional[str] = None, + default_country_hint: Optional[str] = None, + model_version: Optional[str] = None, **kwargs ): super(LanguageDetectionSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) self.odata_type = '#Microsoft.Skills.Text.LanguageDetectionSkill' # type: str + self.default_country_hint = default_country_hint + self.model_version = model_version class LengthTokenFilter(TokenFilter): @@ -2976,8 +2951,7 @@ class ListDataSourcesResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar data_sources: Required. The datasources in the Search service. - :vartype data_sources: - list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource] + :vartype data_sources: list[~azure.search.documents.indexes.models.SearchIndexerDataSource] """ _validation = { @@ -3004,7 +2978,7 @@ class ListIndexersResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar indexers: Required. The indexers in the Search service. - :vartype indexers: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer] + :vartype indexers: list[~azure.search.documents.indexes.models.SearchIndexer] """ _validation = { @@ -3031,7 +3005,7 @@ class ListIndexesResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar indexes: Required. The indexes in the Search service. - :vartype indexes: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex] + :vartype indexes: list[~azure.search.documents.indexes.models.SearchIndex] """ _validation = { @@ -3058,8 +3032,7 @@ class ListSkillsetsResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar skillsets: Required. The skillsets defined in the Search service. - :vartype skillsets: - list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset] + :vartype skillsets: list[~azure.search.documents.indexes.models.SearchIndexerSkillset] """ _validation = { @@ -3086,7 +3059,7 @@ class ListSynonymMapsResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar synonym_maps: Required. The synonym maps in the Search service. - :vartype synonym_maps: list[~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap] + :vartype synonym_maps: list[~azure.search.documents.indexes.models.SynonymMap] """ _validation = { @@ -3248,11 +3221,9 @@ class MagnitudeScoringFunction(ScoringFunction): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation :param parameters: Required. Parameter values for the magnitude scoring function. - :type parameters: - ~azure.search.documents.indexes.v2020_06_preview.models.MagnitudeScoringParameters + :type parameters: ~azure.search.documents.indexes.models.MagnitudeScoringParameters """ _validation = { @@ -3384,12 +3355,10 @@ class MergeSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is an empty space. :type insert_pre_tag: str @@ -3461,7 +3430,7 @@ class MicrosoftLanguageStemmingTokenizer(LexicalTokenizer): "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovak", "slovenian", "spanish", "swedish", "tamil", "telugu", "turkish", "ukrainian", "urdu". :type language: str or - ~azure.search.documents.indexes.v2020_06_preview.models.MicrosoftStemmingTokenizerLanguage + ~azure.search.documents.indexes.models.MicrosoftStemmingTokenizerLanguage """ _validation = { @@ -3521,8 +3490,7 @@ class MicrosoftLanguageTokenizer(LexicalTokenizer): "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovenian", "spanish", "swedish", "tamil", "telugu", "thai", "ukrainian", "urdu", "vietnamese". - :type language: str or - ~azure.search.documents.indexes.v2020_06_preview.models.MicrosoftTokenizerLanguage + :type language: str or ~azure.search.documents.indexes.models.MicrosoftTokenizerLanguage """ _validation = { @@ -3665,8 +3633,7 @@ class NGramTokenizer(LexicalTokenizer): :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. :type max_gram: int :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or - ~azure.search.documents.indexes.v2020_06_preview.models.TokenCharacterKind] + :type token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] """ _validation = { @@ -3720,18 +3687,15 @@ class OcrSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "zh-Hans", "zh-Hant", "cs", "da", "nl", "en", "fi", "fr", "de", "el", - "hu", "it", "ja", "ko", "nb", "pl", "pt", "ru", "es", "sv", "tr", "ar", "ro", "sr-Cyrl", "sr- - Latn", "sk". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.OcrSkillLanguage + "hu", "it", "ja", "ko", "nb", "pl", "pt", "ru", "es", "sv", "tr", "ar", "ro", "sr-Cyrl", + "sr-Latn", "sk". + :type default_language_code: str or ~azure.search.documents.indexes.models.OcrSkillLanguage :param should_detect_orientation: A value indicating to turn orientation detection on or not. Default is false. :type should_detect_orientation: bool @@ -3885,7 +3849,7 @@ class PatternAnalyzer(LexicalAnalyzer): :type pattern: str :param flags: Regular expression flags. Possible values include: "CANON_EQ", "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.v2020_06_preview.models.RegexFlags + :type flags: str or ~azure.search.documents.indexes.models.RegexFlags :param stopwords: A list of stopwords. :type stopwords: list[str] """ @@ -4077,7 +4041,7 @@ class PatternTokenizer(LexicalTokenizer): :type pattern: str :param flags: Regular expression flags. Possible values include: "CANON_EQ", "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.v2020_06_preview.models.RegexFlags + :type flags: str or ~azure.search.documents.indexes.models.RegexFlags :param group: The zero-based ordinal of the matching group in the regular expression pattern to extract into tokens. Use -1 if you want to use the entire pattern to split the input into tokens, irrespective of matching groups. Default is -1. @@ -4128,7 +4092,7 @@ class PhoneticTokenFilter(TokenFilter): :param encoder: The phonetic encoder to use. Default is "metaphone". Possible values include: "metaphone", "doubleMetaphone", "soundex", "refinedSoundex", "caverphone1", "caverphone2", "cologne", "nysiis", "koelnerPhonetik", "haasePhonetik", "beiderMorse". - :type encoder: str or ~azure.search.documents.indexes.v2020_06_preview.models.PhoneticEncoder + :type encoder: str or ~azure.search.documents.indexes.models.PhoneticEncoder :param replace_original_tokens: A value indicating whether encoded tokens should replace original tokens. If false, encoded tokens are added as synonyms. Default is true. :type replace_original_tokens: bool @@ -4222,14 +4186,14 @@ class ScoringProfile(msrest.serialization.Model): :type name: str :param text_weights: Parameters that boost scoring based on text matches in certain index fields. - :type text_weights: ~azure.search.documents.indexes.v2020_06_preview.models.TextWeights + :type text_weights: ~azure.search.documents.indexes.models.TextWeights :param functions: The collection of functions that influence the scoring of documents. - :type functions: list[~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunction] + :type functions: list[~azure.search.documents.indexes.models.ScoringFunction] :param function_aggregation: A value indicating how the results of individual scoring functions should be combined. Defaults to "Sum". Ignored if there are no scoring functions. Possible values include: "sum", "average", "minimum", "maximum", "firstMatching". :type function_aggregation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionAggregation + ~azure.search.documents.indexes.models.ScoringFunctionAggregation """ _validation = { @@ -4271,7 +4235,7 @@ class SearchError(msrest.serialization.Model): :ivar message: Required. A human-readable representation of the error. :vartype message: str :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchError] + :vartype details: list[~azure.search.documents.indexes.models.SearchError] """ _validation = { @@ -4307,7 +4271,7 @@ class SearchField(msrest.serialization.Model): :param type: Required. The data type of the field. Possible values include: "Edm.String", "Edm.Int32", "Edm.Int64", "Edm.Double", "Edm.Boolean", "Edm.DateTimeOffset", "Edm.GeographyPoint", "Edm.ComplexType". - :type type: str or ~azure.search.documents.indexes.v2020_06_preview.models.SearchFieldDataType + :type type: str or ~azure.search.documents.indexes.models.SearchFieldDataType :param key: A value indicating whether the field uniquely identifies documents in the index. Exactly one top-level field in each index must be chosen as the key field and it must be of type Edm.String. Key fields can be used to look up documents directly and update or delete @@ -4359,8 +4323,8 @@ class SearchField(msrest.serialization.Model): with searchable fields and it can't be set together with either searchAnalyzer or indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", - "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- - Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", + "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", + "zh-Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", @@ -4368,47 +4332,45 @@ class SearchField(msrest.serialization.Model): "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", - "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- - PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", + "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", + "pt-PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzerName + :type analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName :param search_analyzer: The name of the analyzer used at search time for the field. This option can be used only with searchable fields. It must be set together with indexAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. This analyzer can be updated on an existing field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", - "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", "zh- - Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", - "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", - "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", - "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", "he.microsoft", "hi.microsoft", - "hi.lucene", "hu.microsoft", "hu.lucene", "is.microsoft", "id.microsoft", "id.lucene", - "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", "kn.microsoft", - "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", - "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", "fa.lucene", "pl.microsoft", - "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", "pt-PT.lucene", - "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr- - cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", + "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", + "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", + "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", + "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", + "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", "he.microsoft", + "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", "is.microsoft", "id.microsoft", + "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", + "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", + "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", "fa.lucene", + "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", + "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", + "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type search_analyzer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzerName + :type search_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName :param index_analyzer: The name of the analyzer used at indexing time for the field. This option can be used only with searchable fields. It must be set together with searchAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", - "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh- - Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", + "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", + "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", @@ -4417,20 +4379,18 @@ class SearchField(msrest.serialization.Model): "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", - "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr- - cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", + "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", + "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type index_analyzer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzerName + :type index_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName :param normalizer: The name of the normalizer to use for the field. This option can be used only with fields with filterable, sortable, or facetable enabled. Once the normalizer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "asciifolding", "elision", "lowercase", "standard", "uppercase". - :type normalizer: str or - ~azure.search.documents.indexes.v2020_06_preview.models.LexicalNormalizerName + :type normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName :param synonym_maps: A list of the names of synonym maps to associate with this field. This option can be used only with searchable fields. Currently only one synonym map per field is supported. Assigning a synonym map to a field ensures that query terms targeting that field are @@ -4439,7 +4399,7 @@ class SearchField(msrest.serialization.Model): :type synonym_maps: list[str] :param fields: A list of sub-fields if this is a field of type Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty for simple fields. - :type fields: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchField] + :type fields: list[~azure.search.documents.indexes.models.SearchField] """ _validation = { @@ -4508,30 +4468,27 @@ class SearchIndex(msrest.serialization.Model): :param name: Required. The name of the index. :type name: str :param fields: Required. The fields of the index. - :type fields: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchField] + :type fields: list[~azure.search.documents.indexes.models.SearchField] :param scoring_profiles: The scoring profiles for the index. - :type scoring_profiles: - list[~azure.search.documents.indexes.v2020_06_preview.models.ScoringProfile] + :type scoring_profiles: list[~azure.search.documents.indexes.models.ScoringProfile] :param default_scoring_profile: The name of the scoring profile to use if none is specified in the query. If this property is not set and no scoring profile is specified in the query, then default scoring (tf-idf) will be used. :type default_scoring_profile: str :param cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. - :type cors_options: ~azure.search.documents.indexes.v2020_06_preview.models.CorsOptions + :type cors_options: ~azure.search.documents.indexes.models.CorsOptions :param suggesters: The suggesters for the index. - :type suggesters: list[~azure.search.documents.indexes.v2020_06_preview.models.Suggester] + :type suggesters: list[~azure.search.documents.indexes.models.Suggester] :param analyzers: The analyzers for the index. - :type analyzers: list[~azure.search.documents.indexes.v2020_06_preview.models.LexicalAnalyzer] + :type analyzers: list[~azure.search.documents.indexes.models.LexicalAnalyzer] :param tokenizers: The tokenizers for the index. - :type tokenizers: - list[~azure.search.documents.indexes.v2020_06_preview.models.LexicalTokenizer] + :type tokenizers: list[~azure.search.documents.indexes.models.LexicalTokenizer] :param token_filters: The token filters for the index. - :type token_filters: list[~azure.search.documents.indexes.v2020_06_preview.models.TokenFilter] + :type token_filters: list[~azure.search.documents.indexes.models.TokenFilter] :param char_filters: The character filters for the index. - :type char_filters: list[~azure.search.documents.indexes.v2020_06_preview.models.CharFilter] + :type char_filters: list[~azure.search.documents.indexes.models.CharFilter] :param normalizers: The normalizers for the index. - :type normalizers: - list[~azure.search.documents.indexes.v2020_06_preview.models.LexicalNormalizer] + :type normalizers: list[~azure.search.documents.indexes.models.LexicalNormalizer] :param encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive @@ -4540,13 +4497,12 @@ class SearchIndex(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey :param similarity: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. - :type similarity: ~azure.search.documents.indexes.v2020_06_preview.models.Similarity + :type similarity: ~azure.search.documents.indexes.models.Similarity :param e_tag: The ETag of the index. :type e_tag: str """ @@ -4626,17 +4582,15 @@ class SearchIndexer(msrest.serialization.Model): :param target_index_name: Required. The name of the index to which this indexer writes data. :type target_index_name: str :param schedule: The schedule for this indexer. - :type schedule: ~azure.search.documents.indexes.v2020_06_preview.models.IndexingSchedule + :type schedule: ~azure.search.documents.indexes.models.IndexingSchedule :param parameters: Parameters for indexer execution. - :type parameters: ~azure.search.documents.indexes.v2020_06_preview.models.IndexingParameters + :type parameters: ~azure.search.documents.indexes.models.IndexingParameters :param field_mappings: Defines mappings between fields in the data source and corresponding target fields in the index. - :type field_mappings: - list[~azure.search.documents.indexes.v2020_06_preview.models.FieldMapping] + :type field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] :param output_field_mappings: Output field mappings are applied after enrichment and immediately before indexing. - :type output_field_mappings: - list[~azure.search.documents.indexes.v2020_06_preview.models.FieldMapping] + :type output_field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] :param is_disabled: A value indicating whether the indexer is disabled. Default is false. :type is_disabled: bool :param e_tag: The ETag of the indexer. @@ -4650,8 +4604,7 @@ class SearchIndexer(msrest.serialization.Model): rotate your encryption key; Your indexer definition (and indexer execution status) will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -4752,20 +4705,17 @@ class SearchIndexerDataSource(msrest.serialization.Model): :type description: str :param type: Required. The type of the datasource. Possible values include: "azuresql", "cosmosdb", "azureblob", "azuretable", "mysql", "adlsgen2". - :type type: str or - ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSourceType + :type type: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceType :param credentials: Required. Credentials for the datasource. - :type credentials: - ~azure.search.documents.indexes.v2020_06_preview.models.DataSourceCredentials + :type credentials: ~azure.search.documents.indexes.models.DataSourceCredentials :param container: Required. The data container for the datasource. - :type container: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataContainer + :type container: ~azure.search.documents.indexes.models.SearchIndexerDataContainer :param data_change_detection_policy: The data change detection policy for the datasource. :type data_change_detection_policy: - ~azure.search.documents.indexes.v2020_06_preview.models.DataChangeDetectionPolicy + ~azure.search.documents.indexes.models.DataChangeDetectionPolicy :param data_deletion_detection_policy: The data deletion detection policy for the datasource. :type data_deletion_detection_policy: - ~azure.search.documents.indexes.v2020_06_preview.models.DataDeletionDetectionPolicy + ~azure.search.documents.indexes.models.DataDeletionDetectionPolicy :param e_tag: The ETag of the data source. :type e_tag: str :param encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -4777,8 +4727,7 @@ class SearchIndexerDataSource(msrest.serialization.Model): encryption key; Your datasource definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -4933,11 +4882,11 @@ class SearchIndexerSkillset(msrest.serialization.Model): :param description: The description of the skillset. :type description: str :param skills: Required. A list of skills in the skillset. - :type skills: list[~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkill] + :type skills: list[~azure.search.documents.indexes.models.SearchIndexerSkill] :param cognitive_services_account: Details about cognitive services to be used when running skills. :type cognitive_services_account: - ~azure.search.documents.indexes.v2020_06_preview.models.CognitiveServicesAccount + ~azure.search.documents.indexes.models.CognitiveServicesAccount :param e_tag: The ETag of the skillset. :type e_tag: str :param encryption_key: A description of an encryption key that you create in Azure Key Vault. @@ -4949,8 +4898,7 @@ class SearchIndexerSkillset(msrest.serialization.Model): encryption key; Your skillset definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -4996,16 +4944,14 @@ class SearchIndexerStatus(msrest.serialization.Model): :ivar status: Required. Overall indexer status. Possible values include: "unknown", "error", "running". - :vartype status: str or ~azure.search.documents.indexes.v2020_06_preview.models.IndexerStatus + :vartype status: str or ~azure.search.documents.indexes.models.IndexerStatus :ivar last_result: The result of the most recent or an in-progress indexer execution. - :vartype last_result: - ~azure.search.documents.indexes.v2020_06_preview.models.IndexerExecutionResult + :vartype last_result: ~azure.search.documents.indexes.models.IndexerExecutionResult :ivar execution_history: Required. History of the recent indexer executions, sorted in reverse chronological order. - :vartype execution_history: - list[~azure.search.documents.indexes.v2020_06_preview.models.IndexerExecutionResult] + :vartype execution_history: list[~azure.search.documents.indexes.models.IndexerExecutionResult] :ivar limits: Required. The execution limits for the indexer. - :vartype limits: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerLimits + :vartype limits: ~azure.search.documents.indexes.models.SearchIndexerLimits """ _validation = { @@ -5096,13 +5042,13 @@ class SearchResourceEncryptionKey(msrest.serialization.Model): your data at rest. :type key_version: str :param vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, that - contains the key to be used to encrypt your data at rest. An example URI might be https://my- - keyvault-name.vault.azure.net. + contains the key to be used to encrypt your data at rest. An example URI might be + https://my-keyvault-name.vault.azure.net. :type vault_uri: str :param access_credentials: Optional Azure Active Directory credentials used for accessing your Azure Key Vault. Not required if using managed identity instead. :type access_credentials: - ~azure.search.documents.indexes.v2020_06_preview.models.AzureActiveDirectoryApplicationCredentials + ~azure.search.documents.indexes.models.AzureActiveDirectoryApplicationCredentials """ _validation = { @@ -5154,17 +5100,15 @@ class SentimentSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "nl", "en", "fi", "fr", "de", "el", "it", "no", "pl", "pt-PT", "ru", "es", "sv", "tr". :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.SentimentSkillLanguage + ~azure.search.documents.indexes.models.SentimentSkillLanguage """ _validation = { @@ -5205,22 +5149,19 @@ class ServiceCounters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param document_counter: Required. Total number of documents across all indexes in the service. - :type document_counter: ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type document_counter: ~azure.search.documents.indexes.models.ResourceCounter :param index_counter: Required. Total number of indexes. - :type index_counter: ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type index_counter: ~azure.search.documents.indexes.models.ResourceCounter :param indexer_counter: Required. Total number of indexers. - :type indexer_counter: ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type indexer_counter: ~azure.search.documents.indexes.models.ResourceCounter :param data_source_counter: Required. Total number of data sources. - :type data_source_counter: - ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type data_source_counter: ~azure.search.documents.indexes.models.ResourceCounter :param storage_size_counter: Required. Total size of used storage in bytes. - :type storage_size_counter: - ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type storage_size_counter: ~azure.search.documents.indexes.models.ResourceCounter :param synonym_map_counter: Required. Total number of synonym maps. - :type synonym_map_counter: - ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type synonym_map_counter: ~azure.search.documents.indexes.models.ResourceCounter :param skillset_counter: Required. Total number of skillsets. - :type skillset_counter: ~azure.search.documents.indexes.v2020_06_preview.models.ResourceCounter + :type skillset_counter: ~azure.search.documents.indexes.models.ResourceCounter """ _validation = { @@ -5310,9 +5251,9 @@ class ServiceStatistics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :param counters: Required. Service level resource counters. - :type counters: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceCounters + :type counters: ~azure.search.documents.indexes.models.ServiceCounters :param limits: Required. Service level general limits. - :type limits: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceLimits + :type limits: ~azure.search.documents.indexes.models.ServiceLimits """ _validation = { @@ -5357,12 +5298,10 @@ class ShaperSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -5482,8 +5421,7 @@ class SnowballTokenFilter(TokenFilter): "catalan", "danish", "dutch", "english", "finnish", "french", "german", "german2", "hungarian", "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", "russian", "spanish", "swedish", "turkish". - :type language: str or - ~azure.search.documents.indexes.v2020_06_preview.models.SnowballTokenFilterLanguage + :type language: str or ~azure.search.documents.indexes.models.SnowballTokenFilterLanguage """ _validation = { @@ -5567,20 +5505,16 @@ class SplitSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.SplitSkillLanguage + :type default_language_code: str or ~azure.search.documents.indexes.models.SplitSkillLanguage :param text_split_mode: A value indicating which split mode to perform. Possible values include: "pages", "sentences". - :type text_split_mode: str or - ~azure.search.documents.indexes.v2020_06_preview.models.TextSplitMode + :type text_split_mode: str or ~azure.search.documents.indexes.models.TextSplitMode :param maximum_page_length: The desired maximum page length. Default is 10000. :type maximum_page_length: int """ @@ -5711,8 +5645,7 @@ class StemmerTokenFilter(TokenFilter): "latvian", "norwegian", "lightNorwegian", "minimalNorwegian", "lightNynorsk", "minimalNynorsk", "portuguese", "lightPortuguese", "minimalPortuguese", "portugueseRslp", "romanian", "russian", "lightRussian", "spanish", "lightSpanish", "swedish", "lightSwedish", "turkish". - :type language: str or - ~azure.search.documents.indexes.v2020_06_preview.models.StemmerTokenFilterLanguage + :type language: str or ~azure.search.documents.indexes.models.StemmerTokenFilterLanguage """ _validation = { @@ -5799,8 +5732,7 @@ class StopwordsTokenFilter(TokenFilter): "finnish", "french", "galician", "german", "greek", "hindi", "hungarian", "indonesian", "irish", "italian", "latvian", "norwegian", "persian", "portuguese", "romanian", "russian", "sorani", "spanish", "swedish", "thai", "turkish". - :type stopwords_list: str or - ~azure.search.documents.indexes.v2020_06_preview.models.StopwordsList + :type stopwords_list: str or ~azure.search.documents.indexes.models.StopwordsList :param ignore_case: A value indicating whether to ignore case. If true, all words are converted to lower case first. Default is false. :type ignore_case: bool @@ -5907,8 +5839,7 @@ class SynonymMap(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06_preview.models.SearchResourceEncryptionKey + :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey :param e_tag: The ETag of the synonym map. :type e_tag: str """ @@ -6022,10 +5953,9 @@ class TagScoringFunction(ScoringFunction): :param interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06_preview.models.ScoringFunctionInterpolation + :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation :param parameters: Required. Parameter values for the tag scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06_preview.models.TagScoringParameters + :type parameters: ~azure.search.documents.indexes.models.TagScoringParameters """ _validation = { @@ -6105,12 +6035,10 @@ class TextTranslationSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param default_to_language_code: Required. The language code to translate documents into for documents that don't specify the to language explicitly. Possible values include: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", @@ -6119,7 +6047,7 @@ class TextTranslationSkill(SearchIndexerSkill): "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua". :type default_to_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.TextTranslationSkillLanguage + ~azure.search.documents.indexes.models.TextTranslationSkillLanguage :param default_from_language_code: The language code to translate documents from for documents that don't specify the from language explicitly. Possible values include: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", @@ -6128,7 +6056,7 @@ class TextTranslationSkill(SearchIndexerSkill): "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua". :type default_from_language_code: str or - ~azure.search.documents.indexes.v2020_06_preview.models.TextTranslationSkillLanguage + ~azure.search.documents.indexes.models.TextTranslationSkillLanguage :param suggested_from: The language code to translate documents from when neither the fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is unsuccessful. Default is en. Possible values include: "af", @@ -6138,7 +6066,7 @@ class TextTranslationSkill(SearchIndexerSkill): "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua". :type suggested_from: str or - ~azure.search.documents.indexes.v2020_06_preview.models.TextTranslationSkillLanguage + ~azure.search.documents.indexes.models.TextTranslationSkillLanguage """ _validation = { @@ -6349,12 +6277,10 @@ class WebApiSkill(SearchIndexerSkill): :type context: str :param inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.InputFieldMappingEntry] + :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] :param outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: - list[~azure.search.documents.indexes.v2020_06_preview.models.OutputFieldMappingEntry] + :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] :param uri: Required. The url for the Web API. :type uri: str :param http_headers: The headers required to make the http request. diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/_search_client_enums.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_search_client_enums.py similarity index 87% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/_search_client_enums.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_search_client_enums.py index 0077f0145397..5a0623d6b893 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/models/_search_client_enums.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_search_client_enums.py @@ -97,8 +97,7 @@ class CharFilterName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """ #: A character filter that attempts to strip out HTML constructs. See - #: https://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.html. + #: https://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.html. HTML_STRIP = "html_strip" class CjkBigramTokenFilterScripts(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): @@ -497,24 +496,20 @@ class LexicalAnalyzerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#Analyzers. STANDARD_ASCII_FOLDING_LUCENE = "standardasciifolding.lucene" #: Treats the entire content of a field as a single token. This is useful for data like zip codes, - #: ids, and some product names. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/KeywordAnalyzer.html. + #: ids, and some product names. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/KeywordAnalyzer.html. KEYWORD = "keyword" #: Flexibly separates text into terms via a regular expression pattern. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/PatternAnalyzer.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/PatternAnalyzer.html. PATTERN = "pattern" #: Divides text at non-letters and converts them to lower case. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/SimpleAnalyzer.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/SimpleAnalyzer.html. SIMPLE = "simple" #: Divides text at non-letters; Applies the lowercase and stopword token filters. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/StopAnalyzer.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopAnalyzer.html. STOP = "stop" #: An analyzer that uses the whitespace tokenizer. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/WhitespaceAnalyzer.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceAnalyzer.html. WHITESPACE = "whitespace" class LexicalNormalizerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): @@ -523,22 +518,20 @@ class LexicalNormalizerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) #: Converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 #: ASCII characters (the "Basic Latin" Unicode block) into their ASCII equivalents, if such - #: equivalents exist. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html. + #: equivalents exist. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html. ASCII_FOLDING = "asciifolding" #: Removes elisions. For example, "l'avion" (the plane) will be converted to "avion" (plane). See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/util/ElisionFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/util/ElisionFilter.html. ELISION = "elision" - #: Normalizes token text to lowercase. See https://lucene.apache.org/core/6_6_1/analyzers- - #: common/org/apache/lucene/analysis/core/LowerCaseFilter.html. + #: Normalizes token text to lowercase. See + #: https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.html. LOWERCASE = "lowercase" #: Standard normalizer, which consists of lowercase and asciifolding. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html. STANDARD = "standard" - #: Normalizes token text to uppercase. See https://lucene.apache.org/core/6_6_1/analyzers- - #: common/org/apache/lucene/analysis/core/UpperCaseFilter.html. + #: Normalizes token text to uppercase. See + #: https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html. UPPERCASE = "uppercase" class LexicalTokenizerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): @@ -546,47 +539,42 @@ class LexicalTokenizerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """ #: Grammar-based tokenizer that is suitable for processing most European-language documents. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/standard/ClassicTokenizer.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/ClassicTokenizer.html. CLASSIC = "classic" #: Tokenizes the input from an edge into n-grams of the given size(s). See - #: https://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ngram/EdgeNGramTokenizer.html. + #: https://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramTokenizer.html. EDGE_N_GRAM = "edgeNGram" - #: Emits the entire input as a single token. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/KeywordTokenizer.html. + #: Emits the entire input as a single token. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/KeywordTokenizer.html. KEYWORD = "keyword_v2" - #: Divides text at non-letters. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/LetterTokenizer.html. + #: Divides text at non-letters. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LetterTokenizer.html. LETTER = "letter" #: Divides text at non-letters and converts them to lower case. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/LowerCaseTokenizer.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/LowerCaseTokenizer.html. LOWERCASE = "lowercase" #: Divides text using language-specific rules. MICROSOFT_LANGUAGE_TOKENIZER = "microsoft_language_tokenizer" #: Divides text using language-specific rules and reduces words to their base forms. MICROSOFT_LANGUAGE_STEMMING_TOKENIZER = "microsoft_language_stemming_tokenizer" #: Tokenizes the input into n-grams of the given size(s). See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ngram/NGramTokenizer.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenizer.html. N_GRAM = "nGram" - #: Tokenizer for path-like hierarchies. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/path/PathHierarchyTokenizer.html. + #: Tokenizer for path-like hierarchies. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/path/PathHierarchyTokenizer.html. PATH_HIERARCHY = "path_hierarchy_v2" #: Tokenizer that uses regex pattern matching to construct distinct tokens. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/pattern/PatternTokenizer.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/pattern/PatternTokenizer.html. PATTERN = "pattern" #: Standard Lucene analyzer; Composed of the standard tokenizer, lowercase filter and stop filter. - #: See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/standard/StandardTokenizer.html. + #: See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/StandardTokenizer.html. STANDARD = "standard_v2" - #: Tokenizes urls and emails as one token. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.html. + #: Tokenizes urls and emails as one token. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.html. UAX_URL_EMAIL = "uax_url_email" - #: Divides text at whitespace. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/WhitespaceTokenizer.html. + #: Divides text at whitespace. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceTokenizer.html. WHITESPACE = "whitespace" class MicrosoftStemmingTokenizerLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): @@ -1403,129 +1391,109 @@ class TokenFilterName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """ #: A token filter that applies the Arabic normalizer to normalize the orthography. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.html. ARABIC_NORMALIZATION = "arabic_normalization" #: Strips all characters after an apostrophe (including the apostrophe itself). See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/tr/ApostropheFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/tr/ApostropheFilter.html. APOSTROPHE = "apostrophe" #: Converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 #: ASCII characters (the "Basic Latin" Unicode block) into their ASCII equivalents, if such - #: equivalents exist. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html. + #: equivalents exist. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html. ASCII_FOLDING = "asciifolding" #: Forms bigrams of CJK terms that are generated from the standard tokenizer. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/cjk/CJKBigramFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKBigramFilter.html. CJK_BIGRAM = "cjk_bigram" #: Normalizes CJK width differences. Folds fullwidth ASCII variants into the equivalent basic #: Latin, and half-width Katakana variants into the equivalent Kana. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/cjk/CJKWidthFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/cjk/CJKWidthFilter.html. CJK_WIDTH = "cjk_width" #: Removes English possessives, and dots from acronyms. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/standard/ClassicFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/standard/ClassicFilter.html. CLASSIC = "classic" #: Construct bigrams for frequently occurring terms while indexing. Single terms are still indexed - #: too, with bigrams overlaid. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/commongrams/CommonGramsFilter.html. + #: too, with bigrams overlaid. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/commongrams/CommonGramsFilter.html. COMMON_GRAM = "common_grams" #: Generates n-grams of the given size(s) starting from the front or the back of an input token. - #: See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.html. + #: See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.html. EDGE_N_GRAM = "edgeNGram_v2" #: Removes elisions. For example, "l'avion" (the plane) will be converted to "avion" (plane). See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/util/ElisionFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/util/ElisionFilter.html. ELISION = "elision" #: Normalizes German characters according to the heuristics of the German2 snowball algorithm. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/de/GermanNormalizationFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/de/GermanNormalizationFilter.html. GERMAN_NORMALIZATION = "german_normalization" #: Normalizes text in Hindi to remove some differences in spelling variations. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/hi/HindiNormalizationFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/hi/HindiNormalizationFilter.html. HINDI_NORMALIZATION = "hindi_normalization" #: Normalizes the Unicode representation of text in Indian languages. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/in/IndicNormalizationFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/in/IndicNormalizationFilter.html. INDIC_NORMALIZATION = "indic_normalization" #: Emits each incoming token twice, once as keyword and once as non-keyword. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/KeywordRepeatFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/KeywordRepeatFilter.html. KEYWORD_REPEAT = "keyword_repeat" #: A high-performance kstem filter for English. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/en/KStemFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/en/KStemFilter.html. K_STEM = "kstem" #: Removes words that are too long or too short. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/LengthFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/LengthFilter.html. LENGTH = "length" - #: Limits the number of tokens while indexing. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/LimitTokenCountFilter.html. + #: Limits the number of tokens while indexing. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/LimitTokenCountFilter.html. LIMIT = "limit" - #: Normalizes token text to lower case. See https://lucene.apache.org/core/6_6_1/analyzers- - #: common/org/apache/lucene/analysis/core/LowerCaseFilter.html. + #: Normalizes token text to lower case. See + #: https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.html. LOWERCASE = "lowercase" - #: Generates n-grams of the given size(s). See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ngram/NGramTokenFilter.html. + #: Generates n-grams of the given size(s). See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ngram/NGramTokenFilter.html. N_GRAM = "nGram_v2" - #: Applies normalization for Persian. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/fa/PersianNormalizationFilter.html. + #: Applies normalization for Persian. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/fa/PersianNormalizationFilter.html. PERSIAN_NORMALIZATION = "persian_normalization" - #: Create tokens for phonetic matches. See https://lucene.apache.org/core/4_10_3/analyzers- - #: phonetic/org/apache/lucene/analysis/phonetic/package-tree.html. + #: Create tokens for phonetic matches. See + #: https://lucene.apache.org/core/4_10_3/analyzers-phonetic/org/apache/lucene/analysis/phonetic/package-tree.html. PHONETIC = "phonetic" #: Uses the Porter stemming algorithm to transform the token stream. See #: http://tartarus.org/~martin/PorterStemmer. PORTER_STEM = "porter_stem" - #: Reverses the token string. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html. + #: Reverses the token string. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html. REVERSE = "reverse" #: Normalizes use of the interchangeable Scandinavian characters. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/ScandinavianNormalizationFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ScandinavianNormalizationFilter.html. SCANDINAVIAN_NORMALIZATION = "scandinavian_normalization" #: Folds Scandinavian characters åÅäæÄÆ->a and öÖøØ->o. It also discriminates against use of #: double vowels aa, ae, ao, oe and oo, leaving just the first one. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/ScandinavianFoldingFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ScandinavianFoldingFilter.html. SCANDINAVIAN_FOLDING_NORMALIZATION = "scandinavian_folding" #: Creates combinations of tokens as a single token. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/shingle/ShingleFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilter.html. SHINGLE = "shingle" #: A filter that stems words using a Snowball-generated stemmer. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/snowball/SnowballFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/snowball/SnowballFilter.html. SNOWBALL = "snowball" #: Normalizes the Unicode representation of Sorani text. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ckb/SoraniNormalizationFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/ckb/SoraniNormalizationFilter.html. SORANI_NORMALIZATION = "sorani_normalization" #: Language specific stemming filter. See - #: https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure- - #: Search#TokenFilters. + #: https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#TokenFilters. STEMMER = "stemmer" - #: Removes stop words from a token stream. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/StopFilter.html. + #: Removes stop words from a token stream. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/StopFilter.html. STOPWORDS = "stopwords" #: Trims leading and trailing whitespace from tokens. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/TrimFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/TrimFilter.html. TRIM = "trim" - #: Truncates the terms to a specific length. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.html. + #: Truncates the terms to a specific length. See + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.html. TRUNCATE = "truncate" #: Filters out tokens with same text as the previous token. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/RemoveDuplicatesTokenFilter.html. + #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/RemoveDuplicatesTokenFilter.html. UNIQUE = "unique" - #: Normalizes token text to upper case. See https://lucene.apache.org/core/6_6_1/analyzers- - #: common/org/apache/lucene/analysis/core/UpperCaseFilter.html. + #: Normalizes token text to upper case. See + #: https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html. UPPERCASE = "uppercase" #: Splits words into subwords and performs optional transformations on subword groups. WORD_DELIMITER = "word_delimiter" diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/__init__.py similarity index 100% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/__init__.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/__init__.py diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_data_sources_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_data_sources_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py index cb87e0f5a0fe..d6849b78362b 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_data_sources_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py @@ -28,7 +28,7 @@ class DataSourcesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -58,7 +58,7 @@ def create_or_update( :param data_source_name: The name of the datasource to create or update. :type data_source_name: str :param data_source: The definition of the datasource to create or update. - :type data_source: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :type data_source: ~azure.search.documents.indexes.models.SearchIndexerDataSource :param if_match: Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value. :type if_match: str @@ -66,10 +66,10 @@ def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] @@ -154,7 +154,7 @@ def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -220,10 +220,10 @@ def get( :param data_source_name: The name of the datasource to retrieve. :type data_source_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] @@ -287,10 +287,10 @@ def list( properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ListDataSourcesResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ListDataSourcesResult + :rtype: ~azure.search.documents.indexes.models.ListDataSourcesResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListDataSourcesResult"] @@ -351,12 +351,12 @@ def create( """Creates a new datasource. :param data_source: The definition of the datasource to create. - :type data_source: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :type data_source: ~azure.search.documents.indexes.models.SearchIndexerDataSource :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerDataSource + :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_indexers_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_indexers_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py index 4ff2d5de875f..df4f6cfc1cbb 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_indexers_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py @@ -28,7 +28,7 @@ class IndexersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ def reset( :param indexer_name: The name of the indexer to reset. :type indexer_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -117,7 +117,7 @@ def run( :param indexer_name: The name of the indexer to run. :type indexer_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -182,7 +182,7 @@ def create_or_update( :param indexer_name: The name of the indexer to create or update. :type indexer_name: str :param indexer: The definition of the indexer to create or update. - :type indexer: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :param if_match: Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value. :type if_match: str @@ -190,10 +190,10 @@ def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :rtype: ~azure.search.documents.indexes.models.SearchIndexer :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] @@ -278,7 +278,7 @@ def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -344,10 +344,10 @@ def get( :param indexer_name: The name of the indexer to retrieve. :type indexer_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :rtype: ~azure.search.documents.indexes.models.SearchIndexer :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] @@ -411,10 +411,10 @@ def list( properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ListIndexersResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ListIndexersResult + :rtype: ~azure.search.documents.indexes.models.ListIndexersResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexersResult"] @@ -475,12 +475,12 @@ def create( """Creates a new indexer. :param indexer: The definition of the indexer to create. - :type indexer: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :type indexer: ~azure.search.documents.indexes.models.SearchIndexer :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexer + :rtype: ~azure.search.documents.indexes.models.SearchIndexer :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] @@ -546,10 +546,10 @@ def get_status( :param indexer_name: The name of the indexer for which to retrieve status. :type indexer_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerStatus, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerStatus + :rtype: ~azure.search.documents.indexes.models.SearchIndexerStatus :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerStatus"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_indexes_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_indexes_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py index 60b9930da001..93fadc4d54dc 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_indexes_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py @@ -29,7 +29,7 @@ class IndexesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,12 +54,12 @@ def create( """Creates a new search index. :param index: The definition of the index to create. - :type index: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :type index: ~azure.search.documents.indexes.models.SearchIndex :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] @@ -127,10 +127,10 @@ def list( default is all properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListIndexesResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.v2020_06_preview.models.ListIndexesResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.models.ListIndexesResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexesResult"] @@ -217,7 +217,7 @@ def create_or_update( :param index_name: The definition of the index to create or update. :type index_name: str :param index: The definition of the index to create or update. - :type index: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :type index: ~azure.search.documents.indexes.models.SearchIndex :param allow_index_downtime: Allows new analyzers, tokenizers, token filters, or char filters to be added to an index by taking the index offline for at least a few seconds. This temporarily causes indexing and query requests to fail. Performance and write availability of @@ -231,10 +231,10 @@ def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] @@ -323,7 +323,7 @@ def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -389,10 +389,10 @@ def get( :param index_name: The name of the index to retrieve. :type index_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndex + :rtype: ~azure.search.documents.indexes.models.SearchIndex :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] @@ -454,10 +454,10 @@ def get_statistics( :param index_name: The name of the index for which to retrieve statistics. :type index_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: GetIndexStatisticsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.GetIndexStatisticsResult + :rtype: ~azure.search.documents.indexes.models.GetIndexStatisticsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GetIndexStatisticsResult"] @@ -520,12 +520,12 @@ def analyze( :param index_name: The name of the index for which to test an analyzer. :type index_name: str :param request: The text and analyzer or analysis components to test. - :type request: ~azure.search.documents.indexes.v2020_06_preview.models.AnalyzeRequest + :type request: ~azure.search.documents.indexes.models.AnalyzeRequest :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: AnalyzeResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.AnalyzeResult + :rtype: ~azure.search.documents.indexes.models.AnalyzeResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeResult"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_search_client_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py similarity index 95% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_search_client_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py index a31fe1e567e1..e21606a555bb 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_search_client_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py @@ -32,10 +32,10 @@ def get_service_statistics( """Gets service level statistics for a search service. :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ServiceStatistics, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceStatistics + :rtype: ~azure.search.documents.indexes.models.ServiceStatistics :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceStatistics"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_skillsets_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_skillsets_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py index 4acd9c9ad8ad..3282482cd608 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_skillsets_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py @@ -28,7 +28,7 @@ class SkillsetsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +59,7 @@ def create_or_update( :type skillset_name: str :param skillset: The skillset containing one or more skills to create or update in a search service. - :type skillset: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset :param if_match: Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value. :type if_match: str @@ -67,10 +67,10 @@ def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] @@ -155,7 +155,7 @@ def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -221,10 +221,10 @@ def get( :param skillset_name: The name of the skillset to retrieve. :type skillset_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] @@ -288,10 +288,10 @@ def list( properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ListSkillsetsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ListSkillsetsResult + :rtype: ~azure.search.documents.indexes.models.ListSkillsetsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListSkillsetsResult"] @@ -352,12 +352,12 @@ def create( """Creates a new skillset in a search service. :param skillset: The skillset containing one or more skills to create in a search service. - :type skillset: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :type skillset: ~azure.search.documents.indexes.models.SearchIndexerSkillset :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SearchIndexerSkillset + :rtype: ~azure.search.documents.indexes.models.SearchIndexerSkillset :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_synonym_maps_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py similarity index 94% rename from sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_synonym_maps_operations.py rename to sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py index 0dd21ac409a5..0ab69ae9af4b 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_synonym_maps_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py @@ -28,7 +28,7 @@ class SynonymMapsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06_preview.models + :type models: ~azure.search.documents.indexes.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -58,7 +58,7 @@ def create_or_update( :param synonym_map_name: The name of the synonym map to create or update. :type synonym_map_name: str :param synonym_map: The definition of the synonym map to create or update. - :type synonym_map: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap :param if_match: Defines the If-Match condition. The operation will be performed only if the ETag on the server matches this value. :type if_match: str @@ -66,10 +66,10 @@ def create_or_update( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :rtype: ~azure.search.documents.indexes.models.SynonymMap :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] @@ -154,7 +154,7 @@ def delete( if the ETag on the server does not match this value. :type if_none_match: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -220,10 +220,10 @@ def get( :param synonym_map_name: The name of the synonym map to retrieve. :type synonym_map_name: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :rtype: ~azure.search.documents.indexes.models.SynonymMap :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] @@ -287,10 +287,10 @@ def list( properties. :type select: str :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: ListSynonymMapsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ListSynonymMapsResult + :rtype: ~azure.search.documents.indexes.models.ListSynonymMapsResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListSynonymMapsResult"] @@ -351,12 +351,12 @@ def create( """Creates a new synonym map. :param synonym_map: The definition of the synonym map to create. - :type synonym_map: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :type synonym_map: ~azure.search.documents.indexes.models.SynonymMap :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions + :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06_preview.models.SynonymMap + :rtype: ~azure.search.documents.indexes.models.SynonymMap :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/__init__.py deleted file mode 100644 index d58f5fc3b7f8..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._search_client import SearchClient -__all__ = ['SearchClient'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_configuration.py deleted file mode 100644 index 1719ffce1702..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_configuration.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -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 - -VERSION = "unknown" - -class SearchClientConfiguration(Configuration): - """Configuration for SearchClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - """ - - def __init__( - self, - endpoint, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - super(SearchClientConfiguration, self).__init__(**kwargs) - - self.endpoint = endpoint - self.api_version = "2020-06-30" - kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - 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') diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_metadata.json b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_metadata.json deleted file mode 100644 index 776702d9697f..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_metadata.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "chosen_version": "2020-06-30", - "total_api_version_list": ["2020-06-30"], - "client": { - "name": "SearchClient", - "filename": "_search_client", - "description": "Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service.", - "base_url": null, - "custom_base_url": "\u0027{endpoint}\u0027", - "azure_arm": false, - "has_lro_operations": false, - "client_side_validation": false, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"SearchClientConfiguration\"], \"._operations_mixin\": [\"SearchClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"SearchClientConfiguration\"], \"._operations_mixin\": [\"SearchClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "global_parameters": { - "sync": { - "endpoint": { - "signature": "endpoint, # type: str", - "description": "The endpoint URL of the search service.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "endpoint": { - "signature": "endpoint: str,", - "description": "The endpoint URL of the search service.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "endpoint", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": false, - "credential_scopes": null, - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}" - }, - "operation_groups": { - "data_sources": "DataSourcesOperations", - "indexers": "IndexersOperations", - "skillsets": "SkillsetsOperations", - "synonym_maps": "SynonymMapsOperations", - "indexes": "IndexesOperations" - }, - "operation_mixins": { - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", - "operations": { - "get_service_statistics" : { - "sync": { - "signature": "def get_service_statistics(\n self,\n request_options=None, # type: Optional[\"_models.RequestOptions\"]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets service level statistics for a search service.\n\n:param request_options: Parameter group.\n:type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ServiceStatistics, or the result of cls(response)\n:rtype: ~azure.search.documents.indexes.v2020_06.models.ServiceStatistics\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def get_service_statistics(\n self,\n request_options: Optional[\"_models.RequestOptions\"] = None,\n **kwargs\n) -\u003e \"_models.ServiceStatistics\":\n", - "doc": "\"\"\"Gets service level statistics for a search service.\n\n:param request_options: Parameter group.\n:type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ServiceStatistics, or the result of cls(response)\n:rtype: ~azure.search.documents.indexes.v2020_06.models.ServiceStatistics\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "request_options" - } - } - } -} \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_search_client.py deleted file mode 100644 index b756b451d078..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/_search_client.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core import PipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import SearchClientConfiguration -from .operations import DataSourcesOperations -from .operations import IndexersOperations -from .operations import SkillsetsOperations -from .operations import SynonymMapsOperations -from .operations import IndexesOperations -from .operations import SearchClientOperationsMixin -from . import models - - -class SearchClient(SearchClientOperationsMixin): - """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. - - :ivar data_sources: DataSourcesOperations operations - :vartype data_sources: azure.search.documents.indexes.v2020_06.operations.DataSourcesOperations - :ivar indexers: IndexersOperations operations - :vartype indexers: azure.search.documents.indexes.v2020_06.operations.IndexersOperations - :ivar skillsets: SkillsetsOperations operations - :vartype skillsets: azure.search.documents.indexes.v2020_06.operations.SkillsetsOperations - :ivar synonym_maps: SynonymMapsOperations operations - :vartype synonym_maps: azure.search.documents.indexes.v2020_06.operations.SynonymMapsOperations - :ivar indexes: IndexesOperations operations - :vartype indexes: azure.search.documents.indexes.v2020_06.operations.IndexesOperations - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - """ - - def __init__( - self, - endpoint, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - base_url = '{endpoint}' - self._config = SearchClientConfiguration(endpoint, **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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.data_sources = DataSourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexers = IndexersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.skillsets = SkillsetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.synonym_maps = SynonymMapsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexes = IndexesOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse - """Runs the network request through the client's chained policies. - - :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.pipeline.transport.HttpResponse - """ - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - 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 - self._client.close() - - def __enter__(self): - # type: () -> SearchClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/__init__.py deleted file mode 100644 index ec41d54fc046..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._search_client import SearchClient -__all__ = ['SearchClient'] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/_configuration.py deleted file mode 100644 index 8b5a47f57f16..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/_configuration.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies - -VERSION = "unknown" - -class SearchClientConfiguration(Configuration): - """Configuration for SearchClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - """ - - def __init__( - self, - endpoint: str, - **kwargs: Any - ) -> None: - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - super(SearchClientConfiguration, self).__init__(**kwargs) - - self.endpoint = endpoint - self.api_version = "2020-06-30" - kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> 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.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/_search_client.py deleted file mode 100644 index 8a64b352066d..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/_search_client.py +++ /dev/null @@ -1,92 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any - -from azure.core import AsyncPipelineClient -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from msrest import Deserializer, Serializer - -from ._configuration import SearchClientConfiguration -from .operations import DataSourcesOperations -from .operations import IndexersOperations -from .operations import SkillsetsOperations -from .operations import SynonymMapsOperations -from .operations import IndexesOperations -from .operations import SearchClientOperationsMixin -from .. import models - - -class SearchClient(SearchClientOperationsMixin): - """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. - - :ivar data_sources: DataSourcesOperations operations - :vartype data_sources: azure.search.documents.indexes.v2020_06.aio.operations.DataSourcesOperations - :ivar indexers: IndexersOperations operations - :vartype indexers: azure.search.documents.indexes.v2020_06.aio.operations.IndexersOperations - :ivar skillsets: SkillsetsOperations operations - :vartype skillsets: azure.search.documents.indexes.v2020_06.aio.operations.SkillsetsOperations - :ivar synonym_maps: SynonymMapsOperations operations - :vartype synonym_maps: azure.search.documents.indexes.v2020_06.aio.operations.SynonymMapsOperations - :ivar indexes: IndexesOperations operations - :vartype indexes: azure.search.documents.indexes.v2020_06.aio.operations.IndexesOperations - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - """ - - def __init__( - self, - endpoint: str, - **kwargs: Any - ) -> None: - base_url = '{endpoint}' - self._config = SearchClientConfiguration(endpoint, **kwargs) - self._client = AsyncPipelineClient(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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.data_sources = DataSourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexers = IndexersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.skillsets = SkillsetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.synonym_maps = SynonymMapsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexes = IndexesOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: - """Runs the network request through the client's chained policies. - - :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.pipeline.transport.AsyncHttpResponse - """ - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "SearchClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_data_sources_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_data_sources_operations.py deleted file mode 100644 index 4a51226515b0..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_data_sources_operations.py +++ /dev/null @@ -1,402 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataSourcesOperations: - """DataSourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def create_or_update( - self, - data_source_name: str, - data_source: "_models.SearchIndexerDataSource", - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexerDataSource": - """Creates a new datasource or updates a datasource if it already exists. - - :param data_source_name: The name of the datasource to create or update. - :type data_source_name: str - :param data_source: The definition of the datasource to create or update. - :type data_source: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(data_source, 'SearchIndexerDataSource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SearchIndexerDataSource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SearchIndexerDataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore - - async def delete( - self, - data_source_name: str, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> None: - """Deletes a datasource. - - :param data_source_name: The name of the datasource to delete. - :type data_source_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore - - async def get( - self, - data_source_name: str, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexerDataSource": - """Retrieves a datasource definition. - - :param data_source_name: The name of the datasource to retrieve. - :type data_source_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerDataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore - - async def list( - self, - select: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.ListDataSourcesResult": - """Lists all datasources available for a search service. - - :param select: Selects which top-level properties of the data sources to retrieve. Specified as - a comma-separated list of JSON property names, or '*' for all properties. The default is all - properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListDataSourcesResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ListDataSourcesResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListDataSourcesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ListDataSourcesResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/datasources'} # type: ignore - - async def create( - self, - data_source: "_models.SearchIndexerDataSource", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexerDataSource": - """Creates a new datasource. - - :param data_source: The definition of the datasource to create. - :type data_source: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(data_source, 'SearchIndexerDataSource') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerDataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/datasources'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_documents_operations.py deleted file mode 100644 index 0152a36cdd8e..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_documents_operations.py +++ /dev/null @@ -1,814 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DocumentsOperations: - """DocumentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def count( - self, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> int: - """Queries the number of documents in the index. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: long, or the result of cls(response) - :rtype: long - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[int] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.count.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('long', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - count.metadata = {'url': '/docs/$count'} # type: ignore - - async def search_get( - self, - search_text: Optional[str] = None, - search_options: Optional["_models.SearchOptions"] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchDocumentsResult": - """Searches for documents in the index. - - :param search_text: A full-text search query expression; Use "*" or omit this parameter to - match all documents. - :type search_text: str - :param search_options: Parameter group. - :type search_options: ~azure.search.documents.v2020_06.models.SearchOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _include_total_result_count = None - _facets = None - _filter = None - _highlight_fields = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _query_type = None - _scoring_parameters = None - _scoring_profile = None - _search_fields = None - _search_mode = None - _scoring_statistics = None - _session_id = None - _select = None - _skip = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if search_options is not None: - _include_total_result_count = search_options.include_total_result_count - _facets = search_options.facets - _filter = search_options.filter - _highlight_fields = search_options.highlight_fields - _highlight_post_tag = search_options.highlight_post_tag - _highlight_pre_tag = search_options.highlight_pre_tag - _minimum_coverage = search_options.minimum_coverage - _order_by = search_options.order_by - _query_type = search_options.query_type - _scoring_parameters = search_options.scoring_parameters - _scoring_profile = search_options.scoring_profile - _search_fields = search_options.search_fields - _search_mode = search_options.search_mode - _scoring_statistics = search_options.scoring_statistics - _session_id = search_options.session_id - _select = search_options.select - _skip = search_options.skip - _top = search_options.top - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.search_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if search_text is not None: - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - if _include_total_result_count is not None: - query_parameters['$count'] = self._serialize.query("include_total_result_count", _include_total_result_count, 'bool') - if _facets is not None: - query_parameters['facet'] = [self._serialize.query("facets", q, 'str') if q is not None else '' for q in _facets] - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _highlight_fields is not None: - query_parameters['highlight'] = self._serialize.query("highlight_fields", _highlight_fields, '[str]', div=',') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _query_type is not None: - query_parameters['queryType'] = self._serialize.query("query_type", _query_type, 'str') - if _scoring_parameters is not None: - query_parameters['scoringParameter'] = [self._serialize.query("scoring_parameters", q, 'str') if q is not None else '' for q in _scoring_parameters] - if _scoring_profile is not None: - query_parameters['scoringProfile'] = self._serialize.query("scoring_profile", _scoring_profile, 'str') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _search_mode is not None: - query_parameters['searchMode'] = self._serialize.query("search_mode", _search_mode, 'str') - if _scoring_statistics is not None: - query_parameters['scoringStatistics'] = self._serialize.query("scoring_statistics", _scoring_statistics, 'str') - if _session_id is not None: - query_parameters['sessionId'] = self._serialize.query("session_id", _session_id, 'str') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", _skip, 'int') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_get.metadata = {'url': '/docs'} # type: ignore - - async def search_post( - self, - search_request: "_models.SearchRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchDocumentsResult": - """Searches for documents in the index. - - :param search_request: The definition of the Search request. - :type search_request: ~azure.search.documents.v2020_06.models.SearchRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.search_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(search_request, 'SearchRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_post.metadata = {'url': '/docs/search.post.search'} # type: ignore - - async def get( - self, - key: str, - selected_fields: Optional[List[str]] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> object: - """Retrieves a document from the index. - - :param key: The key of the document to retrieve. - :type key: str - :param selected_fields: List of field names to retrieve for the document; Any field not - retrieved will be missing from the returned document. - :type selected_fields: list[str] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: object, or the result of cls(response) - :rtype: object - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[object] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'key': self._serialize.url("key", key, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if selected_fields is not None: - query_parameters['$select'] = self._serialize.query("selected_fields", selected_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('object', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/docs(\'{key}\')'} # type: ignore - - async def suggest_get( - self, - search_text: str, - suggester_name: str, - suggest_options: Optional["_models.SuggestOptions"] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SuggestDocumentsResult": - """Suggests documents in the index that match the given partial query text. - - :param search_text: The search text to use to suggest documents. Must be at least 1 character, - and no more than 100 characters. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param suggest_options: Parameter group. - :type suggest_options: ~azure.search.documents.v2020_06.models.SuggestOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _search_fields = None - _select = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if suggest_options is not None: - _filter = suggest_options.filter - _use_fuzzy_matching = suggest_options.use_fuzzy_matching - _highlight_post_tag = suggest_options.highlight_post_tag - _highlight_pre_tag = suggest_options.highlight_pre_tag - _minimum_coverage = suggest_options.minimum_coverage - _order_by = suggest_options.order_by - _search_fields = suggest_options.search_fields - _select = suggest_options.select - _top = suggest_options.top - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.suggest_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_get.metadata = {'url': '/docs/search.suggest'} # type: ignore - - async def suggest_post( - self, - suggest_request: "_models.SuggestRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SuggestDocumentsResult": - """Suggests documents in the index that match the given partial query text. - - :param suggest_request: The Suggest request. - :type suggest_request: ~azure.search.documents.v2020_06.models.SuggestRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.suggest_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(suggest_request, 'SuggestRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_post.metadata = {'url': '/docs/search.post.suggest'} # type: ignore - - async def index( - self, - actions: List["_models.IndexAction"], - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.IndexDocumentsResult": - """Sends a batch of document write actions to the index. - - :param actions: The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06.models.IndexAction] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IndexDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.IndexDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IndexDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - - _batch = _models.IndexBatch(actions=actions) - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.index.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_batch, 'IndexBatch') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if response.status_code == 207: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - index.metadata = {'url': '/docs/search.index'} # type: ignore - - async def autocomplete_get( - self, - search_text: str, - suggester_name: str, - request_options: Optional["_models.RequestOptions"] = None, - autocomplete_options: Optional["_models.AutocompleteOptions"] = None, - **kwargs - ) -> "_models.AutocompleteResult": - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param search_text: The incomplete term which should be auto-completed. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :param autocomplete_options: Parameter group. - :type autocomplete_options: ~azure.search.documents.v2020_06.models.AutocompleteOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - _autocomplete_mode = None - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _search_fields = None - _top = None - if autocomplete_options is not None: - _autocomplete_mode = autocomplete_options.autocomplete_mode - _filter = autocomplete_options.filter - _use_fuzzy_matching = autocomplete_options.use_fuzzy_matching - _highlight_post_tag = autocomplete_options.highlight_post_tag - _highlight_pre_tag = autocomplete_options.highlight_pre_tag - _minimum_coverage = autocomplete_options.minimum_coverage - _search_fields = autocomplete_options.search_fields - _top = autocomplete_options.top - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.autocomplete_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _autocomplete_mode is not None: - query_parameters['autocompleteMode'] = self._serialize.query("autocomplete_mode", _autocomplete_mode, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_get.metadata = {'url': '/docs/search.autocomplete'} # type: ignore - - async def autocomplete_post( - self, - autocomplete_request: "_models.AutocompleteRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.AutocompleteResult": - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param autocomplete_request: The definition of the Autocomplete request. - :type autocomplete_request: ~azure.search.documents.v2020_06.models.AutocompleteRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.autocomplete_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(autocomplete_request, 'AutocompleteRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_post.metadata = {'url': '/docs/search.post.autocomplete'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_indexers_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_indexers_operations.py deleted file mode 100644 index 0baaf9340d77..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_indexers_operations.py +++ /dev/null @@ -1,588 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class IndexersOperations: - """IndexersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def reset( - self, - indexer_name: str, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> None: - """Resets the change tracking state associated with an indexer. - - :param indexer_name: The name of the indexer to reset. - :type indexer_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.reset.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - reset.metadata = {'url': '/indexers(\'{indexerName}\')/search.reset'} # type: ignore - - async def run( - self, - indexer_name: str, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> None: - """Runs an indexer on-demand. - - :param indexer_name: The name of the indexer to run. - :type indexer_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.run.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - run.metadata = {'url': '/indexers(\'{indexerName}\')/search.run'} # type: ignore - - async def create_or_update( - self, - indexer_name: str, - indexer: "_models.SearchIndexer", - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexer": - """Creates a new indexer or updates an indexer if it already exists. - - :param indexer_name: The name of the indexer to create or update. - :type indexer_name: str - :param indexer: The definition of the indexer to create or update. - :type indexer: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(indexer, 'SearchIndexer') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SearchIndexer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SearchIndexer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore - - async def delete( - self, - indexer_name: str, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> None: - """Deletes an indexer. - - :param indexer_name: The name of the indexer to delete. - :type indexer_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore - - async def get( - self, - indexer_name: str, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexer": - """Retrieves an indexer definition. - - :param indexer_name: The name of the indexer to retrieve. - :type indexer_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore - - async def list( - self, - select: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.ListIndexersResult": - """Lists all indexers available for a search service. - - :param select: Selects which top-level properties of the indexers to retrieve. Specified as a - comma-separated list of JSON property names, or '*' for all properties. The default is all - properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListIndexersResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ListIndexersResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexersResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ListIndexersResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/indexers'} # type: ignore - - async def create( - self, - indexer: "_models.SearchIndexer", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexer": - """Creates a new indexer. - - :param indexer: The definition of the indexer to create. - :type indexer: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(indexer, 'SearchIndexer') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/indexers'} # type: ignore - - async def get_status( - self, - indexer_name: str, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexerStatus": - """Returns the current status and execution history of an indexer. - - :param indexer_name: The name of the indexer for which to retrieve status. - :type indexer_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerStatus, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get_status.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_status.metadata = {'url': '/indexers(\'{indexerName}\')/search.status'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_indexes_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_indexes_operations.py deleted file mode 100644 index 57d386c547e5..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_indexes_operations.py +++ /dev/null @@ -1,570 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class IndexesOperations: - """IndexesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def create( - self, - index: "_models.SearchIndex", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndex": - """Creates a new search index. - - :param index: The definition of the index to create. - :type index: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(index, 'SearchIndex') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndex', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/indexes'} # type: ignore - - def list( - self, - select: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> AsyncIterable["_models.ListIndexesResult"]: - """Lists all indexes available for a search service. - - :param select: Selects which top-level properties of the index definitions to retrieve. - Specified as a comma-separated list of JSON property names, or '*' for all properties. The - default is all properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListIndexesResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.v2020_06.models.ListIndexesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ListIndexesResult', pipeline_response) - list_of_elem = deserialized.indexes - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/indexes'} # type: ignore - - async def create_or_update( - self, - index_name: str, - index: "_models.SearchIndex", - allow_index_downtime: Optional[bool] = None, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndex": - """Creates a new search index or updates an index if it already exists. - - :param index_name: The definition of the index to create or update. - :type index_name: str - :param index: The definition of the index to create or update. - :type index: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :param allow_index_downtime: Allows new analyzers, tokenizers, token filters, or char filters - to be added to an index by taking the index offline for at least a few seconds. This - temporarily causes indexing and query requests to fail. Performance and write availability of - the index can be impaired for several minutes after the index is updated, or longer for very - large indexes. - :type allow_index_downtime: bool - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if allow_index_downtime is not None: - query_parameters['allowIndexDowntime'] = self._serialize.query("allow_index_downtime", allow_index_downtime, 'bool') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(index, 'SearchIndex') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SearchIndex', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SearchIndex', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore - - async def delete( - self, - index_name: str, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> None: - """Deletes a search index and all the documents it contains. This operation is permanent, with no - recovery option. Make sure you have a master copy of your index definition, data ingestion - code, and a backup of the primary data source in case you need to re-build the index. - - :param index_name: The name of the index to delete. - :type index_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore - - async def get( - self, - index_name: str, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndex": - """Retrieves an index definition. - - :param index_name: The name of the index to retrieve. - :type index_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndex', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore - - async def get_statistics( - self, - index_name: str, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.GetIndexStatisticsResult": - """Returns statistics for the given index, including a document count and storage usage. - - :param index_name: The name of the index for which to retrieve statistics. - :type index_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetIndexStatisticsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.GetIndexStatisticsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetIndexStatisticsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get_statistics.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('GetIndexStatisticsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_statistics.metadata = {'url': '/indexes(\'{indexName}\')/search.stats'} # type: ignore - - async def analyze( - self, - index_name: str, - request: "_models.AnalyzeRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.AnalyzeResult": - """Shows how an analyzer breaks text into tokens. - - :param index_name: The name of the index for which to test an analyzer. - :type index_name: str - :param request: The text and analyzer or analysis components to test. - :type request: ~azure.search.documents.indexes.v2020_06.models.AnalyzeRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.AnalyzeResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.analyze.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request, 'AnalyzeRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AnalyzeResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - analyze.metadata = {'url': '/indexes(\'{indexName}\')/search.analyze'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_search_client_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_search_client_operations.py deleted file mode 100644 index fd1f8fa7b0e8..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_search_client_operations.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SearchClientOperationsMixin: - - async def get_service_statistics( - self, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.ServiceStatistics": - """Gets service level statistics for a search service. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServiceStatistics, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ServiceStatistics - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceStatistics"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get_service_statistics.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ServiceStatistics', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_service_statistics.metadata = {'url': '/servicestats'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_skillsets_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_skillsets_operations.py deleted file mode 100644 index 4494247fcebc..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_skillsets_operations.py +++ /dev/null @@ -1,403 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SkillsetsOperations: - """SkillsetsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def create_or_update( - self, - skillset_name: str, - skillset: "_models.SearchIndexerSkillset", - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexerSkillset": - """Creates a new skillset in a search service or updates the skillset if it already exists. - - :param skillset_name: The name of the skillset to create or update. - :type skillset_name: str - :param skillset: The skillset containing one or more skills to create or update in a search - service. - :type skillset: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(skillset, 'SearchIndexerSkillset') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SearchIndexerSkillset', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SearchIndexerSkillset', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore - - async def delete( - self, - skillset_name: str, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> None: - """Deletes a skillset in a search service. - - :param skillset_name: The name of the skillset to delete. - :type skillset_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore - - async def get( - self, - skillset_name: str, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexerSkillset": - """Retrieves a skillset in a search service. - - :param skillset_name: The name of the skillset to retrieve. - :type skillset_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerSkillset', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore - - async def list( - self, - select: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.ListSkillsetsResult": - """List all skillsets in a search service. - - :param select: Selects which top-level properties of the skillsets to retrieve. Specified as a - comma-separated list of JSON property names, or '*' for all properties. The default is all - properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListSkillsetsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ListSkillsetsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListSkillsetsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ListSkillsetsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/skillsets'} # type: ignore - - async def create( - self, - skillset: "_models.SearchIndexerSkillset", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchIndexerSkillset": - """Creates a new skillset in a search service. - - :param skillset: The skillset containing one or more skills to create in a search service. - :type skillset: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(skillset, 'SearchIndexerSkillset') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerSkillset', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/skillsets'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_synonym_maps_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_synonym_maps_operations.py deleted file mode 100644 index a9d0ff7d4c66..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/aio/operations/_synonym_maps_operations.py +++ /dev/null @@ -1,402 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SynonymMapsOperations: - """SynonymMapsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def create_or_update( - self, - synonym_map_name: str, - synonym_map: "_models.SynonymMap", - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SynonymMap": - """Creates a new synonym map or updates a synonym map if it already exists. - - :param synonym_map_name: The name of the synonym map to create or update. - :type synonym_map_name: str - :param synonym_map: The definition of the synonym map to create or update. - :type synonym_map: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(synonym_map, 'SynonymMap') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SynonymMap', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SynonymMap', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore - - async def delete( - self, - synonym_map_name: str, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> None: - """Deletes a synonym map. - - :param synonym_map_name: The name of the synonym map to delete. - :type synonym_map_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore - - async def get( - self, - synonym_map_name: str, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SynonymMap": - """Retrieves a synonym map definition. - - :param synonym_map_name: The name of the synonym map to retrieve. - :type synonym_map_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SynonymMap', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore - - async def list( - self, - select: Optional[str] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.ListSynonymMapsResult": - """Lists all synonym maps available for a search service. - - :param select: Selects which top-level properties of the synonym maps to retrieve. Specified as - a comma-separated list of JSON property names, or '*' for all properties. The default is all - properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListSynonymMapsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ListSynonymMapsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListSynonymMapsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ListSynonymMapsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/synonymmaps'} # type: ignore - - async def create( - self, - synonym_map: "_models.SynonymMap", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SynonymMap": - """Creates a new synonym map. - - :param synonym_map: The definition of the synonym map to create. - :type synonym_map: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(synonym_map, 'SynonymMap') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SynonymMap', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/synonymmaps'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/__init__.py deleted file mode 100644 index 20f4dc451958..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/__init__.py +++ /dev/null @@ -1,465 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AnalyzeRequest - from ._models_py3 import AnalyzeResult - from ._models_py3 import AnalyzedTokenInfo - from ._models_py3 import AsciiFoldingTokenFilter - from ._models_py3 import AzureActiveDirectoryApplicationCredentials - from ._models_py3 import BM25Similarity - from ._models_py3 import CharFilter - from ._models_py3 import CjkBigramTokenFilter - from ._models_py3 import ClassicSimilarity - from ._models_py3 import ClassicTokenizer - from ._models_py3 import CognitiveServicesAccount - from ._models_py3 import CognitiveServicesAccountKey - from ._models_py3 import CommonGramTokenFilter - from ._models_py3 import ConditionalSkill - from ._models_py3 import CorsOptions - from ._models_py3 import CustomAnalyzer - from ._models_py3 import CustomEntity - from ._models_py3 import CustomEntityAlias - from ._models_py3 import CustomEntityLookupSkill - from ._models_py3 import DataChangeDetectionPolicy - from ._models_py3 import DataDeletionDetectionPolicy - from ._models_py3 import DataSourceCredentials - from ._models_py3 import DefaultCognitiveServicesAccount - from ._models_py3 import DictionaryDecompounderTokenFilter - from ._models_py3 import DistanceScoringFunction - from ._models_py3 import DistanceScoringParameters - from ._models_py3 import DocumentExtractionSkill - from ._models_py3 import EdgeNGramTokenFilter - from ._models_py3 import EdgeNGramTokenFilterV2 - from ._models_py3 import EdgeNGramTokenizer - from ._models_py3 import ElisionTokenFilter - from ._models_py3 import EntityRecognitionSkill - from ._models_py3 import FieldMapping - from ._models_py3 import FieldMappingFunction - from ._models_py3 import FreshnessScoringFunction - from ._models_py3 import FreshnessScoringParameters - from ._models_py3 import GetIndexStatisticsResult - from ._models_py3 import HighWaterMarkChangeDetectionPolicy - from ._models_py3 import ImageAnalysisSkill - from ._models_py3 import IndexerExecutionResult - from ._models_py3 import IndexingParameters - from ._models_py3 import IndexingParametersConfiguration - from ._models_py3 import IndexingSchedule - from ._models_py3 import InputFieldMappingEntry - from ._models_py3 import KeepTokenFilter - from ._models_py3 import KeyPhraseExtractionSkill - from ._models_py3 import KeywordMarkerTokenFilter - from ._models_py3 import KeywordTokenizer - from ._models_py3 import KeywordTokenizerV2 - from ._models_py3 import LanguageDetectionSkill - from ._models_py3 import LengthTokenFilter - from ._models_py3 import LexicalAnalyzer - from ._models_py3 import LexicalTokenizer - from ._models_py3 import LimitTokenFilter - from ._models_py3 import ListDataSourcesResult - from ._models_py3 import ListIndexersResult - from ._models_py3 import ListIndexesResult - from ._models_py3 import ListSkillsetsResult - from ._models_py3 import ListSynonymMapsResult - from ._models_py3 import LuceneStandardAnalyzer - from ._models_py3 import LuceneStandardTokenizer - from ._models_py3 import LuceneStandardTokenizerV2 - from ._models_py3 import MagnitudeScoringFunction - from ._models_py3 import MagnitudeScoringParameters - from ._models_py3 import MappingCharFilter - from ._models_py3 import MergeSkill - from ._models_py3 import MicrosoftLanguageStemmingTokenizer - from ._models_py3 import MicrosoftLanguageTokenizer - from ._models_py3 import NGramTokenFilter - from ._models_py3 import NGramTokenFilterV2 - from ._models_py3 import NGramTokenizer - from ._models_py3 import OcrSkill - from ._models_py3 import OutputFieldMappingEntry - from ._models_py3 import PathHierarchyTokenizerV2 - from ._models_py3 import PatternAnalyzer - from ._models_py3 import PatternCaptureTokenFilter - from ._models_py3 import PatternReplaceCharFilter - from ._models_py3 import PatternReplaceTokenFilter - from ._models_py3 import PatternTokenizer - from ._models_py3 import PhoneticTokenFilter - from ._models_py3 import RequestOptions - from ._models_py3 import ResourceCounter - from ._models_py3 import ScoringFunction - from ._models_py3 import ScoringProfile - from ._models_py3 import SearchError - from ._models_py3 import SearchField - from ._models_py3 import SearchIndex - from ._models_py3 import SearchIndexer - from ._models_py3 import SearchIndexerDataContainer - from ._models_py3 import SearchIndexerDataSource - from ._models_py3 import SearchIndexerError - from ._models_py3 import SearchIndexerLimits - from ._models_py3 import SearchIndexerSkill - from ._models_py3 import SearchIndexerSkillset - from ._models_py3 import SearchIndexerStatus - from ._models_py3 import SearchIndexerWarning - from ._models_py3 import SearchResourceEncryptionKey - from ._models_py3 import SentimentSkill - from ._models_py3 import ServiceCounters - from ._models_py3 import ServiceLimits - from ._models_py3 import ServiceStatistics - from ._models_py3 import ShaperSkill - from ._models_py3 import ShingleTokenFilter - from ._models_py3 import Similarity - from ._models_py3 import SnowballTokenFilter - from ._models_py3 import SoftDeleteColumnDeletionDetectionPolicy - from ._models_py3 import SplitSkill - from ._models_py3 import SqlIntegratedChangeTrackingPolicy - from ._models_py3 import StemmerOverrideTokenFilter - from ._models_py3 import StemmerTokenFilter - from ._models_py3 import StopAnalyzer - from ._models_py3 import StopwordsTokenFilter - from ._models_py3 import Suggester - from ._models_py3 import SynonymMap - from ._models_py3 import SynonymTokenFilter - from ._models_py3 import TagScoringFunction - from ._models_py3 import TagScoringParameters - from ._models_py3 import TextTranslationSkill - from ._models_py3 import TextWeights - from ._models_py3 import TokenFilter - from ._models_py3 import TruncateTokenFilter - from ._models_py3 import UaxUrlEmailTokenizer - from ._models_py3 import UniqueTokenFilter - from ._models_py3 import WebApiSkill - from ._models_py3 import WordDelimiterTokenFilter -except (SyntaxError, ImportError): - from ._models import AnalyzeRequest # type: ignore - from ._models import AnalyzeResult # type: ignore - from ._models import AnalyzedTokenInfo # type: ignore - from ._models import AsciiFoldingTokenFilter # type: ignore - from ._models import AzureActiveDirectoryApplicationCredentials # type: ignore - from ._models import BM25Similarity # type: ignore - from ._models import CharFilter # type: ignore - from ._models import CjkBigramTokenFilter # type: ignore - from ._models import ClassicSimilarity # type: ignore - from ._models import ClassicTokenizer # type: ignore - from ._models import CognitiveServicesAccount # type: ignore - from ._models import CognitiveServicesAccountKey # type: ignore - from ._models import CommonGramTokenFilter # type: ignore - from ._models import ConditionalSkill # type: ignore - from ._models import CorsOptions # type: ignore - from ._models import CustomAnalyzer # type: ignore - from ._models import CustomEntity # type: ignore - from ._models import CustomEntityAlias # type: ignore - from ._models import CustomEntityLookupSkill # type: ignore - from ._models import DataChangeDetectionPolicy # type: ignore - from ._models import DataDeletionDetectionPolicy # type: ignore - from ._models import DataSourceCredentials # type: ignore - from ._models import DefaultCognitiveServicesAccount # type: ignore - from ._models import DictionaryDecompounderTokenFilter # type: ignore - from ._models import DistanceScoringFunction # type: ignore - from ._models import DistanceScoringParameters # type: ignore - from ._models import DocumentExtractionSkill # type: ignore - from ._models import EdgeNGramTokenFilter # type: ignore - from ._models import EdgeNGramTokenFilterV2 # type: ignore - from ._models import EdgeNGramTokenizer # type: ignore - from ._models import ElisionTokenFilter # type: ignore - from ._models import EntityRecognitionSkill # type: ignore - from ._models import FieldMapping # type: ignore - from ._models import FieldMappingFunction # type: ignore - from ._models import FreshnessScoringFunction # type: ignore - from ._models import FreshnessScoringParameters # type: ignore - from ._models import GetIndexStatisticsResult # type: ignore - from ._models import HighWaterMarkChangeDetectionPolicy # type: ignore - from ._models import ImageAnalysisSkill # type: ignore - from ._models import IndexerExecutionResult # type: ignore - from ._models import IndexingParameters # type: ignore - from ._models import IndexingParametersConfiguration # type: ignore - from ._models import IndexingSchedule # type: ignore - from ._models import InputFieldMappingEntry # type: ignore - from ._models import KeepTokenFilter # type: ignore - from ._models import KeyPhraseExtractionSkill # type: ignore - from ._models import KeywordMarkerTokenFilter # type: ignore - from ._models import KeywordTokenizer # type: ignore - from ._models import KeywordTokenizerV2 # type: ignore - from ._models import LanguageDetectionSkill # type: ignore - from ._models import LengthTokenFilter # type: ignore - from ._models import LexicalAnalyzer # type: ignore - from ._models import LexicalTokenizer # type: ignore - from ._models import LimitTokenFilter # type: ignore - from ._models import ListDataSourcesResult # type: ignore - from ._models import ListIndexersResult # type: ignore - from ._models import ListIndexesResult # type: ignore - from ._models import ListSkillsetsResult # type: ignore - from ._models import ListSynonymMapsResult # type: ignore - from ._models import LuceneStandardAnalyzer # type: ignore - from ._models import LuceneStandardTokenizer # type: ignore - from ._models import LuceneStandardTokenizerV2 # type: ignore - from ._models import MagnitudeScoringFunction # type: ignore - from ._models import MagnitudeScoringParameters # type: ignore - from ._models import MappingCharFilter # type: ignore - from ._models import MergeSkill # type: ignore - from ._models import MicrosoftLanguageStemmingTokenizer # type: ignore - from ._models import MicrosoftLanguageTokenizer # type: ignore - from ._models import NGramTokenFilter # type: ignore - from ._models import NGramTokenFilterV2 # type: ignore - from ._models import NGramTokenizer # type: ignore - from ._models import OcrSkill # type: ignore - from ._models import OutputFieldMappingEntry # type: ignore - from ._models import PathHierarchyTokenizerV2 # type: ignore - from ._models import PatternAnalyzer # type: ignore - from ._models import PatternCaptureTokenFilter # type: ignore - from ._models import PatternReplaceCharFilter # type: ignore - from ._models import PatternReplaceTokenFilter # type: ignore - from ._models import PatternTokenizer # type: ignore - from ._models import PhoneticTokenFilter # type: ignore - from ._models import RequestOptions # type: ignore - from ._models import ResourceCounter # type: ignore - from ._models import ScoringFunction # type: ignore - from ._models import ScoringProfile # type: ignore - from ._models import SearchError # type: ignore - from ._models import SearchField # type: ignore - from ._models import SearchIndex # type: ignore - from ._models import SearchIndexer # type: ignore - from ._models import SearchIndexerDataContainer # type: ignore - from ._models import SearchIndexerDataSource # type: ignore - from ._models import SearchIndexerError # type: ignore - from ._models import SearchIndexerLimits # type: ignore - from ._models import SearchIndexerSkill # type: ignore - from ._models import SearchIndexerSkillset # type: ignore - from ._models import SearchIndexerStatus # type: ignore - from ._models import SearchIndexerWarning # type: ignore - from ._models import SearchResourceEncryptionKey # type: ignore - from ._models import SentimentSkill # type: ignore - from ._models import ServiceCounters # type: ignore - from ._models import ServiceLimits # type: ignore - from ._models import ServiceStatistics # type: ignore - from ._models import ShaperSkill # type: ignore - from ._models import ShingleTokenFilter # type: ignore - from ._models import Similarity # type: ignore - from ._models import SnowballTokenFilter # type: ignore - from ._models import SoftDeleteColumnDeletionDetectionPolicy # type: ignore - from ._models import SplitSkill # type: ignore - from ._models import SqlIntegratedChangeTrackingPolicy # type: ignore - from ._models import StemmerOverrideTokenFilter # type: ignore - from ._models import StemmerTokenFilter # type: ignore - from ._models import StopAnalyzer # type: ignore - from ._models import StopwordsTokenFilter # type: ignore - from ._models import Suggester # type: ignore - from ._models import SynonymMap # type: ignore - from ._models import SynonymTokenFilter # type: ignore - from ._models import TagScoringFunction # type: ignore - from ._models import TagScoringParameters # type: ignore - from ._models import TextTranslationSkill # type: ignore - from ._models import TextWeights # type: ignore - from ._models import TokenFilter # type: ignore - from ._models import TruncateTokenFilter # type: ignore - from ._models import UaxUrlEmailTokenizer # type: ignore - from ._models import UniqueTokenFilter # type: ignore - from ._models import WebApiSkill # type: ignore - from ._models import WordDelimiterTokenFilter # type: ignore - -from ._search_client_enums import ( - BlobIndexerDataToExtract, - BlobIndexerImageAction, - BlobIndexerPDFTextRotationAlgorithm, - BlobIndexerParsingMode, - CharFilterName, - CjkBigramTokenFilterScripts, - CustomEntityLookupSkillLanguage, - EdgeNGramTokenFilterSide, - EntityCategory, - EntityRecognitionSkillLanguage, - ImageAnalysisSkillLanguage, - ImageDetail, - IndexerExecutionEnvironment, - IndexerExecutionStatus, - IndexerStatus, - KeyPhraseExtractionSkillLanguage, - LexicalAnalyzerName, - LexicalTokenizerName, - MicrosoftStemmingTokenizerLanguage, - MicrosoftTokenizerLanguage, - OcrSkillLanguage, - PhoneticEncoder, - RegexFlags, - ScoringFunctionAggregation, - ScoringFunctionInterpolation, - SearchFieldDataType, - SearchIndexerDataSourceType, - SentimentSkillLanguage, - SnowballTokenFilterLanguage, - SplitSkillLanguage, - StemmerTokenFilterLanguage, - StopwordsList, - TextSplitMode, - TextTranslationSkillLanguage, - TokenCharacterKind, - TokenFilterName, - VisualFeature, -) - -__all__ = [ - 'AnalyzeRequest', - 'AnalyzeResult', - 'AnalyzedTokenInfo', - 'AsciiFoldingTokenFilter', - 'AzureActiveDirectoryApplicationCredentials', - 'BM25Similarity', - 'CharFilter', - 'CjkBigramTokenFilter', - 'ClassicSimilarity', - 'ClassicTokenizer', - 'CognitiveServicesAccount', - 'CognitiveServicesAccountKey', - 'CommonGramTokenFilter', - 'ConditionalSkill', - 'CorsOptions', - 'CustomAnalyzer', - 'CustomEntity', - 'CustomEntityAlias', - 'CustomEntityLookupSkill', - 'DataChangeDetectionPolicy', - 'DataDeletionDetectionPolicy', - 'DataSourceCredentials', - 'DefaultCognitiveServicesAccount', - 'DictionaryDecompounderTokenFilter', - 'DistanceScoringFunction', - 'DistanceScoringParameters', - 'DocumentExtractionSkill', - 'EdgeNGramTokenFilter', - 'EdgeNGramTokenFilterV2', - 'EdgeNGramTokenizer', - 'ElisionTokenFilter', - 'EntityRecognitionSkill', - 'FieldMapping', - 'FieldMappingFunction', - 'FreshnessScoringFunction', - 'FreshnessScoringParameters', - 'GetIndexStatisticsResult', - 'HighWaterMarkChangeDetectionPolicy', - 'ImageAnalysisSkill', - 'IndexerExecutionResult', - 'IndexingParameters', - 'IndexingParametersConfiguration', - 'IndexingSchedule', - 'InputFieldMappingEntry', - 'KeepTokenFilter', - 'KeyPhraseExtractionSkill', - 'KeywordMarkerTokenFilter', - 'KeywordTokenizer', - 'KeywordTokenizerV2', - 'LanguageDetectionSkill', - 'LengthTokenFilter', - 'LexicalAnalyzer', - 'LexicalTokenizer', - 'LimitTokenFilter', - 'ListDataSourcesResult', - 'ListIndexersResult', - 'ListIndexesResult', - 'ListSkillsetsResult', - 'ListSynonymMapsResult', - 'LuceneStandardAnalyzer', - 'LuceneStandardTokenizer', - 'LuceneStandardTokenizerV2', - 'MagnitudeScoringFunction', - 'MagnitudeScoringParameters', - 'MappingCharFilter', - 'MergeSkill', - 'MicrosoftLanguageStemmingTokenizer', - 'MicrosoftLanguageTokenizer', - 'NGramTokenFilter', - 'NGramTokenFilterV2', - 'NGramTokenizer', - 'OcrSkill', - 'OutputFieldMappingEntry', - 'PathHierarchyTokenizerV2', - 'PatternAnalyzer', - 'PatternCaptureTokenFilter', - 'PatternReplaceCharFilter', - 'PatternReplaceTokenFilter', - 'PatternTokenizer', - 'PhoneticTokenFilter', - 'RequestOptions', - 'ResourceCounter', - 'ScoringFunction', - 'ScoringProfile', - 'SearchError', - 'SearchField', - 'SearchIndex', - 'SearchIndexer', - 'SearchIndexerDataContainer', - 'SearchIndexerDataSource', - 'SearchIndexerError', - 'SearchIndexerLimits', - 'SearchIndexerSkill', - 'SearchIndexerSkillset', - 'SearchIndexerStatus', - 'SearchIndexerWarning', - 'SearchResourceEncryptionKey', - 'SentimentSkill', - 'ServiceCounters', - 'ServiceLimits', - 'ServiceStatistics', - 'ShaperSkill', - 'ShingleTokenFilter', - 'Similarity', - 'SnowballTokenFilter', - 'SoftDeleteColumnDeletionDetectionPolicy', - 'SplitSkill', - 'SqlIntegratedChangeTrackingPolicy', - 'StemmerOverrideTokenFilter', - 'StemmerTokenFilter', - 'StopAnalyzer', - 'StopwordsTokenFilter', - 'Suggester', - 'SynonymMap', - 'SynonymTokenFilter', - 'TagScoringFunction', - 'TagScoringParameters', - 'TextTranslationSkill', - 'TextWeights', - 'TokenFilter', - 'TruncateTokenFilter', - 'UaxUrlEmailTokenizer', - 'UniqueTokenFilter', - 'WebApiSkill', - 'WordDelimiterTokenFilter', - 'BlobIndexerDataToExtract', - 'BlobIndexerImageAction', - 'BlobIndexerPDFTextRotationAlgorithm', - 'BlobIndexerParsingMode', - 'CharFilterName', - 'CjkBigramTokenFilterScripts', - 'CustomEntityLookupSkillLanguage', - 'EdgeNGramTokenFilterSide', - 'EntityCategory', - 'EntityRecognitionSkillLanguage', - 'ImageAnalysisSkillLanguage', - 'ImageDetail', - 'IndexerExecutionEnvironment', - 'IndexerExecutionStatus', - 'IndexerStatus', - 'KeyPhraseExtractionSkillLanguage', - 'LexicalAnalyzerName', - 'LexicalTokenizerName', - 'MicrosoftStemmingTokenizerLanguage', - 'MicrosoftTokenizerLanguage', - 'OcrSkillLanguage', - 'PhoneticEncoder', - 'RegexFlags', - 'ScoringFunctionAggregation', - 'ScoringFunctionInterpolation', - 'SearchFieldDataType', - 'SearchIndexerDataSourceType', - 'SentimentSkillLanguage', - 'SnowballTokenFilterLanguage', - 'SplitSkillLanguage', - 'StemmerTokenFilterLanguage', - 'StopwordsList', - 'TextSplitMode', - 'TextTranslationSkillLanguage', - 'TokenCharacterKind', - 'TokenFilterName', - 'VisualFeature', -] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_models.py deleted file mode 100644 index 8b1b33743209..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_models.py +++ /dev/null @@ -1,5790 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class AnalyzedTokenInfo(msrest.serialization.Model): - """Information about a token returned by an analyzer. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar token: Required. The token returned by the analyzer. - :vartype token: str - :ivar start_offset: Required. The index of the first character of the token in the input text. - :vartype start_offset: int - :ivar end_offset: Required. The index of the last character of the token in the input text. - :vartype end_offset: int - :ivar position: Required. The position of the token in the input text relative to other tokens. - The first token in the input text has position 0, the next has position 1, and so on. Depending - on the analyzer used, some tokens might have the same position, for example if they are - synonyms of each other. - :vartype position: int - """ - - _validation = { - 'token': {'required': True, 'readonly': True}, - 'start_offset': {'required': True, 'readonly': True}, - 'end_offset': {'required': True, 'readonly': True}, - 'position': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'token': {'key': 'token', 'type': 'str'}, - 'start_offset': {'key': 'startOffset', 'type': 'int'}, - 'end_offset': {'key': 'endOffset', 'type': 'int'}, - 'position': {'key': 'position', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(AnalyzedTokenInfo, self).__init__(**kwargs) - self.token = None - self.start_offset = None - self.end_offset = None - self.position = None - - -class AnalyzeRequest(msrest.serialization.Model): - """Specifies some text and analysis components used to break that text into tokens. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. The text to break into tokens. - :type text: str - :param analyzer: The name of the analyzer to use to break the given text. If this parameter is - not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters are - mutually exclusive. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", - "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- - Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", - "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", - "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", - "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", - "gu.microsoft", "he.microsoft", "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", - "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", - "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", - "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", - "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- - PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", - "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", - "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", - "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", - "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", - "simple", "stop", "whitespace". - :type analyzer: str or ~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzerName - :param tokenizer: The name of the tokenizer to use to break the given text. If this parameter - is not specified, you must specify an analyzer instead. The tokenizer and analyzer parameters - are mutually exclusive. Possible values include: "classic", "edgeNGram", "keyword_v2", - "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", - "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or ~azure.search.documents.indexes.v2020_06.models.LexicalTokenizerName - :param token_filters: An optional list of token filters to use when breaking the given text. - This parameter can only be set when using the tokenizer parameter. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06.models.TokenFilterName] - :param char_filters: An optional list of character filters to use when breaking the given text. - This parameter can only be set when using the tokenizer parameter. - :type char_filters: list[str or ~azure.search.documents.indexes.v2020_06.models.CharFilterName] - """ - - _validation = { - 'text': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'analyzer': {'key': 'analyzer', 'type': 'str'}, - 'tokenizer': {'key': 'tokenizer', 'type': 'str'}, - 'token_filters': {'key': 'tokenFilters', 'type': '[str]'}, - 'char_filters': {'key': 'charFilters', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AnalyzeRequest, self).__init__(**kwargs) - self.text = kwargs['text'] - self.analyzer = kwargs.get('analyzer', None) - self.tokenizer = kwargs.get('tokenizer', None) - self.token_filters = kwargs.get('token_filters', None) - self.char_filters = kwargs.get('char_filters', None) - - -class AnalyzeResult(msrest.serialization.Model): - """The result of testing an analyzer on text. - - All required parameters must be populated in order to send to Azure. - - :param tokens: Required. The list of tokens returned by the analyzer specified in the request. - :type tokens: list[~azure.search.documents.indexes.v2020_06.models.AnalyzedTokenInfo] - """ - - _validation = { - 'tokens': {'required': True}, - } - - _attribute_map = { - 'tokens': {'key': 'tokens', 'type': '[AnalyzedTokenInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(AnalyzeResult, self).__init__(**kwargs) - self.tokens = kwargs['tokens'] - - -class TokenFilter(msrest.serialization.Model): - """Base type for token filters. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AsciiFoldingTokenFilter, CjkBigramTokenFilter, CommonGramTokenFilter, DictionaryDecompounderTokenFilter, EdgeNGramTokenFilter, EdgeNGramTokenFilterV2, ElisionTokenFilter, KeepTokenFilter, KeywordMarkerTokenFilter, LengthTokenFilter, LimitTokenFilter, NGramTokenFilter, NGramTokenFilterV2, PatternCaptureTokenFilter, PatternReplaceTokenFilter, PhoneticTokenFilter, ShingleTokenFilter, SnowballTokenFilter, StemmerOverrideTokenFilter, StemmerTokenFilter, StopwordsTokenFilter, SynonymTokenFilter, TruncateTokenFilter, UniqueTokenFilter, WordDelimiterTokenFilter. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.AsciiFoldingTokenFilter': 'AsciiFoldingTokenFilter', '#Microsoft.Azure.Search.CjkBigramTokenFilter': 'CjkBigramTokenFilter', '#Microsoft.Azure.Search.CommonGramTokenFilter': 'CommonGramTokenFilter', '#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter': 'DictionaryDecompounderTokenFilter', '#Microsoft.Azure.Search.EdgeNGramTokenFilter': 'EdgeNGramTokenFilter', '#Microsoft.Azure.Search.EdgeNGramTokenFilterV2': 'EdgeNGramTokenFilterV2', '#Microsoft.Azure.Search.ElisionTokenFilter': 'ElisionTokenFilter', '#Microsoft.Azure.Search.KeepTokenFilter': 'KeepTokenFilter', '#Microsoft.Azure.Search.KeywordMarkerTokenFilter': 'KeywordMarkerTokenFilter', '#Microsoft.Azure.Search.LengthTokenFilter': 'LengthTokenFilter', '#Microsoft.Azure.Search.LimitTokenFilter': 'LimitTokenFilter', '#Microsoft.Azure.Search.NGramTokenFilter': 'NGramTokenFilter', '#Microsoft.Azure.Search.NGramTokenFilterV2': 'NGramTokenFilterV2', '#Microsoft.Azure.Search.PatternCaptureTokenFilter': 'PatternCaptureTokenFilter', '#Microsoft.Azure.Search.PatternReplaceTokenFilter': 'PatternReplaceTokenFilter', '#Microsoft.Azure.Search.PhoneticTokenFilter': 'PhoneticTokenFilter', '#Microsoft.Azure.Search.ShingleTokenFilter': 'ShingleTokenFilter', '#Microsoft.Azure.Search.SnowballTokenFilter': 'SnowballTokenFilter', '#Microsoft.Azure.Search.StemmerOverrideTokenFilter': 'StemmerOverrideTokenFilter', '#Microsoft.Azure.Search.StemmerTokenFilter': 'StemmerTokenFilter', '#Microsoft.Azure.Search.StopwordsTokenFilter': 'StopwordsTokenFilter', '#Microsoft.Azure.Search.SynonymTokenFilter': 'SynonymTokenFilter', '#Microsoft.Azure.Search.TruncateTokenFilter': 'TruncateTokenFilter', '#Microsoft.Azure.Search.UniqueTokenFilter': 'UniqueTokenFilter', '#Microsoft.Azure.Search.WordDelimiterTokenFilter': 'WordDelimiterTokenFilter'} - } - - def __init__( - self, - **kwargs - ): - super(TokenFilter, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = kwargs['name'] - - -class AsciiFoldingTokenFilter(TokenFilter): - """Converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 ASCII characters (the "Basic Latin" Unicode block) into their ASCII equivalents, if such equivalents exist. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param preserve_original: A value indicating whether the original token will be kept. Default - is false. - :type preserve_original: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'preserve_original': {'key': 'preserveOriginal', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AsciiFoldingTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.AsciiFoldingTokenFilter' # type: str - self.preserve_original = kwargs.get('preserve_original', False) - - -class AzureActiveDirectoryApplicationCredentials(msrest.serialization.Model): - """Credentials of a registered application created for your search service, used for authenticated access to the encryption keys stored in Azure Key Vault. - - All required parameters must be populated in order to send to Azure. - - :param application_id: Required. An AAD Application ID that was granted the required access - permissions to the Azure Key Vault that is to be used when encrypting your data at rest. The - Application ID should not be confused with the Object ID for your AAD Application. - :type application_id: str - :param application_secret: The authentication key of the specified AAD application. - :type application_secret: str - """ - - _validation = { - 'application_id': {'required': True}, - } - - _attribute_map = { - 'application_id': {'key': 'applicationId', 'type': 'str'}, - 'application_secret': {'key': 'applicationSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureActiveDirectoryApplicationCredentials, self).__init__(**kwargs) - self.application_id = kwargs['application_id'] - self.application_secret = kwargs.get('application_secret', None) - - -class Similarity(msrest.serialization.Model): - """Base type for similarity algorithms. Similarity algorithms are used to calculate scores that tie queries to documents. The higher the score, the more relevant the document is to that specific query. Those scores are used to rank the search results. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BM25Similarity, ClassicSimilarity. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.BM25Similarity': 'BM25Similarity', '#Microsoft.Azure.Search.ClassicSimilarity': 'ClassicSimilarity'} - } - - def __init__( - self, - **kwargs - ): - super(Similarity, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class BM25Similarity(Similarity): - """Ranking function based on the Okapi BM25 similarity algorithm. BM25 is a TF-IDF-like algorithm that includes length normalization (controlled by the 'b' parameter) as well as term frequency saturation (controlled by the 'k1' parameter). - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Constant filled by server. - :type odata_type: str - :param k1: This property controls the scaling function between the term frequency of each - matching terms and the final relevance score of a document-query pair. By default, a value of - 1.2 is used. A value of 0.0 means the score does not scale with an increase in term frequency. - :type k1: float - :param b: This property controls how the length of a document affects the relevance score. By - default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, - while a value of 1.0 means the score is fully normalized by the length of the document. - :type b: float - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'k1': {'key': 'k1', 'type': 'float'}, - 'b': {'key': 'b', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(BM25Similarity, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.BM25Similarity' # type: str - self.k1 = kwargs.get('k1', None) - self.b = kwargs.get('b', None) - - -class CharFilter(msrest.serialization.Model): - """Base type for character filters. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MappingCharFilter, PatternReplaceCharFilter. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.MappingCharFilter': 'MappingCharFilter', '#Microsoft.Azure.Search.PatternReplaceCharFilter': 'PatternReplaceCharFilter'} - } - - def __init__( - self, - **kwargs - ): - super(CharFilter, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = kwargs['name'] - - -class CjkBigramTokenFilter(TokenFilter): - """Forms bigrams of CJK terms that are generated from the standard tokenizer. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param ignore_scripts: The scripts to ignore. - :type ignore_scripts: list[str or - ~azure.search.documents.indexes.v2020_06.models.CjkBigramTokenFilterScripts] - :param output_unigrams: A value indicating whether to output both unigrams and bigrams (if - true), or just bigrams (if false). Default is false. - :type output_unigrams: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'ignore_scripts': {'key': 'ignoreScripts', 'type': '[str]'}, - 'output_unigrams': {'key': 'outputUnigrams', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(CjkBigramTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.CjkBigramTokenFilter' # type: str - self.ignore_scripts = kwargs.get('ignore_scripts', None) - self.output_unigrams = kwargs.get('output_unigrams', False) - - -class ClassicSimilarity(Similarity): - """Legacy similarity algorithm which uses the Lucene TFIDFSimilarity implementation of TF-IDF. This variation of TF-IDF introduces static document length normalization as well as coordinating factors that penalize documents that only partially match the searched queries. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ClassicSimilarity, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.ClassicSimilarity' # type: str - - -class LexicalTokenizer(msrest.serialization.Model): - """Base type for tokenizers. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassicTokenizer, EdgeNGramTokenizer, KeywordTokenizer, KeywordTokenizerV2, MicrosoftLanguageStemmingTokenizer, MicrosoftLanguageTokenizer, NGramTokenizer, PathHierarchyTokenizerV2, PatternTokenizer, LuceneStandardTokenizer, LuceneStandardTokenizerV2, UaxUrlEmailTokenizer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.ClassicTokenizer': 'ClassicTokenizer', '#Microsoft.Azure.Search.EdgeNGramTokenizer': 'EdgeNGramTokenizer', '#Microsoft.Azure.Search.KeywordTokenizer': 'KeywordTokenizer', '#Microsoft.Azure.Search.KeywordTokenizerV2': 'KeywordTokenizerV2', '#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer': 'MicrosoftLanguageStemmingTokenizer', '#Microsoft.Azure.Search.MicrosoftLanguageTokenizer': 'MicrosoftLanguageTokenizer', '#Microsoft.Azure.Search.NGramTokenizer': 'NGramTokenizer', '#Microsoft.Azure.Search.PathHierarchyTokenizerV2': 'PathHierarchyTokenizerV2', '#Microsoft.Azure.Search.PatternTokenizer': 'PatternTokenizer', '#Microsoft.Azure.Search.StandardTokenizer': 'LuceneStandardTokenizer', '#Microsoft.Azure.Search.StandardTokenizerV2': 'LuceneStandardTokenizerV2', '#Microsoft.Azure.Search.UaxUrlEmailTokenizer': 'UaxUrlEmailTokenizer'} - } - - def __init__( - self, - **kwargs - ): - super(LexicalTokenizer, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = kwargs['name'] - - -class ClassicTokenizer(LexicalTokenizer): - """Grammar-based tokenizer that is suitable for processing most European-language documents. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ClassicTokenizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.ClassicTokenizer' # type: str - self.max_token_length = kwargs.get('max_token_length', 255) - - -class CognitiveServicesAccount(msrest.serialization.Model): - """Base type for describing any cognitive service resource attached to a skillset. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CognitiveServicesAccountKey, DefaultCognitiveServicesAccount. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the cognitive service resource - attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.CognitiveServicesByKey': 'CognitiveServicesAccountKey', '#Microsoft.Azure.Search.DefaultCognitiveServices': 'DefaultCognitiveServicesAccount'} - } - - def __init__( - self, - **kwargs - ): - super(CognitiveServicesAccount, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.description = kwargs.get('description', None) - - -class CognitiveServicesAccountKey(CognitiveServicesAccount): - """A cognitive service resource provisioned with a key that is attached to a skillset. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the cognitive service resource - attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str - :param key: Required. The key used to provision the cognitive service resource attached to a - skillset. - :type key: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'key': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CognitiveServicesAccountKey, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.CognitiveServicesByKey' # type: str - self.key = kwargs['key'] - - -class CommonGramTokenFilter(TokenFilter): - """Construct bigrams for frequently occurring terms while indexing. Single terms are still indexed too, with bigrams overlaid. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param common_words: Required. The set of common words. - :type common_words: list[str] - :param ignore_case: A value indicating whether common words matching will be case insensitive. - Default is false. - :type ignore_case: bool - :param use_query_mode: A value that indicates whether the token filter is in query mode. When - in query mode, the token filter generates bigrams and then removes common words and single - terms followed by a common word. Default is false. - :type use_query_mode: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'common_words': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'common_words': {'key': 'commonWords', 'type': '[str]'}, - 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, - 'use_query_mode': {'key': 'queryMode', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(CommonGramTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.CommonGramTokenFilter' # type: str - self.common_words = kwargs['common_words'] - self.ignore_case = kwargs.get('ignore_case', False) - self.use_query_mode = kwargs.get('use_query_mode', False) - - -class SearchIndexerSkill(msrest.serialization.Model): - """Base type for skills. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: WebApiSkill, CustomEntityLookupSkill, EntityRecognitionSkill, KeyPhraseExtractionSkill, LanguageDetectionSkill, MergeSkill, SentimentSkill, SplitSkill, TextTranslationSkill, ConditionalSkill, DocumentExtractionSkill, ShaperSkill, ImageAnalysisSkill, OcrSkill. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Skills.Custom.WebApiSkill': 'WebApiSkill', '#Microsoft.Skills.Text.CustomEntityLookupSkill': 'CustomEntityLookupSkill', '#Microsoft.Skills.Text.EntityRecognitionSkill': 'EntityRecognitionSkill', '#Microsoft.Skills.Text.KeyPhraseExtractionSkill': 'KeyPhraseExtractionSkill', '#Microsoft.Skills.Text.LanguageDetectionSkill': 'LanguageDetectionSkill', '#Microsoft.Skills.Text.MergeSkill': 'MergeSkill', '#Microsoft.Skills.Text.SentimentSkill': 'SentimentSkill', '#Microsoft.Skills.Text.SplitSkill': 'SplitSkill', '#Microsoft.Skills.Text.TranslationSkill': 'TextTranslationSkill', '#Microsoft.Skills.Util.ConditionalSkill': 'ConditionalSkill', '#Microsoft.Skills.Util.DocumentExtractionSkill': 'DocumentExtractionSkill', '#Microsoft.Skills.Util.ShaperSkill': 'ShaperSkill', '#Microsoft.Skills.Vision.ImageAnalysisSkill': 'ImageAnalysisSkill', '#Microsoft.Skills.Vision.OcrSkill': 'OcrSkill'} - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerSkill, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = kwargs.get('name', None) - self.description = kwargs.get('description', None) - self.context = kwargs.get('context', None) - self.inputs = kwargs['inputs'] - self.outputs = kwargs['outputs'] - - -class ConditionalSkill(SearchIndexerSkill): - """A skill that enables scenarios that require a Boolean operation to determine the data to assign to an output. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConditionalSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Util.ConditionalSkill' # type: str - - -class CorsOptions(msrest.serialization.Model): - """Defines options to control Cross-Origin Resource Sharing (CORS) for an index. - - All required parameters must be populated in order to send to Azure. - - :param allowed_origins: Required. The list of origins from which JavaScript code will be - granted access to your index. Can contain a list of hosts of the form {protocol}://{fully- - qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not recommended). - :type allowed_origins: list[str] - :param max_age_in_seconds: The duration for which browsers should cache CORS preflight - responses. Defaults to 5 minutes. - :type max_age_in_seconds: long - """ - - _validation = { - 'allowed_origins': {'required': True}, - } - - _attribute_map = { - 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, - 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(CorsOptions, self).__init__(**kwargs) - self.allowed_origins = kwargs['allowed_origins'] - self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) - - -class LexicalAnalyzer(msrest.serialization.Model): - """Base type for analyzers. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomAnalyzer, PatternAnalyzer, LuceneStandardAnalyzer, StopAnalyzer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.CustomAnalyzer': 'CustomAnalyzer', '#Microsoft.Azure.Search.PatternAnalyzer': 'PatternAnalyzer', '#Microsoft.Azure.Search.StandardAnalyzer': 'LuceneStandardAnalyzer', '#Microsoft.Azure.Search.StopAnalyzer': 'StopAnalyzer'} - } - - def __init__( - self, - **kwargs - ): - super(LexicalAnalyzer, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = kwargs['name'] - - -class CustomAnalyzer(LexicalAnalyzer): - """Allows you to take control over the process of converting text into indexable/searchable tokens. It's a user-defined configuration consisting of a single predefined tokenizer and one or more filters. The tokenizer is responsible for breaking text into tokens, and the filters for modifying tokens emitted by the tokenizer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param tokenizer: Required. The name of the tokenizer to use to divide continuous text into a - sequence of tokens, such as breaking a sentence into words. Possible values include: "classic", - "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", - "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", - "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or ~azure.search.documents.indexes.v2020_06.models.LexicalTokenizerName - :param token_filters: A list of token filters used to filter out or modify the tokens generated - by a tokenizer. For example, you can specify a lowercase filter that converts all characters to - lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06.models.TokenFilterName] - :param char_filters: A list of character filters used to prepare input text before it is - processed by the tokenizer. For instance, they can replace certain characters or symbols. The - filters are run in the order in which they are listed. - :type char_filters: list[str or ~azure.search.documents.indexes.v2020_06.models.CharFilterName] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'tokenizer': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tokenizer': {'key': 'tokenizer', 'type': 'str'}, - 'token_filters': {'key': 'tokenFilters', 'type': '[str]'}, - 'char_filters': {'key': 'charFilters', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(CustomAnalyzer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.CustomAnalyzer' # type: str - self.tokenizer = kwargs['tokenizer'] - self.token_filters = kwargs.get('token_filters', None) - self.char_filters = kwargs.get('char_filters', None) - - -class CustomEntity(msrest.serialization.Model): - """An object that contains information about the matches that were found, and related metadata. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The top-level entity descriptor. Matches in the skill output will be - grouped by this name, and it should represent the "normalized" form of the text being found. - :type name: str - :param description: This field can be used as a passthrough for custom metadata about the - matched text(s). The value of this field will appear with every match of its entity in the - skill output. - :type description: str - :param type: This field can be used as a passthrough for custom metadata about the matched - text(s). The value of this field will appear with every match of its entity in the skill - output. - :type type: str - :param subtype: This field can be used as a passthrough for custom metadata about the matched - text(s). The value of this field will appear with every match of its entity in the skill - output. - :type subtype: str - :param id: This field can be used as a passthrough for custom metadata about the matched - text(s). The value of this field will appear with every match of its entity in the skill - output. - :type id: str - :param case_sensitive: Defaults to false. Boolean value denoting whether comparisons with the - entity name should be sensitive to character casing. Sample case insensitive matches of - "Microsoft" could be: microsoft, microSoft, MICROSOFT. - :type case_sensitive: bool - :param accent_sensitive: Defaults to false. Boolean value denoting whether comparisons with the - entity name should be sensitive to accent. - :type accent_sensitive: bool - :param fuzzy_edit_distance: Defaults to 0. Maximum value of 5. Denotes the acceptable number of - divergent characters that would still constitute a match with the entity name. The smallest - possible fuzziness for any given match is returned. For instance, if the edit distance is set - to 3, "Windows10" would still match "Windows", "Windows10" and "Windows 7". When case - sensitivity is set to false, case differences do NOT count towards fuzziness tolerance, but - otherwise do. - :type fuzzy_edit_distance: int - :param default_case_sensitive: Changes the default case sensitivity value for this entity. It - be used to change the default value of all aliases caseSensitive values. - :type default_case_sensitive: bool - :param default_accent_sensitive: Changes the default accent sensitivity value for this entity. - It be used to change the default value of all aliases accentSensitive values. - :type default_accent_sensitive: bool - :param default_fuzzy_edit_distance: Changes the default fuzzy edit distance value for this - entity. It can be used to change the default value of all aliases fuzzyEditDistance values. - :type default_fuzzy_edit_distance: int - :param aliases: An array of complex objects that can be used to specify alternative spellings - or synonyms to the root entity name. - :type aliases: list[~azure.search.documents.indexes.v2020_06.models.CustomEntityAlias] - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'subtype': {'key': 'subtype', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'case_sensitive': {'key': 'caseSensitive', 'type': 'bool'}, - 'accent_sensitive': {'key': 'accentSensitive', 'type': 'bool'}, - 'fuzzy_edit_distance': {'key': 'fuzzyEditDistance', 'type': 'int'}, - 'default_case_sensitive': {'key': 'defaultCaseSensitive', 'type': 'bool'}, - 'default_accent_sensitive': {'key': 'defaultAccentSensitive', 'type': 'bool'}, - 'default_fuzzy_edit_distance': {'key': 'defaultFuzzyEditDistance', 'type': 'int'}, - 'aliases': {'key': 'aliases', 'type': '[CustomEntityAlias]'}, - } - - def __init__( - self, - **kwargs - ): - super(CustomEntity, self).__init__(**kwargs) - self.name = kwargs['name'] - self.description = kwargs.get('description', None) - self.type = kwargs.get('type', None) - self.subtype = kwargs.get('subtype', None) - self.id = kwargs.get('id', None) - self.case_sensitive = kwargs.get('case_sensitive', None) - self.accent_sensitive = kwargs.get('accent_sensitive', None) - self.fuzzy_edit_distance = kwargs.get('fuzzy_edit_distance', None) - self.default_case_sensitive = kwargs.get('default_case_sensitive', None) - self.default_accent_sensitive = kwargs.get('default_accent_sensitive', None) - self.default_fuzzy_edit_distance = kwargs.get('default_fuzzy_edit_distance', None) - self.aliases = kwargs.get('aliases', None) - - -class CustomEntityAlias(msrest.serialization.Model): - """A complex object that can be used to specify alternative spellings or synonyms to the root entity name. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. The text of the alias. - :type text: str - :param case_sensitive: Determine if the alias is case sensitive. - :type case_sensitive: bool - :param accent_sensitive: Determine if the alias is accent sensitive. - :type accent_sensitive: bool - :param fuzzy_edit_distance: Determine the fuzzy edit distance of the alias. - :type fuzzy_edit_distance: int - """ - - _validation = { - 'text': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'case_sensitive': {'key': 'caseSensitive', 'type': 'bool'}, - 'accent_sensitive': {'key': 'accentSensitive', 'type': 'bool'}, - 'fuzzy_edit_distance': {'key': 'fuzzyEditDistance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(CustomEntityAlias, self).__init__(**kwargs) - self.text = kwargs['text'] - self.case_sensitive = kwargs.get('case_sensitive', None) - self.accent_sensitive = kwargs.get('accent_sensitive', None) - self.fuzzy_edit_distance = kwargs.get('fuzzy_edit_distance', None) - - -class CustomEntityLookupSkill(SearchIndexerSkill): - """A skill looks for text from a custom, user-defined list of words and phrases. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.CustomEntityLookupSkillLanguage - :param entities_definition_uri: Path to a JSON or CSV file containing all the target text to - match against. This entity definition is read at the beginning of an indexer run. Any updates - to this file during an indexer run will not take effect until subsequent runs. This config must - be accessible over HTTPS. - :type entities_definition_uri: str - :param inline_entities_definition: The inline CustomEntity definition. - :type inline_entities_definition: - list[~azure.search.documents.indexes.v2020_06.models.CustomEntity] - :param global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is not - set in CustomEntity, this value will be the default value. - :type global_default_case_sensitive: bool - :param global_default_accent_sensitive: A global flag for AccentSensitive. If AccentSensitive - is not set in CustomEntity, this value will be the default value. - :type global_default_accent_sensitive: bool - :param global_default_fuzzy_edit_distance: A global flag for FuzzyEditDistance. If - FuzzyEditDistance is not set in CustomEntity, this value will be the default value. - :type global_default_fuzzy_edit_distance: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'entities_definition_uri': {'key': 'entitiesDefinitionUri', 'type': 'str'}, - 'inline_entities_definition': {'key': 'inlineEntitiesDefinition', 'type': '[CustomEntity]'}, - 'global_default_case_sensitive': {'key': 'globalDefaultCaseSensitive', 'type': 'bool'}, - 'global_default_accent_sensitive': {'key': 'globalDefaultAccentSensitive', 'type': 'bool'}, - 'global_default_fuzzy_edit_distance': {'key': 'globalDefaultFuzzyEditDistance', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(CustomEntityLookupSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Text.CustomEntityLookupSkill' # type: str - self.default_language_code = kwargs.get('default_language_code', None) - self.entities_definition_uri = kwargs.get('entities_definition_uri', None) - self.inline_entities_definition = kwargs.get('inline_entities_definition', None) - self.global_default_case_sensitive = kwargs.get('global_default_case_sensitive', None) - self.global_default_accent_sensitive = kwargs.get('global_default_accent_sensitive', None) - self.global_default_fuzzy_edit_distance = kwargs.get('global_default_fuzzy_edit_distance', None) - - -class DataChangeDetectionPolicy(msrest.serialization.Model): - """Base type for data change detection policies. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: HighWaterMarkChangeDetectionPolicy, SqlIntegratedChangeTrackingPolicy. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data change detection - policy.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy': 'HighWaterMarkChangeDetectionPolicy', '#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy': 'SqlIntegratedChangeTrackingPolicy'} - } - - def __init__( - self, - **kwargs - ): - super(DataChangeDetectionPolicy, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class DataDeletionDetectionPolicy(msrest.serialization.Model): - """Base type for data deletion detection policies. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SoftDeleteColumnDeletionDetectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data deletion detection - policy.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy': 'SoftDeleteColumnDeletionDetectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - super(DataDeletionDetectionPolicy, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class DataSourceCredentials(msrest.serialization.Model): - """Represents credentials that can be used to connect to a datasource. - - :param connection_string: The connection string for the datasource. Set to - ':code:``' if you do not want the connection string updated. - :type connection_string: str - """ - - _attribute_map = { - 'connection_string': {'key': 'connectionString', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataSourceCredentials, self).__init__(**kwargs) - self.connection_string = kwargs.get('connection_string', None) - - -class DefaultCognitiveServicesAccount(CognitiveServicesAccount): - """An empty object that represents the default cognitive service resource for a skillset. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the cognitive service resource - attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DefaultCognitiveServicesAccount, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.DefaultCognitiveServices' # type: str - - -class DictionaryDecompounderTokenFilter(TokenFilter): - """Decomposes compound words found in many Germanic languages. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param word_list: Required. The list of words to match against. - :type word_list: list[str] - :param min_word_size: The minimum word size. Only words longer than this get processed. Default - is 5. Maximum is 300. - :type min_word_size: int - :param min_subword_size: The minimum subword size. Only subwords longer than this are - outputted. Default is 2. Maximum is 300. - :type min_subword_size: int - :param max_subword_size: The maximum subword size. Only subwords shorter than this are - outputted. Default is 15. Maximum is 300. - :type max_subword_size: int - :param only_longest_match: A value indicating whether to add only the longest matching subword - to the output. Default is false. - :type only_longest_match: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'word_list': {'required': True}, - 'min_word_size': {'maximum': 300}, - 'min_subword_size': {'maximum': 300}, - 'max_subword_size': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'word_list': {'key': 'wordList', 'type': '[str]'}, - 'min_word_size': {'key': 'minWordSize', 'type': 'int'}, - 'min_subword_size': {'key': 'minSubwordSize', 'type': 'int'}, - 'max_subword_size': {'key': 'maxSubwordSize', 'type': 'int'}, - 'only_longest_match': {'key': 'onlyLongestMatch', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(DictionaryDecompounderTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter' # type: str - self.word_list = kwargs['word_list'] - self.min_word_size = kwargs.get('min_word_size', 5) - self.min_subword_size = kwargs.get('min_subword_size', 2) - self.max_subword_size = kwargs.get('max_subword_size', 15) - self.only_longest_match = kwargs.get('only_longest_match', False) - - -class ScoringFunction(msrest.serialization.Model): - """Base type for functions that can modify document scores during ranking. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DistanceScoringFunction, FreshnessScoringFunction, MagnitudeScoringFunction, TagScoringFunction. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'distance': 'DistanceScoringFunction', 'freshness': 'FreshnessScoringFunction', 'magnitude': 'MagnitudeScoringFunction', 'tag': 'TagScoringFunction'} - } - - def __init__( - self, - **kwargs - ): - super(ScoringFunction, self).__init__(**kwargs) - self.type = None # type: Optional[str] - self.field_name = kwargs['field_name'] - self.boost = kwargs['boost'] - self.interpolation = kwargs.get('interpolation', None) - - -class DistanceScoringFunction(ScoringFunction): - """Defines a function that boosts scores based on distance from a geographic location. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the distance scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.DistanceScoringParameters - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - 'parameters': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - 'parameters': {'key': 'distance', 'type': 'DistanceScoringParameters'}, - } - - def __init__( - self, - **kwargs - ): - super(DistanceScoringFunction, self).__init__(**kwargs) - self.type = 'distance' # type: str - self.parameters = kwargs['parameters'] - - -class DistanceScoringParameters(msrest.serialization.Model): - """Provides parameter values to a distance scoring function. - - All required parameters must be populated in order to send to Azure. - - :param reference_point_parameter: Required. The name of the parameter passed in search queries - to specify the reference location. - :type reference_point_parameter: str - :param boosting_distance: Required. The distance in kilometers from the reference location - where the boosting range ends. - :type boosting_distance: float - """ - - _validation = { - 'reference_point_parameter': {'required': True}, - 'boosting_distance': {'required': True}, - } - - _attribute_map = { - 'reference_point_parameter': {'key': 'referencePointParameter', 'type': 'str'}, - 'boosting_distance': {'key': 'boostingDistance', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(DistanceScoringParameters, self).__init__(**kwargs) - self.reference_point_parameter = kwargs['reference_point_parameter'] - self.boosting_distance = kwargs['boosting_distance'] - - -class DocumentExtractionSkill(SearchIndexerSkill): - """A skill that extracts content from a file within the enrichment pipeline. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. - :type parsing_mode: str - :param data_to_extract: The type of data to be extracted for the skill. Will be set to - 'contentAndMetadata' if not defined. - :type data_to_extract: str - :param configuration: A dictionary of configurations for the skill. - :type configuration: dict[str, object] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'parsing_mode': {'key': 'parsingMode', 'type': 'str'}, - 'data_to_extract': {'key': 'dataToExtract', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - super(DocumentExtractionSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Util.DocumentExtractionSkill' # type: str - self.parsing_mode = kwargs.get('parsing_mode', None) - self.data_to_extract = kwargs.get('data_to_extract', None) - self.configuration = kwargs.get('configuration', None) - - -class EdgeNGramTokenFilter(TokenFilter): - """Generates n-grams of the given size(s) starting from the front or the back of an input token. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Must be less than the value of - maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. - :type max_gram: int - :param side: Specifies which side of the input the n-gram should be generated from. Default is - "front". Possible values include: "front", "back". - :type side: str or ~azure.search.documents.indexes.v2020_06.models.EdgeNGramTokenFilterSide - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - 'side': {'key': 'side', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EdgeNGramTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.EdgeNGramTokenFilter' # type: str - self.min_gram = kwargs.get('min_gram', 1) - self.max_gram = kwargs.get('max_gram', 2) - self.side = kwargs.get('side', None) - - -class EdgeNGramTokenFilterV2(TokenFilter): - """Generates n-grams of the given size(s) starting from the front or the back of an input token. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param side: Specifies which side of the input the n-gram should be generated from. Default is - "front". Possible values include: "front", "back". - :type side: str or ~azure.search.documents.indexes.v2020_06.models.EdgeNGramTokenFilterSide - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_gram': {'maximum': 300}, - 'max_gram': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - 'side': {'key': 'side', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EdgeNGramTokenFilterV2, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.EdgeNGramTokenFilterV2' # type: str - self.min_gram = kwargs.get('min_gram', 1) - self.max_gram = kwargs.get('max_gram', 2) - self.side = kwargs.get('side', None) - - -class EdgeNGramTokenizer(LexicalTokenizer): - """Tokenizes the input from an edge into n-grams of the given size(s). This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or - ~azure.search.documents.indexes.v2020_06.models.TokenCharacterKind] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_gram': {'maximum': 300}, - 'max_gram': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - 'token_chars': {'key': 'tokenChars', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(EdgeNGramTokenizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.EdgeNGramTokenizer' # type: str - self.min_gram = kwargs.get('min_gram', 1) - self.max_gram = kwargs.get('max_gram', 2) - self.token_chars = kwargs.get('token_chars', None) - - -class ElisionTokenFilter(TokenFilter): - """Removes elisions. For example, "l'avion" (the plane) will be converted to "avion" (plane). This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param articles: The set of articles to remove. - :type articles: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'articles': {'key': 'articles', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ElisionTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.ElisionTokenFilter' # type: str - self.articles = kwargs.get('articles', None) - - -class EntityRecognitionSkill(SearchIndexerSkill): - """Text analytics entity recognition. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param categories: A list of entity categories that should be extracted. - :type categories: list[str or ~azure.search.documents.indexes.v2020_06.models.EntityCategory] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "ar", "cs", "zh-Hans", "zh-Hant", "da", "nl", "en", "fi", "fr", "de", - "el", "hu", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv", "tr". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.EntityRecognitionSkillLanguage - :param include_typeless_entities: Determines whether or not to include entities which are well - known but don't conform to a pre-defined type. If this configuration is not set (default), set - to null or set to false, entities which don't conform to one of the pre-defined types will not - be surfaced. - :type include_typeless_entities: bool - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose - confidence score is greater than the value specified. If not set (default), or if explicitly - set to null, all entities will be included. - :type minimum_precision: float - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'categories': {'key': 'categories', 'type': '[str]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'include_typeless_entities': {'key': 'includeTypelessEntities', 'type': 'bool'}, - 'minimum_precision': {'key': 'minimumPrecision', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(EntityRecognitionSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Text.EntityRecognitionSkill' # type: str - self.categories = kwargs.get('categories', None) - self.default_language_code = kwargs.get('default_language_code', None) - self.include_typeless_entities = kwargs.get('include_typeless_entities', None) - self.minimum_precision = kwargs.get('minimum_precision', None) - - -class FieldMapping(msrest.serialization.Model): - """Defines a mapping between a field in a data source and a target field in an index. - - All required parameters must be populated in order to send to Azure. - - :param source_field_name: Required. The name of the field in the data source. - :type source_field_name: str - :param target_field_name: The name of the target field in the index. Same as the source field - name by default. - :type target_field_name: str - :param mapping_function: A function to apply to each source field value before indexing. - :type mapping_function: ~azure.search.documents.indexes.v2020_06.models.FieldMappingFunction - """ - - _validation = { - 'source_field_name': {'required': True}, - } - - _attribute_map = { - 'source_field_name': {'key': 'sourceFieldName', 'type': 'str'}, - 'target_field_name': {'key': 'targetFieldName', 'type': 'str'}, - 'mapping_function': {'key': 'mappingFunction', 'type': 'FieldMappingFunction'}, - } - - def __init__( - self, - **kwargs - ): - super(FieldMapping, self).__init__(**kwargs) - self.source_field_name = kwargs['source_field_name'] - self.target_field_name = kwargs.get('target_field_name', None) - self.mapping_function = kwargs.get('mapping_function', None) - - -class FieldMappingFunction(msrest.serialization.Model): - """Represents a function that transforms a value from a data source before indexing. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the field mapping function. - :type name: str - :param parameters: A dictionary of parameter name/value pairs to pass to the function. Each - value must be of a primitive type. - :type parameters: dict[str, object] - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - super(FieldMappingFunction, self).__init__(**kwargs) - self.name = kwargs['name'] - self.parameters = kwargs.get('parameters', None) - - -class FreshnessScoringFunction(ScoringFunction): - """Defines a function that boosts scores based on the value of a date-time field. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the freshness scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.FreshnessScoringParameters - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - 'parameters': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - 'parameters': {'key': 'freshness', 'type': 'FreshnessScoringParameters'}, - } - - def __init__( - self, - **kwargs - ): - super(FreshnessScoringFunction, self).__init__(**kwargs) - self.type = 'freshness' # type: str - self.parameters = kwargs['parameters'] - - -class FreshnessScoringParameters(msrest.serialization.Model): - """Provides parameter values to a freshness scoring function. - - All required parameters must be populated in order to send to Azure. - - :param boosting_duration: Required. The expiration period after which boosting will stop for a - particular document. - :type boosting_duration: ~datetime.timedelta - """ - - _validation = { - 'boosting_duration': {'required': True}, - } - - _attribute_map = { - 'boosting_duration': {'key': 'boostingDuration', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - super(FreshnessScoringParameters, self).__init__(**kwargs) - self.boosting_duration = kwargs['boosting_duration'] - - -class GetIndexStatisticsResult(msrest.serialization.Model): - """Statistics for a given index. Statistics are collected periodically and are not guaranteed to always be up-to-date. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar document_count: Required. The number of documents in the index. - :vartype document_count: long - :ivar storage_size: Required. The amount of storage in bytes consumed by the index. - :vartype storage_size: long - """ - - _validation = { - 'document_count': {'required': True, 'readonly': True}, - 'storage_size': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'document_count': {'key': 'documentCount', 'type': 'long'}, - 'storage_size': {'key': 'storageSize', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(GetIndexStatisticsResult, self).__init__(**kwargs) - self.document_count = None - self.storage_size = None - - -class HighWaterMarkChangeDetectionPolicy(DataChangeDetectionPolicy): - """Defines a data change detection policy that captures changes based on the value of a high water mark column. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data change detection - policy.Constant filled by server. - :type odata_type: str - :param high_water_mark_column_name: Required. The name of the high water mark column. - :type high_water_mark_column_name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'high_water_mark_column_name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'high_water_mark_column_name': {'key': 'highWaterMarkColumnName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HighWaterMarkChangeDetectionPolicy, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy' # type: str - self.high_water_mark_column_name = kwargs['high_water_mark_column_name'] - - -class ImageAnalysisSkill(SearchIndexerSkill): - """A skill that analyzes image files. It extracts a rich set of visual features based on the image content. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "en", "es", "ja", "pt", "zh". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.ImageAnalysisSkillLanguage - :param visual_features: A list of visual features. - :type visual_features: list[str or - ~azure.search.documents.indexes.v2020_06.models.VisualFeature] - :param details: A string indicating which domain-specific details to return. - :type details: list[str or ~azure.search.documents.indexes.v2020_06.models.ImageDetail] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'visual_features': {'key': 'visualFeatures', 'type': '[str]'}, - 'details': {'key': 'details', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ImageAnalysisSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Vision.ImageAnalysisSkill' # type: str - self.default_language_code = kwargs.get('default_language_code', None) - self.visual_features = kwargs.get('visual_features', None) - self.details = kwargs.get('details', None) - - -class IndexerExecutionResult(msrest.serialization.Model): - """Represents the result of an individual indexer execution. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar status: Required. The outcome of this indexer execution. Possible values include: - "transientFailure", "success", "inProgress", "reset". - :vartype status: str or ~azure.search.documents.indexes.v2020_06.models.IndexerExecutionStatus - :ivar error_message: The error message indicating the top-level error, if any. - :vartype error_message: str - :ivar start_time: The start time of this indexer execution. - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time of this indexer execution, if the execution has already completed. - :vartype end_time: ~datetime.datetime - :ivar errors: Required. The item-level indexing errors. - :vartype errors: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerError] - :ivar warnings: Required. The item-level indexing warnings. - :vartype warnings: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerWarning] - :ivar item_count: Required. The number of items that were processed during this indexer - execution. This includes both successfully processed items and items where indexing was - attempted but failed. - :vartype item_count: int - :ivar failed_item_count: Required. The number of items that failed to be indexed during this - indexer execution. - :vartype failed_item_count: int - :ivar initial_tracking_state: Change tracking state with which an indexer execution started. - :vartype initial_tracking_state: str - :ivar final_tracking_state: Change tracking state with which an indexer execution finished. - :vartype final_tracking_state: str - """ - - _validation = { - 'status': {'required': True, 'readonly': True}, - 'error_message': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'errors': {'required': True, 'readonly': True}, - 'warnings': {'required': True, 'readonly': True}, - 'item_count': {'required': True, 'readonly': True}, - 'failed_item_count': {'required': True, 'readonly': True}, - 'initial_tracking_state': {'readonly': True}, - 'final_tracking_state': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[SearchIndexerError]'}, - 'warnings': {'key': 'warnings', 'type': '[SearchIndexerWarning]'}, - 'item_count': {'key': 'itemsProcessed', 'type': 'int'}, - 'failed_item_count': {'key': 'itemsFailed', 'type': 'int'}, - 'initial_tracking_state': {'key': 'initialTrackingState', 'type': 'str'}, - 'final_tracking_state': {'key': 'finalTrackingState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexerExecutionResult, self).__init__(**kwargs) - self.status = None - self.error_message = None - self.start_time = None - self.end_time = None - self.errors = None - self.warnings = None - self.item_count = None - self.failed_item_count = None - self.initial_tracking_state = None - self.final_tracking_state = None - - -class IndexingParameters(msrest.serialization.Model): - """Represents parameters for indexer execution. - - :param batch_size: The number of items that are read from the data source and indexed as a - single batch in order to improve performance. The default depends on the data source type. - :type batch_size: int - :param max_failed_items: The maximum number of items that can fail indexing for indexer - execution to still be considered successful. -1 means no limit. Default is 0. - :type max_failed_items: int - :param max_failed_items_per_batch: The maximum number of items in a single batch that can fail - indexing for the batch to still be considered successful. -1 means no limit. Default is 0. - :type max_failed_items_per_batch: int - :param configuration: A dictionary of indexer-specific configuration properties. Each name is - the name of a specific property. Each value must be of a primitive type. - :type configuration: - ~azure.search.documents.indexes.v2020_06.models.IndexingParametersConfiguration - """ - - _attribute_map = { - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'max_failed_items': {'key': 'maxFailedItems', 'type': 'int'}, - 'max_failed_items_per_batch': {'key': 'maxFailedItemsPerBatch', 'type': 'int'}, - 'configuration': {'key': 'configuration', 'type': 'IndexingParametersConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexingParameters, self).__init__(**kwargs) - self.batch_size = kwargs.get('batch_size', None) - self.max_failed_items = kwargs.get('max_failed_items', 0) - self.max_failed_items_per_batch = kwargs.get('max_failed_items_per_batch', 0) - self.configuration = kwargs.get('configuration', None) - - -class IndexingParametersConfiguration(msrest.serialization.Model): - """A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :param parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. - Possible values include: "default", "text", "delimitedText", "json", "jsonArray", "jsonLines". - Default value: "default". - :type parsing_mode: str or - ~azure.search.documents.indexes.v2020_06.models.BlobIndexerParsingMode - :param excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore - when processing from Azure blob storage. For example, you could exclude ".png, .mp4" to skip - over those files during indexing. - :type excluded_file_name_extensions: str - :param indexed_file_name_extensions: Comma-delimited list of filename extensions to select when - processing from Azure blob storage. For example, you could focus indexing on specific - application files ".docx, .pptx, .msg" to specifically include those file types. - :type indexed_file_name_extensions: str - :param fail_on_unsupported_content_type: For Azure blobs, set to false if you want to continue - indexing when an unsupported content type is encountered, and you don't know all the content - types (file extensions) in advance. - :type fail_on_unsupported_content_type: bool - :param fail_on_unprocessable_document: For Azure blobs, set to false if you want to continue - indexing if a document fails indexing. - :type fail_on_unprocessable_document: bool - :param index_storage_metadata_only_for_oversized_documents: For Azure blobs, set this property - to true to still index storage metadata for blob content that is too large to process. - Oversized blobs are treated as errors by default. For limits on blob size, see - https://docs.microsoft.com/azure/search/search-limits-quotas-capacity. - :type index_storage_metadata_only_for_oversized_documents: bool - :param delimited_text_headers: For CSV blobs, specifies a comma-delimited list of column - headers, useful for mapping source fields to destination fields in an index. - :type delimited_text_headers: str - :param delimited_text_delimiter: For CSV blobs, specifies the end-of-line single-character - delimiter for CSV files where each line starts a new document (for example, "|"). - :type delimited_text_delimiter: str - :param first_line_contains_headers: For CSV blobs, indicates that the first (non-blank) line of - each blob contains headers. - :type first_line_contains_headers: bool - :param document_root: For JSON arrays, given a structured or semi-structured document, you can - specify a path to the array using this property. - :type document_root: str - :param data_to_extract: Specifies the data to extract from Azure blob storage and tells the - indexer which data to extract from image content when "imageAction" is set to a value other - than "none". This applies to embedded image content in a .PDF or other application, or image - files such as .jpg and .png, in Azure blobs. Possible values include: "storageMetadata", - "allMetadata", "contentAndMetadata". Default value: "contentAndMetadata". - :type data_to_extract: str or - ~azure.search.documents.indexes.v2020_06.models.BlobIndexerDataToExtract - :param image_action: Determines how to process embedded images and image files in Azure blob - storage. Setting the "imageAction" configuration to any value other than "none" requires that - a skillset also be attached to that indexer. Possible values include: "none", - "generateNormalizedImages", "generateNormalizedImagePerPage". Default value: "none". - :type image_action: str or - ~azure.search.documents.indexes.v2020_06.models.BlobIndexerImageAction - :param allow_skillset_to_read_file_data: If true, will create a path //document//file_data that - is an object representing the original file data downloaded from your blob data source. This - allows you to pass the original file data to a custom skill for processing within the - enrichment pipeline, or to the Document Extraction skill. - :type allow_skillset_to_read_file_data: bool - :param pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files in - Azure blob storage. Possible values include: "none", "detectAngles". Default value: "none". - :type pdf_text_rotation_algorithm: str or - ~azure.search.documents.indexes.v2020_06.models.BlobIndexerPDFTextRotationAlgorithm - :param execution_environment: Specifies the environment in which the indexer should execute. - Possible values include: "standard", "private". Default value: "standard". - :type execution_environment: str or - ~azure.search.documents.indexes.v2020_06.models.IndexerExecutionEnvironment - :param query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL database - data sources, specified in the format "hh:mm:ss". - :type query_timeout: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'parsing_mode': {'key': 'parsingMode', 'type': 'str'}, - 'excluded_file_name_extensions': {'key': 'excludedFileNameExtensions', 'type': 'str'}, - 'indexed_file_name_extensions': {'key': 'indexedFileNameExtensions', 'type': 'str'}, - 'fail_on_unsupported_content_type': {'key': 'failOnUnsupportedContentType', 'type': 'bool'}, - 'fail_on_unprocessable_document': {'key': 'failOnUnprocessableDocument', 'type': 'bool'}, - 'index_storage_metadata_only_for_oversized_documents': {'key': 'indexStorageMetadataOnlyForOversizedDocuments', 'type': 'bool'}, - 'delimited_text_headers': {'key': 'delimitedTextHeaders', 'type': 'str'}, - 'delimited_text_delimiter': {'key': 'delimitedTextDelimiter', 'type': 'str'}, - 'first_line_contains_headers': {'key': 'firstLineContainsHeaders', 'type': 'bool'}, - 'document_root': {'key': 'documentRoot', 'type': 'str'}, - 'data_to_extract': {'key': 'dataToExtract', 'type': 'str'}, - 'image_action': {'key': 'imageAction', 'type': 'str'}, - 'allow_skillset_to_read_file_data': {'key': 'allowSkillsetToReadFileData', 'type': 'bool'}, - 'pdf_text_rotation_algorithm': {'key': 'pdfTextRotationAlgorithm', 'type': 'str'}, - 'execution_environment': {'key': 'executionEnvironment', 'type': 'str'}, - 'query_timeout': {'key': 'queryTimeout', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexingParametersConfiguration, self).__init__(**kwargs) - self.additional_properties = kwargs.get('additional_properties', None) - self.parsing_mode = kwargs.get('parsing_mode', "default") - self.excluded_file_name_extensions = kwargs.get('excluded_file_name_extensions', "") - self.indexed_file_name_extensions = kwargs.get('indexed_file_name_extensions', "") - self.fail_on_unsupported_content_type = kwargs.get('fail_on_unsupported_content_type', False) - self.fail_on_unprocessable_document = kwargs.get('fail_on_unprocessable_document', False) - self.index_storage_metadata_only_for_oversized_documents = kwargs.get('index_storage_metadata_only_for_oversized_documents', False) - self.delimited_text_headers = kwargs.get('delimited_text_headers', None) - self.delimited_text_delimiter = kwargs.get('delimited_text_delimiter', None) - self.first_line_contains_headers = kwargs.get('first_line_contains_headers', True) - self.document_root = kwargs.get('document_root', None) - self.data_to_extract = kwargs.get('data_to_extract', "contentAndMetadata") - self.image_action = kwargs.get('image_action', "none") - self.allow_skillset_to_read_file_data = kwargs.get('allow_skillset_to_read_file_data', False) - self.pdf_text_rotation_algorithm = kwargs.get('pdf_text_rotation_algorithm', "none") - self.execution_environment = kwargs.get('execution_environment', "standard") - self.query_timeout = kwargs.get('query_timeout', "00:05:00") - - -class IndexingSchedule(msrest.serialization.Model): - """Represents a schedule for indexer execution. - - All required parameters must be populated in order to send to Azure. - - :param interval: Required. The interval of time between indexer executions. - :type interval: ~datetime.timedelta - :param start_time: The time when an indexer should start running. - :type start_time: ~datetime.datetime - """ - - _validation = { - 'interval': {'required': True}, - } - - _attribute_map = { - 'interval': {'key': 'interval', 'type': 'duration'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexingSchedule, self).__init__(**kwargs) - self.interval = kwargs['interval'] - self.start_time = kwargs.get('start_time', None) - - -class InputFieldMappingEntry(msrest.serialization.Model): - """Input field mapping for a skill. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the input. - :type name: str - :param source: The source of the input. - :type source: str - :param source_context: The source context used for selecting recursive inputs. - :type source_context: str - :param inputs: The recursive inputs used when creating a complex type. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'source_context': {'key': 'sourceContext', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - } - - def __init__( - self, - **kwargs - ): - super(InputFieldMappingEntry, self).__init__(**kwargs) - self.name = kwargs['name'] - self.source = kwargs.get('source', None) - self.source_context = kwargs.get('source_context', None) - self.inputs = kwargs.get('inputs', None) - - -class KeepTokenFilter(TokenFilter): - """A token filter that only keeps tokens with text contained in a specified list of words. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param keep_words: Required. The list of words to keep. - :type keep_words: list[str] - :param lower_case_keep_words: A value indicating whether to lower case all words first. Default - is false. - :type lower_case_keep_words: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'keep_words': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'keep_words': {'key': 'keepWords', 'type': '[str]'}, - 'lower_case_keep_words': {'key': 'keepWordsCase', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(KeepTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.KeepTokenFilter' # type: str - self.keep_words = kwargs['keep_words'] - self.lower_case_keep_words = kwargs.get('lower_case_keep_words', False) - - -class KeyPhraseExtractionSkill(SearchIndexerSkill): - """A skill that uses text analytics for key phrase extraction. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", "pt- - PT", "pt-BR", "ru", "es", "sv". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.KeyPhraseExtractionSkillLanguage - :param max_key_phrase_count: A number indicating how many key phrases to return. If absent, all - identified key phrases will be returned. - :type max_key_phrase_count: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'max_key_phrase_count': {'key': 'maxKeyPhraseCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KeyPhraseExtractionSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Text.KeyPhraseExtractionSkill' # type: str - self.default_language_code = kwargs.get('default_language_code', None) - self.max_key_phrase_count = kwargs.get('max_key_phrase_count', None) - - -class KeywordMarkerTokenFilter(TokenFilter): - """Marks terms as keywords. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param keywords: Required. A list of words to mark as keywords. - :type keywords: list[str] - :param ignore_case: A value indicating whether to ignore case. If true, all words are converted - to lower case first. Default is false. - :type ignore_case: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'keywords': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'keywords': {'key': 'keywords', 'type': '[str]'}, - 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(KeywordMarkerTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.KeywordMarkerTokenFilter' # type: str - self.keywords = kwargs['keywords'] - self.ignore_case = kwargs.get('ignore_case', False) - - -class KeywordTokenizer(LexicalTokenizer): - """Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param buffer_size: The read buffer size in bytes. Default is 256. - :type buffer_size: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'buffer_size': {'key': 'bufferSize', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KeywordTokenizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.KeywordTokenizer' # type: str - self.buffer_size = kwargs.get('buffer_size', 256) - - -class KeywordTokenizerV2(LexicalTokenizer): - """Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 256. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(KeywordTokenizerV2, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.KeywordTokenizerV2' # type: str - self.max_token_length = kwargs.get('max_token_length', 256) - - -class LanguageDetectionSkill(SearchIndexerSkill): - """A skill that detects the language of input text and reports a single language code for every document submitted on the request. The language code is paired with a score indicating the confidence of the analysis. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - } - - def __init__( - self, - **kwargs - ): - super(LanguageDetectionSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Text.LanguageDetectionSkill' # type: str - - -class LengthTokenFilter(TokenFilter): - """Removes words that are too long or too short. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_length: The minimum length in characters. Default is 0. Maximum is 300. Must be less - than the value of max. - :type min_length: int - :param max_length: The maximum length in characters. Default and maximum is 300. - :type max_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_length': {'maximum': 300}, - 'max_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_length': {'key': 'min', 'type': 'int'}, - 'max_length': {'key': 'max', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LengthTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.LengthTokenFilter' # type: str - self.min_length = kwargs.get('min_length', 0) - self.max_length = kwargs.get('max_length', 300) - - -class LimitTokenFilter(TokenFilter): - """Limits the number of tokens while indexing. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param max_token_count: The maximum number of tokens to produce. Default is 1. - :type max_token_count: int - :param consume_all_tokens: A value indicating whether all tokens from the input must be - consumed even if maxTokenCount is reached. Default is false. - :type consume_all_tokens: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_count': {'key': 'maxTokenCount', 'type': 'int'}, - 'consume_all_tokens': {'key': 'consumeAllTokens', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(LimitTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.LimitTokenFilter' # type: str - self.max_token_count = kwargs.get('max_token_count', 1) - self.consume_all_tokens = kwargs.get('consume_all_tokens', False) - - -class ListDataSourcesResult(msrest.serialization.Model): - """Response from a List Datasources request. If successful, it includes the full definitions of all datasources. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar data_sources: Required. The datasources in the Search service. - :vartype data_sources: - list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource] - """ - - _validation = { - 'data_sources': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'data_sources': {'key': 'value', 'type': '[SearchIndexerDataSource]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListDataSourcesResult, self).__init__(**kwargs) - self.data_sources = None - - -class ListIndexersResult(msrest.serialization.Model): - """Response from a List Indexers request. If successful, it includes the full definitions of all indexers. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar indexers: Required. The indexers in the Search service. - :vartype indexers: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexer] - """ - - _validation = { - 'indexers': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'indexers': {'key': 'value', 'type': '[SearchIndexer]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListIndexersResult, self).__init__(**kwargs) - self.indexers = None - - -class ListIndexesResult(msrest.serialization.Model): - """Response from a List Indexes request. If successful, it includes the full definitions of all indexes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar indexes: Required. The indexes in the Search service. - :vartype indexes: list[~azure.search.documents.indexes.v2020_06.models.SearchIndex] - """ - - _validation = { - 'indexes': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'indexes': {'key': 'value', 'type': '[SearchIndex]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListIndexesResult, self).__init__(**kwargs) - self.indexes = None - - -class ListSkillsetsResult(msrest.serialization.Model): - """Response from a list skillset request. If successful, it includes the full definitions of all skillsets. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar skillsets: Required. The skillsets defined in the Search service. - :vartype skillsets: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset] - """ - - _validation = { - 'skillsets': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'skillsets': {'key': 'value', 'type': '[SearchIndexerSkillset]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListSkillsetsResult, self).__init__(**kwargs) - self.skillsets = None - - -class ListSynonymMapsResult(msrest.serialization.Model): - """Response from a List SynonymMaps request. If successful, it includes the full definitions of all synonym maps. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar synonym_maps: Required. The synonym maps in the Search service. - :vartype synonym_maps: list[~azure.search.documents.indexes.v2020_06.models.SynonymMap] - """ - - _validation = { - 'synonym_maps': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'synonym_maps': {'key': 'value', 'type': '[SynonymMap]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListSynonymMapsResult, self).__init__(**kwargs) - self.synonym_maps = None - - -class LuceneStandardAnalyzer(LexicalAnalyzer): - """Standard Apache Lucene analyzer; Composed of the standard tokenizer, lowercase filter and stop filter. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - :param stopwords: A list of stopwords. - :type stopwords: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - 'stopwords': {'key': 'stopwords', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(LuceneStandardAnalyzer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.StandardAnalyzer' # type: str - self.max_token_length = kwargs.get('max_token_length', 255) - self.stopwords = kwargs.get('stopwords', None) - - -class LuceneStandardTokenizer(LexicalTokenizer): - """Breaks text following the Unicode Text Segmentation rules. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LuceneStandardTokenizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.StandardTokenizer' # type: str - self.max_token_length = kwargs.get('max_token_length', 255) - - -class LuceneStandardTokenizerV2(LexicalTokenizer): - """Breaks text following the Unicode Text Segmentation rules. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(LuceneStandardTokenizerV2, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.StandardTokenizerV2' # type: str - self.max_token_length = kwargs.get('max_token_length', 255) - - -class MagnitudeScoringFunction(ScoringFunction): - """Defines a function that boosts scores based on the magnitude of a numeric field. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the magnitude scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.MagnitudeScoringParameters - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - 'parameters': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - 'parameters': {'key': 'magnitude', 'type': 'MagnitudeScoringParameters'}, - } - - def __init__( - self, - **kwargs - ): - super(MagnitudeScoringFunction, self).__init__(**kwargs) - self.type = 'magnitude' # type: str - self.parameters = kwargs['parameters'] - - -class MagnitudeScoringParameters(msrest.serialization.Model): - """Provides parameter values to a magnitude scoring function. - - All required parameters must be populated in order to send to Azure. - - :param boosting_range_start: Required. The field value at which boosting starts. - :type boosting_range_start: float - :param boosting_range_end: Required. The field value at which boosting ends. - :type boosting_range_end: float - :param should_boost_beyond_range_by_constant: A value indicating whether to apply a constant - boost for field values beyond the range end value; default is false. - :type should_boost_beyond_range_by_constant: bool - """ - - _validation = { - 'boosting_range_start': {'required': True}, - 'boosting_range_end': {'required': True}, - } - - _attribute_map = { - 'boosting_range_start': {'key': 'boostingRangeStart', 'type': 'float'}, - 'boosting_range_end': {'key': 'boostingRangeEnd', 'type': 'float'}, - 'should_boost_beyond_range_by_constant': {'key': 'constantBoostBeyondRange', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(MagnitudeScoringParameters, self).__init__(**kwargs) - self.boosting_range_start = kwargs['boosting_range_start'] - self.boosting_range_end = kwargs['boosting_range_end'] - self.should_boost_beyond_range_by_constant = kwargs.get('should_boost_beyond_range_by_constant', None) - - -class MappingCharFilter(CharFilter): - """A character filter that applies mappings defined with the mappings option. Matching is greedy (longest pattern matching at a given point wins). Replacement is allowed to be the empty string. This character filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param mappings: Required. A list of mappings of the following format: "a=>b" (all occurrences - of the character "a" will be replaced with character "b"). - :type mappings: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'mappings': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'mappings': {'key': 'mappings', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(MappingCharFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.MappingCharFilter' # type: str - self.mappings = kwargs['mappings'] - - -class MergeSkill(SearchIndexerSkill): - """A skill for merging two or more strings into a single unified string, with an optional user-defined delimiter separating each component part. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is - an empty space. - :type insert_pre_tag: str - :param insert_post_tag: The tag indicates the end of the merged text. By default, the tag is an - empty space. - :type insert_post_tag: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'insert_pre_tag': {'key': 'insertPreTag', 'type': 'str'}, - 'insert_post_tag': {'key': 'insertPostTag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MergeSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Text.MergeSkill' # type: str - self.insert_pre_tag = kwargs.get('insert_pre_tag', " ") - self.insert_post_tag = kwargs.get('insert_post_tag', " ") - - -class MicrosoftLanguageStemmingTokenizer(LexicalTokenizer): - """Divides text using language-specific rules and reduces words to their base forms. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Tokens longer than the maximum length are - split. Maximum token length that can be used is 300 characters. Tokens longer than 300 - characters are first split into tokens of length 300 and then each of those tokens is split - based on the max token length set. Default is 255. - :type max_token_length: int - :param is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used - as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. - :type is_search_tokenizer: bool - :param language: The language to use. The default is English. Possible values include: - "arabic", "bangla", "bulgarian", "catalan", "croatian", "czech", "danish", "dutch", "english", - "estonian", "finnish", "french", "german", "greek", "gujarati", "hebrew", "hindi", "hungarian", - "icelandic", "indonesian", "italian", "kannada", "latvian", "lithuanian", "malay", "malayalam", - "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", - "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovak", "slovenian", "spanish", - "swedish", "tamil", "telugu", "turkish", "ukrainian", "urdu". - :type language: str or - ~azure.search.documents.indexes.v2020_06.models.MicrosoftStemmingTokenizerLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - 'is_search_tokenizer': {'key': 'isSearchTokenizer', 'type': 'bool'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MicrosoftLanguageStemmingTokenizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer' # type: str - self.max_token_length = kwargs.get('max_token_length', 255) - self.is_search_tokenizer = kwargs.get('is_search_tokenizer', False) - self.language = kwargs.get('language', None) - - -class MicrosoftLanguageTokenizer(LexicalTokenizer): - """Divides text using language-specific rules. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Tokens longer than the maximum length are - split. Maximum token length that can be used is 300 characters. Tokens longer than 300 - characters are first split into tokens of length 300 and then each of those tokens is split - based on the max token length set. Default is 255. - :type max_token_length: int - :param is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used - as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. - :type is_search_tokenizer: bool - :param language: The language to use. The default is English. Possible values include: - "bangla", "bulgarian", "catalan", "chineseSimplified", "chineseTraditional", "croatian", - "czech", "danish", "dutch", "english", "french", "german", "greek", "gujarati", "hindi", - "icelandic", "indonesian", "italian", "japanese", "kannada", "korean", "malay", "malayalam", - "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", - "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovenian", "spanish", "swedish", - "tamil", "telugu", "thai", "ukrainian", "urdu", "vietnamese". - :type language: str or - ~azure.search.documents.indexes.v2020_06.models.MicrosoftTokenizerLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - 'is_search_tokenizer': {'key': 'isSearchTokenizer', 'type': 'bool'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MicrosoftLanguageTokenizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.MicrosoftLanguageTokenizer' # type: str - self.max_token_length = kwargs.get('max_token_length', 255) - self.is_search_tokenizer = kwargs.get('is_search_tokenizer', False) - self.language = kwargs.get('language', None) - - -class NGramTokenFilter(TokenFilter): - """Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Must be less than the value of - maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. - :type max_gram: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(NGramTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.NGramTokenFilter' # type: str - self.min_gram = kwargs.get('min_gram', 1) - self.max_gram = kwargs.get('max_gram', 2) - - -class NGramTokenFilterV2(TokenFilter): - """Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_gram': {'maximum': 300}, - 'max_gram': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(NGramTokenFilterV2, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.NGramTokenFilterV2' # type: str - self.min_gram = kwargs.get('min_gram', 1) - self.max_gram = kwargs.get('max_gram', 2) - - -class NGramTokenizer(LexicalTokenizer): - """Tokenizes the input into n-grams of the given size(s). This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or - ~azure.search.documents.indexes.v2020_06.models.TokenCharacterKind] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_gram': {'maximum': 300}, - 'max_gram': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - 'token_chars': {'key': 'tokenChars', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(NGramTokenizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.NGramTokenizer' # type: str - self.min_gram = kwargs.get('min_gram', 1) - self.max_gram = kwargs.get('max_gram', 2) - self.token_chars = kwargs.get('token_chars', None) - - -class OcrSkill(SearchIndexerSkill): - """A skill that extracts text from image files. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "zh-Hans", "zh-Hant", "cs", "da", "nl", "en", "fi", "fr", "de", "el", - "hu", "it", "ja", "ko", "nb", "pl", "pt", "ru", "es", "sv", "tr", "ar", "ro", "sr-Cyrl", "sr- - Latn", "sk". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.OcrSkillLanguage - :param should_detect_orientation: A value indicating to turn orientation detection on or not. - Default is false. - :type should_detect_orientation: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'should_detect_orientation': {'key': 'detectOrientation', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(OcrSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Vision.OcrSkill' # type: str - self.default_language_code = kwargs.get('default_language_code', None) - self.should_detect_orientation = kwargs.get('should_detect_orientation', False) - - -class OutputFieldMappingEntry(msrest.serialization.Model): - """Output field mapping for a skill. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the output defined by the skill. - :type name: str - :param target_name: The target name of the output. It is optional and default to name. - :type target_name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'target_name': {'key': 'targetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OutputFieldMappingEntry, self).__init__(**kwargs) - self.name = kwargs['name'] - self.target_name = kwargs.get('target_name', None) - - -class PathHierarchyTokenizerV2(LexicalTokenizer): - """Tokenizer for path-like hierarchies. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param delimiter: The delimiter character to use. Default is "/". - :type delimiter: str - :param replacement: A value that, if set, replaces the delimiter character. Default is "/". - :type replacement: str - :param max_token_length: The maximum token length. Default and maximum is 300. - :type max_token_length: int - :param reverse_token_order: A value indicating whether to generate tokens in reverse order. - Default is false. - :type reverse_token_order: bool - :param number_of_tokens_to_skip: The number of initial tokens to skip. Default is 0. - :type number_of_tokens_to_skip: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'delimiter': {'key': 'delimiter', 'type': 'str'}, - 'replacement': {'key': 'replacement', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - 'reverse_token_order': {'key': 'reverse', 'type': 'bool'}, - 'number_of_tokens_to_skip': {'key': 'skip', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(PathHierarchyTokenizerV2, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.PathHierarchyTokenizerV2' # type: str - self.delimiter = kwargs.get('delimiter', "/") - self.replacement = kwargs.get('replacement', "/") - self.max_token_length = kwargs.get('max_token_length', 300) - self.reverse_token_order = kwargs.get('reverse_token_order', False) - self.number_of_tokens_to_skip = kwargs.get('number_of_tokens_to_skip', 0) - - -class PatternAnalyzer(LexicalAnalyzer): - """Flexibly separates text into terms via a regular expression pattern. This analyzer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param lower_case_terms: A value indicating whether terms should be lower-cased. Default is - true. - :type lower_case_terms: bool - :param pattern: A regular expression pattern to match token separators. Default is an - expression that matches one or more non-word characters. - :type pattern: str - :param flags: Regular expression flags. Possible values include: "CANON_EQ", - "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.v2020_06.models.RegexFlags - :param stopwords: A list of stopwords. - :type stopwords: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'lower_case_terms': {'key': 'lowercase', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'flags': {'key': 'flags', 'type': 'str'}, - 'stopwords': {'key': 'stopwords', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(PatternAnalyzer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternAnalyzer' # type: str - self.lower_case_terms = kwargs.get('lower_case_terms', True) - self.pattern = kwargs.get('pattern', "\W+") - self.flags = kwargs.get('flags', None) - self.stopwords = kwargs.get('stopwords', None) - - -class PatternCaptureTokenFilter(TokenFilter): - """Uses Java regexes to emit multiple tokens - one for each capture group in one or more patterns. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param patterns: Required. A list of patterns to match against each token. - :type patterns: list[str] - :param preserve_original: A value indicating whether to return the original token even if one - of the patterns matches. Default is true. - :type preserve_original: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'patterns': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'patterns': {'key': 'patterns', 'type': '[str]'}, - 'preserve_original': {'key': 'preserveOriginal', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(PatternCaptureTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternCaptureTokenFilter' # type: str - self.patterns = kwargs['patterns'] - self.preserve_original = kwargs.get('preserve_original', True) - - -class PatternReplaceCharFilter(CharFilter): - """A character filter that replaces characters in the input string. It uses a regular expression to identify character sequences to preserve and a replacement pattern to identify characters to replace. For example, given the input text "aa bb aa bb", pattern "(aa)\s+(bb)", and replacement "$1#$2", the result would be "aa#bb aa#bb". This character filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param pattern: Required. A regular expression pattern. - :type pattern: str - :param replacement: Required. The replacement text. - :type replacement: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'pattern': {'required': True}, - 'replacement': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'replacement': {'key': 'replacement', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PatternReplaceCharFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternReplaceCharFilter' # type: str - self.pattern = kwargs['pattern'] - self.replacement = kwargs['replacement'] - - -class PatternReplaceTokenFilter(TokenFilter): - """A character filter that replaces characters in the input string. It uses a regular expression to identify character sequences to preserve and a replacement pattern to identify characters to replace. For example, given the input text "aa bb aa bb", pattern "(aa)\s+(bb)", and replacement "$1#$2", the result would be "aa#bb aa#bb". This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param pattern: Required. A regular expression pattern. - :type pattern: str - :param replacement: Required. The replacement text. - :type replacement: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'pattern': {'required': True}, - 'replacement': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'replacement': {'key': 'replacement', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PatternReplaceTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternReplaceTokenFilter' # type: str - self.pattern = kwargs['pattern'] - self.replacement = kwargs['replacement'] - - -class PatternTokenizer(LexicalTokenizer): - """Tokenizer that uses regex pattern matching to construct distinct tokens. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param pattern: A regular expression pattern to match token separators. Default is an - expression that matches one or more non-word characters. - :type pattern: str - :param flags: Regular expression flags. Possible values include: "CANON_EQ", - "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.v2020_06.models.RegexFlags - :param group: The zero-based ordinal of the matching group in the regular expression pattern to - extract into tokens. Use -1 if you want to use the entire pattern to split the input into - tokens, irrespective of matching groups. Default is -1. - :type group: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'flags': {'key': 'flags', 'type': 'str'}, - 'group': {'key': 'group', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(PatternTokenizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternTokenizer' # type: str - self.pattern = kwargs.get('pattern', "\W+") - self.flags = kwargs.get('flags', None) - self.group = kwargs.get('group', -1) - - -class PhoneticTokenFilter(TokenFilter): - """Create tokens for phonetic matches. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param encoder: The phonetic encoder to use. Default is "metaphone". Possible values include: - "metaphone", "doubleMetaphone", "soundex", "refinedSoundex", "caverphone1", "caverphone2", - "cologne", "nysiis", "koelnerPhonetik", "haasePhonetik", "beiderMorse". - :type encoder: str or ~azure.search.documents.indexes.v2020_06.models.PhoneticEncoder - :param replace_original_tokens: A value indicating whether encoded tokens should replace - original tokens. If false, encoded tokens are added as synonyms. Default is true. - :type replace_original_tokens: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'encoder': {'key': 'encoder', 'type': 'str'}, - 'replace_original_tokens': {'key': 'replace', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(PhoneticTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.PhoneticTokenFilter' # type: str - self.encoder = kwargs.get('encoder', None) - self.replace_original_tokens = kwargs.get('replace_original_tokens', True) - - -class RequestOptions(msrest.serialization.Model): - """Parameter group. - - :param x_ms_client_request_id: The tracking ID sent with the request to help with debugging. - :type x_ms_client_request_id: str - """ - - _attribute_map = { - 'x_ms_client_request_id': {'key': 'x-ms-client-request-id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RequestOptions, self).__init__(**kwargs) - self.x_ms_client_request_id = kwargs.get('x_ms_client_request_id', None) - - -class ResourceCounter(msrest.serialization.Model): - """Represents a resource's usage and quota. - - All required parameters must be populated in order to send to Azure. - - :param usage: Required. The resource usage amount. - :type usage: long - :param quota: The resource amount quota. - :type quota: long - """ - - _validation = { - 'usage': {'required': True}, - } - - _attribute_map = { - 'usage': {'key': 'usage', 'type': 'long'}, - 'quota': {'key': 'quota', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceCounter, self).__init__(**kwargs) - self.usage = kwargs['usage'] - self.quota = kwargs.get('quota', None) - - -class ScoringProfile(msrest.serialization.Model): - """Defines parameters for a search index that influence scoring in search queries. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the scoring profile. - :type name: str - :param text_weights: Parameters that boost scoring based on text matches in certain index - fields. - :type text_weights: ~azure.search.documents.indexes.v2020_06.models.TextWeights - :param functions: The collection of functions that influence the scoring of documents. - :type functions: list[~azure.search.documents.indexes.v2020_06.models.ScoringFunction] - :param function_aggregation: A value indicating how the results of individual scoring functions - should be combined. Defaults to "Sum". Ignored if there are no scoring functions. Possible - values include: "sum", "average", "minimum", "maximum", "firstMatching". - :type function_aggregation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionAggregation - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'text_weights': {'key': 'text', 'type': 'TextWeights'}, - 'functions': {'key': 'functions', 'type': '[ScoringFunction]'}, - 'function_aggregation': {'key': 'functionAggregation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ScoringProfile, self).__init__(**kwargs) - self.name = kwargs['name'] - self.text_weights = kwargs.get('text_weights', None) - self.functions = kwargs.get('functions', None) - self.function_aggregation = kwargs.get('function_aggregation', None) - - -class SearchError(msrest.serialization.Model): - """Describes an error condition for the Azure Cognitive Search API. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code: One of a server-defined set of error codes. - :vartype code: str - :ivar message: Required. A human-readable representation of the error. - :vartype message: str - :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.search.documents.indexes.v2020_06.models.SearchError] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'required': True, 'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[SearchError]'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchError, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None - - -class SearchField(msrest.serialization.Model): - """Represents a field in an index definition, which describes the name, data type, and search behavior of a field. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the field, which must be unique within the fields collection - of the index or parent field. - :type name: str - :param type: Required. The data type of the field. Possible values include: "Edm.String", - "Edm.Int32", "Edm.Int64", "Edm.Double", "Edm.Boolean", "Edm.DateTimeOffset", - "Edm.GeographyPoint", "Edm.ComplexType". - :type type: str or ~azure.search.documents.indexes.v2020_06.models.SearchFieldDataType - :param key: A value indicating whether the field uniquely identifies documents in the index. - Exactly one top-level field in each index must be chosen as the key field and it must be of - type Edm.String. Key fields can be used to look up documents directly and update or delete - specific documents. Default is false for simple fields and null for complex fields. - :type key: bool - :param retrievable: A value indicating whether the field can be returned in a search result. - You can disable this option if you want to use a field (for example, margin) as a filter, - sorting, or scoring mechanism but do not want the field to be visible to the end user. This - property must be true for key fields, and it must be null for complex fields. This property can - be changed on existing fields. Enabling this property does not cause any increase in index - storage requirements. Default is true for simple fields and null for complex fields. - :type retrievable: bool - :param searchable: A value indicating whether the field is full-text searchable. This means it - will undergo analysis such as word-breaking during indexing. If you set a searchable field to a - value like "sunny day", internally it will be split into the individual tokens "sunny" and - "day". This enables full-text searches for these terms. Fields of type Edm.String or - Collection(Edm.String) are searchable by default. This property must be false for simple fields - of other non-string data types, and it must be null for complex fields. Note: searchable fields - consume extra space in your index since Azure Cognitive Search will store an additional - tokenized version of the field value for full-text searches. If you want to save space in your - index and you don't need a field to be included in searches, set searchable to false. - :type searchable: bool - :param filterable: A value indicating whether to enable the field to be referenced in $filter - queries. filterable differs from searchable in how strings are handled. Fields of type - Edm.String or Collection(Edm.String) that are filterable do not undergo word-breaking, so - comparisons are for exact matches only. For example, if you set such a field f to "sunny day", - $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' will. This property - must be null for complex fields. Default is true for simple fields and null for complex fields. - :type filterable: bool - :param sortable: A value indicating whether to enable the field to be referenced in $orderby - expressions. By default Azure Cognitive Search sorts results by score, but in many experiences - users will want to sort by fields in the documents. A simple field can be sortable only if it - is single-valued (it has a single value in the scope of the parent document). Simple collection - fields cannot be sortable, since they are multi-valued. Simple sub-fields of complex - collections are also multi-valued, and therefore cannot be sortable. This is true whether it's - an immediate parent field, or an ancestor field, that's the complex collection. Complex fields - cannot be sortable and the sortable property must be null for such fields. The default for - sortable is true for single-valued simple fields, false for multi-valued simple fields, and - null for complex fields. - :type sortable: bool - :param facetable: A value indicating whether to enable the field to be referenced in facet - queries. Typically used in a presentation of search results that includes hit count by category - (for example, search for digital cameras and see hits by brand, by megapixels, by price, and so - on). This property must be null for complex fields. Fields of type Edm.GeographyPoint or - Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all other simple - fields. - :type facetable: bool - :param analyzer: The name of the analyzer to use for the field. This option can be used only - with searchable fields and it can't be set together with either searchAnalyzer or - indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null - for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", - "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- - Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", - "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", - "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", - "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", - "gu.microsoft", "he.microsoft", "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", - "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", - "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", - "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", - "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- - PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", - "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", - "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", - "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", - "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", - "simple", "stop", "whitespace". - :type analyzer: str or ~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzerName - :param search_analyzer: The name of the analyzer used at search time for the field. This option - can be used only with searchable fields. It must be set together with indexAnalyzer and it - cannot be set together with the analyzer option. This property cannot be set to the name of a - language analyzer; use the analyzer property instead if you need a language analyzer. This - analyzer can be updated on an existing field. Must be null for complex fields. Possible values - include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", - "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", "zh- - Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", - "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", - "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", - "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", "he.microsoft", "hi.microsoft", - "hi.lucene", "hu.microsoft", "hu.lucene", "is.microsoft", "id.microsoft", "id.lucene", - "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", "kn.microsoft", - "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", - "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", "fa.lucene", "pl.microsoft", - "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", "pt-PT.lucene", - "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr- - cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", - "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", - "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", - "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", - "whitespace". - :type search_analyzer: str or - ~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzerName - :param index_analyzer: The name of the analyzer used at indexing time for the field. This - option can be used only with searchable fields. It must be set together with searchAnalyzer and - it cannot be set together with the analyzer option. This property cannot be set to the name of - a language analyzer; use the analyzer property instead if you need a language analyzer. Once - the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. - Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", - "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh- - Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", - "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", - "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", - "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", - "he.microsoft", "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", "is.microsoft", - "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", - "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", - "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", - "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", - "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr- - cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", - "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", - "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", - "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", - "whitespace". - :type index_analyzer: str or - ~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzerName - :param synonym_maps: A list of the names of synonym maps to associate with this field. This - option can be used only with searchable fields. Currently only one synonym map per field is - supported. Assigning a synonym map to a field ensures that query terms targeting that field are - expanded at query-time using the rules in the synonym map. This attribute can be changed on - existing fields. Must be null or an empty collection for complex fields. - :type synonym_maps: list[str] - :param fields: A list of sub-fields if this is a field of type Edm.ComplexType or - Collection(Edm.ComplexType). Must be null or empty for simple fields. - :type fields: list[~azure.search.documents.indexes.v2020_06.models.SearchField] - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'bool'}, - 'retrievable': {'key': 'retrievable', 'type': 'bool'}, - 'searchable': {'key': 'searchable', 'type': 'bool'}, - 'filterable': {'key': 'filterable', 'type': 'bool'}, - 'sortable': {'key': 'sortable', 'type': 'bool'}, - 'facetable': {'key': 'facetable', 'type': 'bool'}, - 'analyzer': {'key': 'analyzer', 'type': 'str'}, - 'search_analyzer': {'key': 'searchAnalyzer', 'type': 'str'}, - 'index_analyzer': {'key': 'indexAnalyzer', 'type': 'str'}, - 'synonym_maps': {'key': 'synonymMaps', 'type': '[str]'}, - 'fields': {'key': 'fields', 'type': '[SearchField]'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchField, self).__init__(**kwargs) - self.name = kwargs['name'] - self.type = kwargs['type'] - self.key = kwargs.get('key', None) - self.retrievable = kwargs.get('retrievable', None) - self.searchable = kwargs.get('searchable', None) - self.filterable = kwargs.get('filterable', None) - self.sortable = kwargs.get('sortable', None) - self.facetable = kwargs.get('facetable', None) - self.analyzer = kwargs.get('analyzer', None) - self.search_analyzer = kwargs.get('search_analyzer', None) - self.index_analyzer = kwargs.get('index_analyzer', None) - self.synonym_maps = kwargs.get('synonym_maps', None) - self.fields = kwargs.get('fields', None) - - -class SearchIndex(msrest.serialization.Model): - """Represents a search index definition, which describes the fields and search behavior of an index. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the index. - :type name: str - :param fields: Required. The fields of the index. - :type fields: list[~azure.search.documents.indexes.v2020_06.models.SearchField] - :param scoring_profiles: The scoring profiles for the index. - :type scoring_profiles: list[~azure.search.documents.indexes.v2020_06.models.ScoringProfile] - :param default_scoring_profile: The name of the scoring profile to use if none is specified in - the query. If this property is not set and no scoring profile is specified in the query, then - default scoring (tf-idf) will be used. - :type default_scoring_profile: str - :param cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. - :type cors_options: ~azure.search.documents.indexes.v2020_06.models.CorsOptions - :param suggesters: The suggesters for the index. - :type suggesters: list[~azure.search.documents.indexes.v2020_06.models.Suggester] - :param analyzers: The analyzers for the index. - :type analyzers: list[~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzer] - :param tokenizers: The tokenizers for the index. - :type tokenizers: list[~azure.search.documents.indexes.v2020_06.models.LexicalTokenizer] - :param token_filters: The token filters for the index. - :type token_filters: list[~azure.search.documents.indexes.v2020_06.models.TokenFilter] - :param char_filters: The character filters for the index. - :type char_filters: list[~azure.search.documents.indexes.v2020_06.models.CharFilter] - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your data when you - want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive - Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive - Search will ignore attempts to set this property to null. You can change this property as - needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with - customer-managed keys is not available for free search services, and is only available for paid - services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - :param similarity: The type of similarity algorithm to be used when scoring and ranking the - documents matching a search query. The similarity algorithm can only be defined at index - creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity - algorithm is used. - :type similarity: ~azure.search.documents.indexes.v2020_06.models.Similarity - :param e_tag: The ETag of the index. - :type e_tag: str - """ - - _validation = { - 'name': {'required': True}, - 'fields': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'fields': {'key': 'fields', 'type': '[SearchField]'}, - 'scoring_profiles': {'key': 'scoringProfiles', 'type': '[ScoringProfile]'}, - 'default_scoring_profile': {'key': 'defaultScoringProfile', 'type': 'str'}, - 'cors_options': {'key': 'corsOptions', 'type': 'CorsOptions'}, - 'suggesters': {'key': 'suggesters', 'type': '[Suggester]'}, - 'analyzers': {'key': 'analyzers', 'type': '[LexicalAnalyzer]'}, - 'tokenizers': {'key': 'tokenizers', 'type': '[LexicalTokenizer]'}, - 'token_filters': {'key': 'tokenFilters', 'type': '[TokenFilter]'}, - 'char_filters': {'key': 'charFilters', 'type': '[CharFilter]'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - 'similarity': {'key': 'similarity', 'type': 'Similarity'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndex, self).__init__(**kwargs) - self.name = kwargs['name'] - self.fields = kwargs['fields'] - self.scoring_profiles = kwargs.get('scoring_profiles', None) - self.default_scoring_profile = kwargs.get('default_scoring_profile', None) - self.cors_options = kwargs.get('cors_options', None) - self.suggesters = kwargs.get('suggesters', None) - self.analyzers = kwargs.get('analyzers', None) - self.tokenizers = kwargs.get('tokenizers', None) - self.token_filters = kwargs.get('token_filters', None) - self.char_filters = kwargs.get('char_filters', None) - self.encryption_key = kwargs.get('encryption_key', None) - self.similarity = kwargs.get('similarity', None) - self.e_tag = kwargs.get('e_tag', None) - - -class SearchIndexer(msrest.serialization.Model): - """Represents an indexer. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the indexer. - :type name: str - :param description: The description of the indexer. - :type description: str - :param data_source_name: Required. The name of the datasource from which this indexer reads - data. - :type data_source_name: str - :param skillset_name: The name of the skillset executing with this indexer. - :type skillset_name: str - :param target_index_name: Required. The name of the index to which this indexer writes data. - :type target_index_name: str - :param schedule: The schedule for this indexer. - :type schedule: ~azure.search.documents.indexes.v2020_06.models.IndexingSchedule - :param parameters: Parameters for indexer execution. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.IndexingParameters - :param field_mappings: Defines mappings between fields in the data source and corresponding - target fields in the index. - :type field_mappings: list[~azure.search.documents.indexes.v2020_06.models.FieldMapping] - :param output_field_mappings: Output field mappings are applied after enrichment and - immediately before indexing. - :type output_field_mappings: list[~azure.search.documents.indexes.v2020_06.models.FieldMapping] - :param is_disabled: A value indicating whether the indexer is disabled. Default is false. - :type is_disabled: bool - :param e_tag: The ETag of the indexer. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your indexer - definition (as well as indexer execution status) when you want full assurance that no one, not - even Microsoft, can decrypt them in Azure Cognitive Search. Once you have encrypted your - indexer definition, it will always remain encrypted. Azure Cognitive Search will ignore - attempts to set this property to null. You can change this property as needed if you want to - rotate your encryption key; Your indexer definition (and indexer execution status) will be - unaffected. Encryption with customer-managed keys is not available for free search services, - and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - """ - - _validation = { - 'name': {'required': True}, - 'data_source_name': {'required': True}, - 'target_index_name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, - 'skillset_name': {'key': 'skillsetName', 'type': 'str'}, - 'target_index_name': {'key': 'targetIndexName', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'IndexingSchedule'}, - 'parameters': {'key': 'parameters', 'type': 'IndexingParameters'}, - 'field_mappings': {'key': 'fieldMappings', 'type': '[FieldMapping]'}, - 'output_field_mappings': {'key': 'outputFieldMappings', 'type': '[FieldMapping]'}, - 'is_disabled': {'key': 'disabled', 'type': 'bool'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexer, self).__init__(**kwargs) - self.name = kwargs['name'] - self.description = kwargs.get('description', None) - self.data_source_name = kwargs['data_source_name'] - self.skillset_name = kwargs.get('skillset_name', None) - self.target_index_name = kwargs['target_index_name'] - self.schedule = kwargs.get('schedule', None) - self.parameters = kwargs.get('parameters', None) - self.field_mappings = kwargs.get('field_mappings', None) - self.output_field_mappings = kwargs.get('output_field_mappings', None) - self.is_disabled = kwargs.get('is_disabled', False) - self.e_tag = kwargs.get('e_tag', None) - self.encryption_key = kwargs.get('encryption_key', None) - - -class SearchIndexerDataContainer(msrest.serialization.Model): - """Represents information about the entity (such as Azure SQL table or CosmosDB collection) that will be indexed. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the table or view (for Azure SQL data source) or collection - (for CosmosDB data source) that will be indexed. - :type name: str - :param query: A query that is applied to this data container. The syntax and meaning of this - parameter is datasource-specific. Not supported by Azure SQL datasources. - :type query: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerDataContainer, self).__init__(**kwargs) - self.name = kwargs['name'] - self.query = kwargs.get('query', None) - - -class SearchIndexerDataSource(msrest.serialization.Model): - """Represents a datasource definition, which can be used to configure an indexer. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the datasource. - :type name: str - :param description: The description of the datasource. - :type description: str - :param type: Required. The type of the datasource. Possible values include: "azuresql", - "cosmosdb", "azureblob", "azuretable", "mysql", "adlsgen2". - :type type: str or ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSourceType - :param credentials: Required. Credentials for the datasource. - :type credentials: ~azure.search.documents.indexes.v2020_06.models.DataSourceCredentials - :param container: Required. The data container for the datasource. - :type container: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataContainer - :param data_change_detection_policy: The data change detection policy for the datasource. - :type data_change_detection_policy: - ~azure.search.documents.indexes.v2020_06.models.DataChangeDetectionPolicy - :param data_deletion_detection_policy: The data deletion detection policy for the datasource. - :type data_deletion_detection_policy: - ~azure.search.documents.indexes.v2020_06.models.DataDeletionDetectionPolicy - :param e_tag: The ETag of the data source. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your datasource - definition when you want full assurance that no one, not even Microsoft, can decrypt your data - source definition in Azure Cognitive Search. Once you have encrypted your data source - definition, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set - this property to null. You can change this property as needed if you want to rotate your - encryption key; Your datasource definition will be unaffected. Encryption with customer-managed - keys is not available for free search services, and is only available for paid services created - on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True}, - 'credentials': {'required': True}, - 'container': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'DataSourceCredentials'}, - 'container': {'key': 'container', 'type': 'SearchIndexerDataContainer'}, - 'data_change_detection_policy': {'key': 'dataChangeDetectionPolicy', 'type': 'DataChangeDetectionPolicy'}, - 'data_deletion_detection_policy': {'key': 'dataDeletionDetectionPolicy', 'type': 'DataDeletionDetectionPolicy'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerDataSource, self).__init__(**kwargs) - self.name = kwargs['name'] - self.description = kwargs.get('description', None) - self.type = kwargs['type'] - self.credentials = kwargs['credentials'] - self.container = kwargs['container'] - self.data_change_detection_policy = kwargs.get('data_change_detection_policy', None) - self.data_deletion_detection_policy = kwargs.get('data_deletion_detection_policy', None) - self.e_tag = kwargs.get('e_tag', None) - self.encryption_key = kwargs.get('encryption_key', None) - - -class SearchIndexerError(msrest.serialization.Model): - """Represents an item- or document-level indexing error. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar key: The key of the item for which indexing failed. - :vartype key: str - :ivar error_message: Required. The message describing the error that occurred while processing - the item. - :vartype error_message: str - :ivar status_code: Required. The status code indicating why the indexing operation failed. - Possible values include: 400 for a malformed input document, 404 for document not found, 409 - for a version conflict, 422 when the index is temporarily unavailable, or 503 for when the - service is too busy. - :vartype status_code: int - :ivar name: The name of the source at which the error originated. For example, this could refer - to a particular skill in the attached skillset. This may not be always available. - :vartype name: str - :ivar details: Additional, verbose details about the error to assist in debugging the indexer. - This may not be always available. - :vartype details: str - :ivar documentation_link: A link to a troubleshooting guide for these classes of errors. This - may not be always available. - :vartype documentation_link: str - """ - - _validation = { - 'key': {'readonly': True}, - 'error_message': {'required': True, 'readonly': True}, - 'status_code': {'required': True, 'readonly': True}, - 'name': {'readonly': True}, - 'details': {'readonly': True}, - 'documentation_link': {'readonly': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - 'documentation_link': {'key': 'documentationLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerError, self).__init__(**kwargs) - self.key = None - self.error_message = None - self.status_code = None - self.name = None - self.details = None - self.documentation_link = None - - -class SearchIndexerLimits(msrest.serialization.Model): - """SearchIndexerLimits. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar max_run_time: The maximum duration that the indexer is permitted to run for one - execution. - :vartype max_run_time: ~datetime.timedelta - :ivar max_document_extraction_size: The maximum size of a document, in bytes, which will be - considered valid for indexing. - :vartype max_document_extraction_size: long - :ivar max_document_content_characters_to_extract: The maximum number of characters that will be - extracted from a document picked up for indexing. - :vartype max_document_content_characters_to_extract: long - """ - - _validation = { - 'max_run_time': {'readonly': True}, - 'max_document_extraction_size': {'readonly': True}, - 'max_document_content_characters_to_extract': {'readonly': True}, - } - - _attribute_map = { - 'max_run_time': {'key': 'maxRunTime', 'type': 'duration'}, - 'max_document_extraction_size': {'key': 'maxDocumentExtractionSize', 'type': 'long'}, - 'max_document_content_characters_to_extract': {'key': 'maxDocumentContentCharactersToExtract', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerLimits, self).__init__(**kwargs) - self.max_run_time = None - self.max_document_extraction_size = None - self.max_document_content_characters_to_extract = None - - -class SearchIndexerSkillset(msrest.serialization.Model): - """A list of skills. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the skillset. - :type name: str - :param description: The description of the skillset. - :type description: str - :param skills: Required. A list of skills in the skillset. - :type skills: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkill] - :param cognitive_services_account: Details about cognitive services to be used when running - skills. - :type cognitive_services_account: - ~azure.search.documents.indexes.v2020_06.models.CognitiveServicesAccount - :param e_tag: The ETag of the skillset. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your skillset - definition when you want full assurance that no one, not even Microsoft, can decrypt your - skillset definition in Azure Cognitive Search. Once you have encrypted your skillset - definition, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set - this property to null. You can change this property as needed if you want to rotate your - encryption key; Your skillset definition will be unaffected. Encryption with customer-managed - keys is not available for free search services, and is only available for paid services created - on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - """ - - _validation = { - 'name': {'required': True}, - 'skills': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'skills': {'key': 'skills', 'type': '[SearchIndexerSkill]'}, - 'cognitive_services_account': {'key': 'cognitiveServices', 'type': 'CognitiveServicesAccount'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerSkillset, self).__init__(**kwargs) - self.name = kwargs['name'] - self.description = kwargs.get('description', None) - self.skills = kwargs['skills'] - self.cognitive_services_account = kwargs.get('cognitive_services_account', None) - self.e_tag = kwargs.get('e_tag', None) - self.encryption_key = kwargs.get('encryption_key', None) - - -class SearchIndexerStatus(msrest.serialization.Model): - """Represents the current status and execution history of an indexer. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar status: Required. Overall indexer status. Possible values include: "unknown", "error", - "running". - :vartype status: str or ~azure.search.documents.indexes.v2020_06.models.IndexerStatus - :ivar last_result: The result of the most recent or an in-progress indexer execution. - :vartype last_result: ~azure.search.documents.indexes.v2020_06.models.IndexerExecutionResult - :ivar execution_history: Required. History of the recent indexer executions, sorted in reverse - chronological order. - :vartype execution_history: - list[~azure.search.documents.indexes.v2020_06.models.IndexerExecutionResult] - :ivar limits: Required. The execution limits for the indexer. - :vartype limits: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerLimits - """ - - _validation = { - 'status': {'required': True, 'readonly': True}, - 'last_result': {'readonly': True}, - 'execution_history': {'required': True, 'readonly': True}, - 'limits': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'last_result': {'key': 'lastResult', 'type': 'IndexerExecutionResult'}, - 'execution_history': {'key': 'executionHistory', 'type': '[IndexerExecutionResult]'}, - 'limits': {'key': 'limits', 'type': 'SearchIndexerLimits'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerStatus, self).__init__(**kwargs) - self.status = None - self.last_result = None - self.execution_history = None - self.limits = None - - -class SearchIndexerWarning(msrest.serialization.Model): - """Represents an item-level warning. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar key: The key of the item which generated a warning. - :vartype key: str - :ivar message: Required. The message describing the warning that occurred while processing the - item. - :vartype message: str - :ivar name: The name of the source at which the warning originated. For example, this could - refer to a particular skill in the attached skillset. This may not be always available. - :vartype name: str - :ivar details: Additional, verbose details about the warning to assist in debugging the - indexer. This may not be always available. - :vartype details: str - :ivar documentation_link: A link to a troubleshooting guide for these classes of warnings. This - may not be always available. - :vartype documentation_link: str - """ - - _validation = { - 'key': {'readonly': True}, - 'message': {'required': True, 'readonly': True}, - 'name': {'readonly': True}, - 'details': {'readonly': True}, - 'documentation_link': {'readonly': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - 'documentation_link': {'key': 'documentationLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerWarning, self).__init__(**kwargs) - self.key = None - self.message = None - self.name = None - self.details = None - self.documentation_link = None - - -class SearchResourceEncryptionKey(msrest.serialization.Model): - """A customer-managed encryption key in Azure Key Vault. Keys that you create and manage can be used to encrypt or decrypt data-at-rest in Azure Cognitive Search, such as indexes and synonym maps. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of your Azure Key Vault key to be used to encrypt your data - at rest. - :type key_name: str - :param key_version: Required. The version of your Azure Key Vault key to be used to encrypt - your data at rest. - :type key_version: str - :param vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, that - contains the key to be used to encrypt your data at rest. An example URI might be https://my- - keyvault-name.vault.azure.net. - :type vault_uri: str - :param access_credentials: Optional Azure Active Directory credentials used for accessing your - Azure Key Vault. Not required if using managed identity instead. - :type access_credentials: - ~azure.search.documents.indexes.v2020_06.models.AzureActiveDirectoryApplicationCredentials - """ - - _validation = { - 'key_name': {'required': True}, - 'key_version': {'required': True}, - 'vault_uri': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyVaultKeyName', 'type': 'str'}, - 'key_version': {'key': 'keyVaultKeyVersion', 'type': 'str'}, - 'vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, - 'access_credentials': {'key': 'accessCredentials', 'type': 'AzureActiveDirectoryApplicationCredentials'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchResourceEncryptionKey, self).__init__(**kwargs) - self.key_name = kwargs['key_name'] - self.key_version = kwargs['key_version'] - self.vault_uri = kwargs['vault_uri'] - self.access_credentials = kwargs.get('access_credentials', None) - - -class SentimentSkill(SearchIndexerSkill): - """Text analytics positive-negative sentiment analysis, scored as a floating point value in a range of zero to 1. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "nl", "en", "fi", "fr", "de", "el", "it", "no", "pl", "pt-PT", - "ru", "es", "sv", "tr". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.SentimentSkillLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SentimentSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Text.SentimentSkill' # type: str - self.default_language_code = kwargs.get('default_language_code', None) - - -class ServiceCounters(msrest.serialization.Model): - """Represents service-level resource counters and quotas. - - All required parameters must be populated in order to send to Azure. - - :param document_counter: Required. Total number of documents across all indexes in the service. - :type document_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param index_counter: Required. Total number of indexes. - :type index_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param indexer_counter: Required. Total number of indexers. - :type indexer_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param data_source_counter: Required. Total number of data sources. - :type data_source_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param storage_size_counter: Required. Total size of used storage in bytes. - :type storage_size_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param synonym_map_counter: Required. Total number of synonym maps. - :type synonym_map_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - """ - - _validation = { - 'document_counter': {'required': True}, - 'index_counter': {'required': True}, - 'indexer_counter': {'required': True}, - 'data_source_counter': {'required': True}, - 'storage_size_counter': {'required': True}, - 'synonym_map_counter': {'required': True}, - } - - _attribute_map = { - 'document_counter': {'key': 'documentCount', 'type': 'ResourceCounter'}, - 'index_counter': {'key': 'indexesCount', 'type': 'ResourceCounter'}, - 'indexer_counter': {'key': 'indexersCount', 'type': 'ResourceCounter'}, - 'data_source_counter': {'key': 'dataSourcesCount', 'type': 'ResourceCounter'}, - 'storage_size_counter': {'key': 'storageSize', 'type': 'ResourceCounter'}, - 'synonym_map_counter': {'key': 'synonymMaps', 'type': 'ResourceCounter'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceCounters, self).__init__(**kwargs) - self.document_counter = kwargs['document_counter'] - self.index_counter = kwargs['index_counter'] - self.indexer_counter = kwargs['indexer_counter'] - self.data_source_counter = kwargs['data_source_counter'] - self.storage_size_counter = kwargs['storage_size_counter'] - self.synonym_map_counter = kwargs['synonym_map_counter'] - - -class ServiceLimits(msrest.serialization.Model): - """Represents various service level limits. - - :param max_fields_per_index: The maximum allowed fields per index. - :type max_fields_per_index: int - :param max_field_nesting_depth_per_index: The maximum depth which you can nest sub-fields in an - index, including the top-level complex field. For example, a/b/c has a nesting depth of 3. - :type max_field_nesting_depth_per_index: int - :param max_complex_collection_fields_per_index: The maximum number of fields of type - Collection(Edm.ComplexType) allowed in an index. - :type max_complex_collection_fields_per_index: int - :param max_complex_objects_in_collections_per_document: The maximum number of objects in - complex collections allowed per document. - :type max_complex_objects_in_collections_per_document: int - """ - - _attribute_map = { - 'max_fields_per_index': {'key': 'maxFieldsPerIndex', 'type': 'int'}, - 'max_field_nesting_depth_per_index': {'key': 'maxFieldNestingDepthPerIndex', 'type': 'int'}, - 'max_complex_collection_fields_per_index': {'key': 'maxComplexCollectionFieldsPerIndex', 'type': 'int'}, - 'max_complex_objects_in_collections_per_document': {'key': 'maxComplexObjectsInCollectionsPerDocument', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceLimits, self).__init__(**kwargs) - self.max_fields_per_index = kwargs.get('max_fields_per_index', None) - self.max_field_nesting_depth_per_index = kwargs.get('max_field_nesting_depth_per_index', None) - self.max_complex_collection_fields_per_index = kwargs.get('max_complex_collection_fields_per_index', None) - self.max_complex_objects_in_collections_per_document = kwargs.get('max_complex_objects_in_collections_per_document', None) - - -class ServiceStatistics(msrest.serialization.Model): - """Response from a get service statistics request. If successful, it includes service level counters and limits. - - All required parameters must be populated in order to send to Azure. - - :param counters: Required. Service level resource counters. - :type counters: ~azure.search.documents.indexes.v2020_06.models.ServiceCounters - :param limits: Required. Service level general limits. - :type limits: ~azure.search.documents.indexes.v2020_06.models.ServiceLimits - """ - - _validation = { - 'counters': {'required': True}, - 'limits': {'required': True}, - } - - _attribute_map = { - 'counters': {'key': 'counters', 'type': 'ServiceCounters'}, - 'limits': {'key': 'limits', 'type': 'ServiceLimits'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceStatistics, self).__init__(**kwargs) - self.counters = kwargs['counters'] - self.limits = kwargs['limits'] - - -class ShaperSkill(SearchIndexerSkill): - """A skill for reshaping the outputs. It creates a complex type to support composite fields (also known as multipart fields). - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - } - - def __init__( - self, - **kwargs - ): - super(ShaperSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Util.ShaperSkill' # type: str - - -class ShingleTokenFilter(TokenFilter): - """Creates combinations of tokens as a single token. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param max_shingle_size: The maximum shingle size. Default and minimum value is 2. - :type max_shingle_size: int - :param min_shingle_size: The minimum shingle size. Default and minimum value is 2. Must be less - than the value of maxShingleSize. - :type min_shingle_size: int - :param output_unigrams: A value indicating whether the output stream will contain the input - tokens (unigrams) as well as shingles. Default is true. - :type output_unigrams: bool - :param output_unigrams_if_no_shingles: A value indicating whether to output unigrams for those - times when no shingles are available. This property takes precedence when outputUnigrams is set - to false. Default is false. - :type output_unigrams_if_no_shingles: bool - :param token_separator: The string to use when joining adjacent tokens to form a shingle. - Default is a single space (" "). - :type token_separator: str - :param filter_token: The string to insert for each position at which there is no token. Default - is an underscore ("_"). - :type filter_token: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_shingle_size': {'minimum': 2}, - 'min_shingle_size': {'minimum': 2}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_shingle_size': {'key': 'maxShingleSize', 'type': 'int'}, - 'min_shingle_size': {'key': 'minShingleSize', 'type': 'int'}, - 'output_unigrams': {'key': 'outputUnigrams', 'type': 'bool'}, - 'output_unigrams_if_no_shingles': {'key': 'outputUnigramsIfNoShingles', 'type': 'bool'}, - 'token_separator': {'key': 'tokenSeparator', 'type': 'str'}, - 'filter_token': {'key': 'filterToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ShingleTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.ShingleTokenFilter' # type: str - self.max_shingle_size = kwargs.get('max_shingle_size', 2) - self.min_shingle_size = kwargs.get('min_shingle_size', 2) - self.output_unigrams = kwargs.get('output_unigrams', True) - self.output_unigrams_if_no_shingles = kwargs.get('output_unigrams_if_no_shingles', False) - self.token_separator = kwargs.get('token_separator', " ") - self.filter_token = kwargs.get('filter_token', "_") - - -class SnowballTokenFilter(TokenFilter): - """A filter that stems words using a Snowball-generated stemmer. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param language: Required. The language to use. Possible values include: "armenian", "basque", - "catalan", "danish", "dutch", "english", "finnish", "french", "german", "german2", "hungarian", - "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", "russian", - "spanish", "swedish", "turkish". - :type language: str or - ~azure.search.documents.indexes.v2020_06.models.SnowballTokenFilterLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'language': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SnowballTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.SnowballTokenFilter' # type: str - self.language = kwargs['language'] - - -class SoftDeleteColumnDeletionDetectionPolicy(DataDeletionDetectionPolicy): - """Defines a data deletion detection policy that implements a soft-deletion strategy. It determines whether an item should be deleted based on the value of a designated 'soft delete' column. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data deletion detection - policy.Constant filled by server. - :type odata_type: str - :param soft_delete_column_name: The name of the column to use for soft-deletion detection. - :type soft_delete_column_name: str - :param soft_delete_marker_value: The marker value that identifies an item as deleted. - :type soft_delete_marker_value: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'soft_delete_column_name': {'key': 'softDeleteColumnName', 'type': 'str'}, - 'soft_delete_marker_value': {'key': 'softDeleteMarkerValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SoftDeleteColumnDeletionDetectionPolicy, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy' # type: str - self.soft_delete_column_name = kwargs.get('soft_delete_column_name', None) - self.soft_delete_marker_value = kwargs.get('soft_delete_marker_value', None) - - -class SplitSkill(SearchIndexerSkill): - """A skill to split a string into chunks of text. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.SplitSkillLanguage - :param text_split_mode: A value indicating which split mode to perform. Possible values - include: "pages", "sentences". - :type text_split_mode: str or ~azure.search.documents.indexes.v2020_06.models.TextSplitMode - :param maximum_page_length: The desired maximum page length. Default is 10000. - :type maximum_page_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'text_split_mode': {'key': 'textSplitMode', 'type': 'str'}, - 'maximum_page_length': {'key': 'maximumPageLength', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SplitSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Text.SplitSkill' # type: str - self.default_language_code = kwargs.get('default_language_code', None) - self.text_split_mode = kwargs.get('text_split_mode', None) - self.maximum_page_length = kwargs.get('maximum_page_length', None) - - -class SqlIntegratedChangeTrackingPolicy(DataChangeDetectionPolicy): - """Defines a data change detection policy that captures changes using the Integrated Change Tracking feature of Azure SQL Database. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data change detection - policy.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SqlIntegratedChangeTrackingPolicy, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy' # type: str - - -class StemmerOverrideTokenFilter(TokenFilter): - """Provides the ability to override other stemming filters with custom dictionary-based stemming. Any dictionary-stemmed terms will be marked as keywords so that they will not be stemmed with stemmers down the chain. Must be placed before any stemming filters. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param rules: Required. A list of stemming rules in the following format: "word => stem", for - example: "ran => run". - :type rules: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'rules': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(StemmerOverrideTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.StemmerOverrideTokenFilter' # type: str - self.rules = kwargs['rules'] - - -class StemmerTokenFilter(TokenFilter): - """Language specific stemming filter. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param language: Required. The language to use. Possible values include: "arabic", "armenian", - "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "dutchKp", - "english", "lightEnglish", "minimalEnglish", "possessiveEnglish", "porter2", "lovins", - "finnish", "lightFinnish", "french", "lightFrench", "minimalFrench", "galician", - "minimalGalician", "german", "german2", "lightGerman", "minimalGerman", "greek", "hindi", - "hungarian", "lightHungarian", "indonesian", "irish", "italian", "lightItalian", "sorani", - "latvian", "norwegian", "lightNorwegian", "minimalNorwegian", "lightNynorsk", "minimalNynorsk", - "portuguese", "lightPortuguese", "minimalPortuguese", "portugueseRslp", "romanian", "russian", - "lightRussian", "spanish", "lightSpanish", "swedish", "lightSwedish", "turkish". - :type language: str or - ~azure.search.documents.indexes.v2020_06.models.StemmerTokenFilterLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'language': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(StemmerTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.StemmerTokenFilter' # type: str - self.language = kwargs['language'] - - -class StopAnalyzer(LexicalAnalyzer): - """Divides text at non-letters; Applies the lowercase and stopword token filters. This analyzer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param stopwords: A list of stopwords. - :type stopwords: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'stopwords': {'key': 'stopwords', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(StopAnalyzer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.StopAnalyzer' # type: str - self.stopwords = kwargs.get('stopwords', None) - - -class StopwordsTokenFilter(TokenFilter): - """Removes stop words from a token stream. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param stopwords: The list of stopwords. This property and the stopwords list property cannot - both be set. - :type stopwords: list[str] - :param stopwords_list: A predefined list of stopwords to use. This property and the stopwords - property cannot both be set. Default is English. Possible values include: "arabic", "armenian", - "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "english", - "finnish", "french", "galician", "german", "greek", "hindi", "hungarian", "indonesian", - "irish", "italian", "latvian", "norwegian", "persian", "portuguese", "romanian", "russian", - "sorani", "spanish", "swedish", "thai", "turkish". - :type stopwords_list: str or ~azure.search.documents.indexes.v2020_06.models.StopwordsList - :param ignore_case: A value indicating whether to ignore case. If true, all words are converted - to lower case first. Default is false. - :type ignore_case: bool - :param remove_trailing_stop_words: A value indicating whether to ignore the last search term if - it's a stop word. Default is true. - :type remove_trailing_stop_words: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'stopwords': {'key': 'stopwords', 'type': '[str]'}, - 'stopwords_list': {'key': 'stopwordsList', 'type': 'str'}, - 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, - 'remove_trailing_stop_words': {'key': 'removeTrailing', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(StopwordsTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.StopwordsTokenFilter' # type: str - self.stopwords = kwargs.get('stopwords', None) - self.stopwords_list = kwargs.get('stopwords_list', None) - self.ignore_case = kwargs.get('ignore_case', False) - self.remove_trailing_stop_words = kwargs.get('remove_trailing_stop_words', True) - - -class Suggester(msrest.serialization.Model): - """Defines how the Suggest API should apply to a group of fields in the index. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the suggester. - :type name: str - :ivar search_mode: Required. A value indicating the capabilities of the suggester. Default - value: "analyzingInfixMatching". - :vartype search_mode: str - :param source_fields: Required. The list of field names to which the suggester applies. Each - field must be searchable. - :type source_fields: list[str] - """ - - _validation = { - 'name': {'required': True}, - 'search_mode': {'required': True, 'constant': True}, - 'source_fields': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'search_mode': {'key': 'searchMode', 'type': 'str'}, - 'source_fields': {'key': 'sourceFields', 'type': '[str]'}, - } - - search_mode = "analyzingInfixMatching" - - def __init__( - self, - **kwargs - ): - super(Suggester, self).__init__(**kwargs) - self.name = kwargs['name'] - self.source_fields = kwargs['source_fields'] - - -class SynonymMap(msrest.serialization.Model): - """Represents a synonym map definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the synonym map. - :type name: str - :ivar format: Required. The format of the synonym map. Only the 'solr' format is currently - supported. Default value: "solr". - :vartype format: str - :param synonyms: Required. A series of synonym rules in the specified synonym map format. The - rules must be separated by newlines. - :type synonyms: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your data when you - want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive - Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive - Search will ignore attempts to set this property to null. You can change this property as - needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with - customer-managed keys is not available for free search services, and is only available for paid - services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - :param e_tag: The ETag of the synonym map. - :type e_tag: str - """ - - _validation = { - 'name': {'required': True}, - 'format': {'required': True, 'constant': True}, - 'synonyms': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'format': {'key': 'format', 'type': 'str'}, - 'synonyms': {'key': 'synonyms', 'type': 'str'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - } - - format = "solr" - - def __init__( - self, - **kwargs - ): - super(SynonymMap, self).__init__(**kwargs) - self.name = kwargs['name'] - self.synonyms = kwargs['synonyms'] - self.encryption_key = kwargs.get('encryption_key', None) - self.e_tag = kwargs.get('e_tag', None) - - -class SynonymTokenFilter(TokenFilter): - """Matches single or multi-word synonyms in a token stream. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param synonyms: Required. A list of synonyms in following one of two formats: 1. incredible, - unbelievable, fabulous => amazing - all terms on the left side of => symbol will be replaced - with all terms on its right side; 2. incredible, unbelievable, fabulous, amazing - comma - separated list of equivalent words. Set the expand option to change how this list is - interpreted. - :type synonyms: list[str] - :param ignore_case: A value indicating whether to case-fold input for matching. Default is - false. - :type ignore_case: bool - :param expand: A value indicating whether all words in the list of synonyms (if => notation is - not used) will map to one another. If true, all words in the list of synonyms (if => notation - is not used) will map to one another. The following list: incredible, unbelievable, fabulous, - amazing is equivalent to: incredible, unbelievable, fabulous, amazing => incredible, - unbelievable, fabulous, amazing. If false, the following list: incredible, unbelievable, - fabulous, amazing will be equivalent to: incredible, unbelievable, fabulous, amazing => - incredible. Default is true. - :type expand: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'synonyms': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'synonyms': {'key': 'synonyms', 'type': '[str]'}, - 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, - 'expand': {'key': 'expand', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(SynonymTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.SynonymTokenFilter' # type: str - self.synonyms = kwargs['synonyms'] - self.ignore_case = kwargs.get('ignore_case', False) - self.expand = kwargs.get('expand', True) - - -class TagScoringFunction(ScoringFunction): - """Defines a function that boosts scores of documents with string values matching a given list of tags. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the tag scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.TagScoringParameters - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - 'parameters': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - 'parameters': {'key': 'tag', 'type': 'TagScoringParameters'}, - } - - def __init__( - self, - **kwargs - ): - super(TagScoringFunction, self).__init__(**kwargs) - self.type = 'tag' # type: str - self.parameters = kwargs['parameters'] - - -class TagScoringParameters(msrest.serialization.Model): - """Provides parameter values to a tag scoring function. - - All required parameters must be populated in order to send to Azure. - - :param tags_parameter: Required. The name of the parameter passed in search queries to specify - the list of tags to compare against the target field. - :type tags_parameter: str - """ - - _validation = { - 'tags_parameter': {'required': True}, - } - - _attribute_map = { - 'tags_parameter': {'key': 'tagsParameter', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TagScoringParameters, self).__init__(**kwargs) - self.tags_parameter = kwargs['tags_parameter'] - - -class TextTranslationSkill(SearchIndexerSkill): - """A skill to translate text from one language to another. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_to_language_code: Required. The language code to translate documents into for - documents that don't specify the to language explicitly. Possible values include: "af", "ar", - "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", - "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", - "tlh", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "otq", "ro", "ru", "sm", - "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", - "vi", "cy", "yua". - :type default_to_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.TextTranslationSkillLanguage - :param default_from_language_code: The language code to translate documents from for documents - that don't specify the from language explicitly. Possible values include: "af", "ar", "bn", - "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", - "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", - "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "otq", "ro", "ru", "sm", "sr-Cyrl", - "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", - "yua". - :type default_from_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.TextTranslationSkillLanguage - :param suggested_from: The language code to translate documents from when neither the - fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the - automatic language detection is unsuccessful. Default is en. Possible values include: "af", - "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", - "fj", "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", - "sw", "tlh", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "otq", "ro", "ru", - "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", - "ur", "vi", "cy", "yua". - :type suggested_from: str or - ~azure.search.documents.indexes.v2020_06.models.TextTranslationSkillLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - 'default_to_language_code': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_to_language_code': {'key': 'defaultToLanguageCode', 'type': 'str'}, - 'default_from_language_code': {'key': 'defaultFromLanguageCode', 'type': 'str'}, - 'suggested_from': {'key': 'suggestedFrom', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TextTranslationSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Text.TranslationSkill' # type: str - self.default_to_language_code = kwargs['default_to_language_code'] - self.default_from_language_code = kwargs.get('default_from_language_code', None) - self.suggested_from = kwargs.get('suggested_from', None) - - -class TextWeights(msrest.serialization.Model): - """Defines weights on index fields for which matches should boost scoring in search queries. - - All required parameters must be populated in order to send to Azure. - - :param weights: Required. The dictionary of per-field weights to boost document scoring. The - keys are field names and the values are the weights for each field. - :type weights: dict[str, float] - """ - - _validation = { - 'weights': {'required': True}, - } - - _attribute_map = { - 'weights': {'key': 'weights', 'type': '{float}'}, - } - - def __init__( - self, - **kwargs - ): - super(TextWeights, self).__init__(**kwargs) - self.weights = kwargs['weights'] - - -class TruncateTokenFilter(TokenFilter): - """Truncates the terms to a specific length. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param length: The length at which terms will be truncated. Default and maximum is 300. - :type length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'length': {'key': 'length', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(TruncateTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.TruncateTokenFilter' # type: str - self.length = kwargs.get('length', 300) - - -class UaxUrlEmailTokenizer(LexicalTokenizer): - """Tokenizes urls and emails as one token. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(UaxUrlEmailTokenizer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.UaxUrlEmailTokenizer' # type: str - self.max_token_length = kwargs.get('max_token_length', 255) - - -class UniqueTokenFilter(TokenFilter): - """Filters out tokens with same text as the previous token. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param only_on_same_position: A value indicating whether to remove duplicates only at the same - position. Default is false. - :type only_on_same_position: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'only_on_same_position': {'key': 'onlyOnSamePosition', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(UniqueTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.UniqueTokenFilter' # type: str - self.only_on_same_position = kwargs.get('only_on_same_position', False) - - -class WebApiSkill(SearchIndexerSkill): - """A skill that can call a Web API endpoint, allowing you to extend a skillset by having it call your custom code. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param uri: Required. The url for the Web API. - :type uri: str - :param http_headers: The headers required to make the http request. - :type http_headers: dict[str, str] - :param http_method: The method for the http request. - :type http_method: str - :param timeout: The desired timeout for the request. Default is 30 seconds. - :type timeout: ~datetime.timedelta - :param batch_size: The desired batch size which indicates number of documents. - :type batch_size: int - :param degree_of_parallelism: If set, the number of parallel calls that can be made to the Web - API. - :type degree_of_parallelism: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'http_headers': {'key': 'httpHeaders', 'type': '{str}'}, - 'http_method': {'key': 'httpMethod', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'degree_of_parallelism': {'key': 'degreeOfParallelism', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(WebApiSkill, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Skills.Custom.WebApiSkill' # type: str - self.uri = kwargs['uri'] - self.http_headers = kwargs.get('http_headers', None) - self.http_method = kwargs.get('http_method', None) - self.timeout = kwargs.get('timeout', None) - self.batch_size = kwargs.get('batch_size', None) - self.degree_of_parallelism = kwargs.get('degree_of_parallelism', None) - - -class WordDelimiterTokenFilter(TokenFilter): - """Splits words into subwords and performs optional transformations on subword groups. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param generate_word_parts: A value indicating whether to generate part words. If set, causes - parts of words to be generated; for example "AzureSearch" becomes "Azure" "Search". Default is - true. - :type generate_word_parts: bool - :param generate_number_parts: A value indicating whether to generate number subwords. Default - is true. - :type generate_number_parts: bool - :param catenate_words: A value indicating whether maximum runs of word parts will be catenated. - For example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default is false. - :type catenate_words: bool - :param catenate_numbers: A value indicating whether maximum runs of number parts will be - catenated. For example, if this is set to true, "1-2" becomes "12". Default is false. - :type catenate_numbers: bool - :param catenate_all: A value indicating whether all subword parts will be catenated. For - example, if this is set to true, "Azure-Search-1" becomes "AzureSearch1". Default is false. - :type catenate_all: bool - :param split_on_case_change: A value indicating whether to split words on caseChange. For - example, if this is set to true, "AzureSearch" becomes "Azure" "Search". Default is true. - :type split_on_case_change: bool - :param preserve_original: A value indicating whether original words will be preserved and added - to the subword list. Default is false. - :type preserve_original: bool - :param split_on_numerics: A value indicating whether to split on numbers. For example, if this - is set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. - :type split_on_numerics: bool - :param stem_english_possessive: A value indicating whether to remove trailing "'s" for each - subword. Default is true. - :type stem_english_possessive: bool - :param protected_words: A list of tokens to protect from being delimited. - :type protected_words: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'generate_word_parts': {'key': 'generateWordParts', 'type': 'bool'}, - 'generate_number_parts': {'key': 'generateNumberParts', 'type': 'bool'}, - 'catenate_words': {'key': 'catenateWords', 'type': 'bool'}, - 'catenate_numbers': {'key': 'catenateNumbers', 'type': 'bool'}, - 'catenate_all': {'key': 'catenateAll', 'type': 'bool'}, - 'split_on_case_change': {'key': 'splitOnCaseChange', 'type': 'bool'}, - 'preserve_original': {'key': 'preserveOriginal', 'type': 'bool'}, - 'split_on_numerics': {'key': 'splitOnNumerics', 'type': 'bool'}, - 'stem_english_possessive': {'key': 'stemEnglishPossessive', 'type': 'bool'}, - 'protected_words': {'key': 'protectedWords', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(WordDelimiterTokenFilter, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.WordDelimiterTokenFilter' # type: str - self.generate_word_parts = kwargs.get('generate_word_parts', True) - self.generate_number_parts = kwargs.get('generate_number_parts', True) - self.catenate_words = kwargs.get('catenate_words', False) - self.catenate_numbers = kwargs.get('catenate_numbers', False) - self.catenate_all = kwargs.get('catenate_all', False) - self.split_on_case_change = kwargs.get('split_on_case_change', True) - self.preserve_original = kwargs.get('preserve_original', False) - self.split_on_numerics = kwargs.get('split_on_numerics', True) - self.stem_english_possessive = kwargs.get('stem_english_possessive', True) - self.protected_words = kwargs.get('protected_words', None) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_models_py3.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_models_py3.py deleted file mode 100644 index f86664a02a1d..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_models_py3.py +++ /dev/null @@ -1,6343 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._search_client_enums import * - - -class AnalyzedTokenInfo(msrest.serialization.Model): - """Information about a token returned by an analyzer. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar token: Required. The token returned by the analyzer. - :vartype token: str - :ivar start_offset: Required. The index of the first character of the token in the input text. - :vartype start_offset: int - :ivar end_offset: Required. The index of the last character of the token in the input text. - :vartype end_offset: int - :ivar position: Required. The position of the token in the input text relative to other tokens. - The first token in the input text has position 0, the next has position 1, and so on. Depending - on the analyzer used, some tokens might have the same position, for example if they are - synonyms of each other. - :vartype position: int - """ - - _validation = { - 'token': {'required': True, 'readonly': True}, - 'start_offset': {'required': True, 'readonly': True}, - 'end_offset': {'required': True, 'readonly': True}, - 'position': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'token': {'key': 'token', 'type': 'str'}, - 'start_offset': {'key': 'startOffset', 'type': 'int'}, - 'end_offset': {'key': 'endOffset', 'type': 'int'}, - 'position': {'key': 'position', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(AnalyzedTokenInfo, self).__init__(**kwargs) - self.token = None - self.start_offset = None - self.end_offset = None - self.position = None - - -class AnalyzeRequest(msrest.serialization.Model): - """Specifies some text and analysis components used to break that text into tokens. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. The text to break into tokens. - :type text: str - :param analyzer: The name of the analyzer to use to break the given text. If this parameter is - not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters are - mutually exclusive. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", - "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- - Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", - "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", - "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", - "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", - "gu.microsoft", "he.microsoft", "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", - "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", - "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", - "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", - "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- - PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", - "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", - "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", - "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", - "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", - "simple", "stop", "whitespace". - :type analyzer: str or ~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzerName - :param tokenizer: The name of the tokenizer to use to break the given text. If this parameter - is not specified, you must specify an analyzer instead. The tokenizer and analyzer parameters - are mutually exclusive. Possible values include: "classic", "edgeNGram", "keyword_v2", - "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", - "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or ~azure.search.documents.indexes.v2020_06.models.LexicalTokenizerName - :param token_filters: An optional list of token filters to use when breaking the given text. - This parameter can only be set when using the tokenizer parameter. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06.models.TokenFilterName] - :param char_filters: An optional list of character filters to use when breaking the given text. - This parameter can only be set when using the tokenizer parameter. - :type char_filters: list[str or ~azure.search.documents.indexes.v2020_06.models.CharFilterName] - """ - - _validation = { - 'text': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'analyzer': {'key': 'analyzer', 'type': 'str'}, - 'tokenizer': {'key': 'tokenizer', 'type': 'str'}, - 'token_filters': {'key': 'tokenFilters', 'type': '[str]'}, - 'char_filters': {'key': 'charFilters', 'type': '[str]'}, - } - - def __init__( - self, - *, - text: str, - analyzer: Optional[Union[str, "LexicalAnalyzerName"]] = None, - tokenizer: Optional[Union[str, "LexicalTokenizerName"]] = None, - token_filters: Optional[List[Union[str, "TokenFilterName"]]] = None, - char_filters: Optional[List[Union[str, "CharFilterName"]]] = None, - **kwargs - ): - super(AnalyzeRequest, self).__init__(**kwargs) - self.text = text - self.analyzer = analyzer - self.tokenizer = tokenizer - self.token_filters = token_filters - self.char_filters = char_filters - - -class AnalyzeResult(msrest.serialization.Model): - """The result of testing an analyzer on text. - - All required parameters must be populated in order to send to Azure. - - :param tokens: Required. The list of tokens returned by the analyzer specified in the request. - :type tokens: list[~azure.search.documents.indexes.v2020_06.models.AnalyzedTokenInfo] - """ - - _validation = { - 'tokens': {'required': True}, - } - - _attribute_map = { - 'tokens': {'key': 'tokens', 'type': '[AnalyzedTokenInfo]'}, - } - - def __init__( - self, - *, - tokens: List["AnalyzedTokenInfo"], - **kwargs - ): - super(AnalyzeResult, self).__init__(**kwargs) - self.tokens = tokens - - -class TokenFilter(msrest.serialization.Model): - """Base type for token filters. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AsciiFoldingTokenFilter, CjkBigramTokenFilter, CommonGramTokenFilter, DictionaryDecompounderTokenFilter, EdgeNGramTokenFilter, EdgeNGramTokenFilterV2, ElisionTokenFilter, KeepTokenFilter, KeywordMarkerTokenFilter, LengthTokenFilter, LimitTokenFilter, NGramTokenFilter, NGramTokenFilterV2, PatternCaptureTokenFilter, PatternReplaceTokenFilter, PhoneticTokenFilter, ShingleTokenFilter, SnowballTokenFilter, StemmerOverrideTokenFilter, StemmerTokenFilter, StopwordsTokenFilter, SynonymTokenFilter, TruncateTokenFilter, UniqueTokenFilter, WordDelimiterTokenFilter. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.AsciiFoldingTokenFilter': 'AsciiFoldingTokenFilter', '#Microsoft.Azure.Search.CjkBigramTokenFilter': 'CjkBigramTokenFilter', '#Microsoft.Azure.Search.CommonGramTokenFilter': 'CommonGramTokenFilter', '#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter': 'DictionaryDecompounderTokenFilter', '#Microsoft.Azure.Search.EdgeNGramTokenFilter': 'EdgeNGramTokenFilter', '#Microsoft.Azure.Search.EdgeNGramTokenFilterV2': 'EdgeNGramTokenFilterV2', '#Microsoft.Azure.Search.ElisionTokenFilter': 'ElisionTokenFilter', '#Microsoft.Azure.Search.KeepTokenFilter': 'KeepTokenFilter', '#Microsoft.Azure.Search.KeywordMarkerTokenFilter': 'KeywordMarkerTokenFilter', '#Microsoft.Azure.Search.LengthTokenFilter': 'LengthTokenFilter', '#Microsoft.Azure.Search.LimitTokenFilter': 'LimitTokenFilter', '#Microsoft.Azure.Search.NGramTokenFilter': 'NGramTokenFilter', '#Microsoft.Azure.Search.NGramTokenFilterV2': 'NGramTokenFilterV2', '#Microsoft.Azure.Search.PatternCaptureTokenFilter': 'PatternCaptureTokenFilter', '#Microsoft.Azure.Search.PatternReplaceTokenFilter': 'PatternReplaceTokenFilter', '#Microsoft.Azure.Search.PhoneticTokenFilter': 'PhoneticTokenFilter', '#Microsoft.Azure.Search.ShingleTokenFilter': 'ShingleTokenFilter', '#Microsoft.Azure.Search.SnowballTokenFilter': 'SnowballTokenFilter', '#Microsoft.Azure.Search.StemmerOverrideTokenFilter': 'StemmerOverrideTokenFilter', '#Microsoft.Azure.Search.StemmerTokenFilter': 'StemmerTokenFilter', '#Microsoft.Azure.Search.StopwordsTokenFilter': 'StopwordsTokenFilter', '#Microsoft.Azure.Search.SynonymTokenFilter': 'SynonymTokenFilter', '#Microsoft.Azure.Search.TruncateTokenFilter': 'TruncateTokenFilter', '#Microsoft.Azure.Search.UniqueTokenFilter': 'UniqueTokenFilter', '#Microsoft.Azure.Search.WordDelimiterTokenFilter': 'WordDelimiterTokenFilter'} - } - - def __init__( - self, - *, - name: str, - **kwargs - ): - super(TokenFilter, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = name - - -class AsciiFoldingTokenFilter(TokenFilter): - """Converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 ASCII characters (the "Basic Latin" Unicode block) into their ASCII equivalents, if such equivalents exist. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param preserve_original: A value indicating whether the original token will be kept. Default - is false. - :type preserve_original: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'preserve_original': {'key': 'preserveOriginal', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - preserve_original: Optional[bool] = False, - **kwargs - ): - super(AsciiFoldingTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.AsciiFoldingTokenFilter' # type: str - self.preserve_original = preserve_original - - -class AzureActiveDirectoryApplicationCredentials(msrest.serialization.Model): - """Credentials of a registered application created for your search service, used for authenticated access to the encryption keys stored in Azure Key Vault. - - All required parameters must be populated in order to send to Azure. - - :param application_id: Required. An AAD Application ID that was granted the required access - permissions to the Azure Key Vault that is to be used when encrypting your data at rest. The - Application ID should not be confused with the Object ID for your AAD Application. - :type application_id: str - :param application_secret: The authentication key of the specified AAD application. - :type application_secret: str - """ - - _validation = { - 'application_id': {'required': True}, - } - - _attribute_map = { - 'application_id': {'key': 'applicationId', 'type': 'str'}, - 'application_secret': {'key': 'applicationSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - application_id: str, - application_secret: Optional[str] = None, - **kwargs - ): - super(AzureActiveDirectoryApplicationCredentials, self).__init__(**kwargs) - self.application_id = application_id - self.application_secret = application_secret - - -class Similarity(msrest.serialization.Model): - """Base type for similarity algorithms. Similarity algorithms are used to calculate scores that tie queries to documents. The higher the score, the more relevant the document is to that specific query. Those scores are used to rank the search results. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: BM25Similarity, ClassicSimilarity. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.BM25Similarity': 'BM25Similarity', '#Microsoft.Azure.Search.ClassicSimilarity': 'ClassicSimilarity'} - } - - def __init__( - self, - **kwargs - ): - super(Similarity, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class BM25Similarity(Similarity): - """Ranking function based on the Okapi BM25 similarity algorithm. BM25 is a TF-IDF-like algorithm that includes length normalization (controlled by the 'b' parameter) as well as term frequency saturation (controlled by the 'k1' parameter). - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Constant filled by server. - :type odata_type: str - :param k1: This property controls the scaling function between the term frequency of each - matching terms and the final relevance score of a document-query pair. By default, a value of - 1.2 is used. A value of 0.0 means the score does not scale with an increase in term frequency. - :type k1: float - :param b: This property controls how the length of a document affects the relevance score. By - default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, - while a value of 1.0 means the score is fully normalized by the length of the document. - :type b: float - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'k1': {'key': 'k1', 'type': 'float'}, - 'b': {'key': 'b', 'type': 'float'}, - } - - def __init__( - self, - *, - k1: Optional[float] = None, - b: Optional[float] = None, - **kwargs - ): - super(BM25Similarity, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.BM25Similarity' # type: str - self.k1 = k1 - self.b = b - - -class CharFilter(msrest.serialization.Model): - """Base type for character filters. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: MappingCharFilter, PatternReplaceCharFilter. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.MappingCharFilter': 'MappingCharFilter', '#Microsoft.Azure.Search.PatternReplaceCharFilter': 'PatternReplaceCharFilter'} - } - - def __init__( - self, - *, - name: str, - **kwargs - ): - super(CharFilter, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = name - - -class CjkBigramTokenFilter(TokenFilter): - """Forms bigrams of CJK terms that are generated from the standard tokenizer. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param ignore_scripts: The scripts to ignore. - :type ignore_scripts: list[str or - ~azure.search.documents.indexes.v2020_06.models.CjkBigramTokenFilterScripts] - :param output_unigrams: A value indicating whether to output both unigrams and bigrams (if - true), or just bigrams (if false). Default is false. - :type output_unigrams: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'ignore_scripts': {'key': 'ignoreScripts', 'type': '[str]'}, - 'output_unigrams': {'key': 'outputUnigrams', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - ignore_scripts: Optional[List[Union[str, "CjkBigramTokenFilterScripts"]]] = None, - output_unigrams: Optional[bool] = False, - **kwargs - ): - super(CjkBigramTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.CjkBigramTokenFilter' # type: str - self.ignore_scripts = ignore_scripts - self.output_unigrams = output_unigrams - - -class ClassicSimilarity(Similarity): - """Legacy similarity algorithm which uses the Lucene TFIDFSimilarity implementation of TF-IDF. This variation of TF-IDF introduces static document length normalization as well as coordinating factors that penalize documents that only partially match the searched queries. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ClassicSimilarity, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.ClassicSimilarity' # type: str - - -class LexicalTokenizer(msrest.serialization.Model): - """Base type for tokenizers. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ClassicTokenizer, EdgeNGramTokenizer, KeywordTokenizer, KeywordTokenizerV2, MicrosoftLanguageStemmingTokenizer, MicrosoftLanguageTokenizer, NGramTokenizer, PathHierarchyTokenizerV2, PatternTokenizer, LuceneStandardTokenizer, LuceneStandardTokenizerV2, UaxUrlEmailTokenizer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.ClassicTokenizer': 'ClassicTokenizer', '#Microsoft.Azure.Search.EdgeNGramTokenizer': 'EdgeNGramTokenizer', '#Microsoft.Azure.Search.KeywordTokenizer': 'KeywordTokenizer', '#Microsoft.Azure.Search.KeywordTokenizerV2': 'KeywordTokenizerV2', '#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer': 'MicrosoftLanguageStemmingTokenizer', '#Microsoft.Azure.Search.MicrosoftLanguageTokenizer': 'MicrosoftLanguageTokenizer', '#Microsoft.Azure.Search.NGramTokenizer': 'NGramTokenizer', '#Microsoft.Azure.Search.PathHierarchyTokenizerV2': 'PathHierarchyTokenizerV2', '#Microsoft.Azure.Search.PatternTokenizer': 'PatternTokenizer', '#Microsoft.Azure.Search.StandardTokenizer': 'LuceneStandardTokenizer', '#Microsoft.Azure.Search.StandardTokenizerV2': 'LuceneStandardTokenizerV2', '#Microsoft.Azure.Search.UaxUrlEmailTokenizer': 'UaxUrlEmailTokenizer'} - } - - def __init__( - self, - *, - name: str, - **kwargs - ): - super(LexicalTokenizer, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = name - - -class ClassicTokenizer(LexicalTokenizer): - """Grammar-based tokenizer that is suitable for processing most European-language documents. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - max_token_length: Optional[int] = 255, - **kwargs - ): - super(ClassicTokenizer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.ClassicTokenizer' # type: str - self.max_token_length = max_token_length - - -class CognitiveServicesAccount(msrest.serialization.Model): - """Base type for describing any cognitive service resource attached to a skillset. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CognitiveServicesAccountKey, DefaultCognitiveServicesAccount. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the cognitive service resource - attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.CognitiveServicesByKey': 'CognitiveServicesAccountKey', '#Microsoft.Azure.Search.DefaultCognitiveServices': 'DefaultCognitiveServicesAccount'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - super(CognitiveServicesAccount, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.description = description - - -class CognitiveServicesAccountKey(CognitiveServicesAccount): - """A cognitive service resource provisioned with a key that is attached to a skillset. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the cognitive service resource - attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str - :param key: Required. The key used to provision the cognitive service resource attached to a - skillset. - :type key: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'key': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - key: str, - description: Optional[str] = None, - **kwargs - ): - super(CognitiveServicesAccountKey, self).__init__(description=description, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.CognitiveServicesByKey' # type: str - self.key = key - - -class CommonGramTokenFilter(TokenFilter): - """Construct bigrams for frequently occurring terms while indexing. Single terms are still indexed too, with bigrams overlaid. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param common_words: Required. The set of common words. - :type common_words: list[str] - :param ignore_case: A value indicating whether common words matching will be case insensitive. - Default is false. - :type ignore_case: bool - :param use_query_mode: A value that indicates whether the token filter is in query mode. When - in query mode, the token filter generates bigrams and then removes common words and single - terms followed by a common word. Default is false. - :type use_query_mode: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'common_words': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'common_words': {'key': 'commonWords', 'type': '[str]'}, - 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, - 'use_query_mode': {'key': 'queryMode', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - common_words: List[str], - ignore_case: Optional[bool] = False, - use_query_mode: Optional[bool] = False, - **kwargs - ): - super(CommonGramTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.CommonGramTokenFilter' # type: str - self.common_words = common_words - self.ignore_case = ignore_case - self.use_query_mode = use_query_mode - - -class SearchIndexerSkill(msrest.serialization.Model): - """Base type for skills. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: WebApiSkill, CustomEntityLookupSkill, EntityRecognitionSkill, KeyPhraseExtractionSkill, LanguageDetectionSkill, MergeSkill, SentimentSkill, SplitSkill, TextTranslationSkill, ConditionalSkill, DocumentExtractionSkill, ShaperSkill, ImageAnalysisSkill, OcrSkill. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Skills.Custom.WebApiSkill': 'WebApiSkill', '#Microsoft.Skills.Text.CustomEntityLookupSkill': 'CustomEntityLookupSkill', '#Microsoft.Skills.Text.EntityRecognitionSkill': 'EntityRecognitionSkill', '#Microsoft.Skills.Text.KeyPhraseExtractionSkill': 'KeyPhraseExtractionSkill', '#Microsoft.Skills.Text.LanguageDetectionSkill': 'LanguageDetectionSkill', '#Microsoft.Skills.Text.MergeSkill': 'MergeSkill', '#Microsoft.Skills.Text.SentimentSkill': 'SentimentSkill', '#Microsoft.Skills.Text.SplitSkill': 'SplitSkill', '#Microsoft.Skills.Text.TranslationSkill': 'TextTranslationSkill', '#Microsoft.Skills.Util.ConditionalSkill': 'ConditionalSkill', '#Microsoft.Skills.Util.DocumentExtractionSkill': 'DocumentExtractionSkill', '#Microsoft.Skills.Util.ShaperSkill': 'ShaperSkill', '#Microsoft.Skills.Vision.ImageAnalysisSkill': 'ImageAnalysisSkill', '#Microsoft.Skills.Vision.OcrSkill': 'OcrSkill'} - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - **kwargs - ): - super(SearchIndexerSkill, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = name - self.description = description - self.context = context - self.inputs = inputs - self.outputs = outputs - - -class ConditionalSkill(SearchIndexerSkill): - """A skill that enables scenarios that require a Boolean operation to determine the data to assign to an output. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - **kwargs - ): - super(ConditionalSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Util.ConditionalSkill' # type: str - - -class CorsOptions(msrest.serialization.Model): - """Defines options to control Cross-Origin Resource Sharing (CORS) for an index. - - All required parameters must be populated in order to send to Azure. - - :param allowed_origins: Required. The list of origins from which JavaScript code will be - granted access to your index. Can contain a list of hosts of the form {protocol}://{fully- - qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not recommended). - :type allowed_origins: list[str] - :param max_age_in_seconds: The duration for which browsers should cache CORS preflight - responses. Defaults to 5 minutes. - :type max_age_in_seconds: long - """ - - _validation = { - 'allowed_origins': {'required': True}, - } - - _attribute_map = { - 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, - 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'long'}, - } - - def __init__( - self, - *, - allowed_origins: List[str], - max_age_in_seconds: Optional[int] = None, - **kwargs - ): - super(CorsOptions, self).__init__(**kwargs) - self.allowed_origins = allowed_origins - self.max_age_in_seconds = max_age_in_seconds - - -class LexicalAnalyzer(msrest.serialization.Model): - """Base type for analyzers. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: CustomAnalyzer, PatternAnalyzer, LuceneStandardAnalyzer, StopAnalyzer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.CustomAnalyzer': 'CustomAnalyzer', '#Microsoft.Azure.Search.PatternAnalyzer': 'PatternAnalyzer', '#Microsoft.Azure.Search.StandardAnalyzer': 'LuceneStandardAnalyzer', '#Microsoft.Azure.Search.StopAnalyzer': 'StopAnalyzer'} - } - - def __init__( - self, - *, - name: str, - **kwargs - ): - super(LexicalAnalyzer, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.name = name - - -class CustomAnalyzer(LexicalAnalyzer): - """Allows you to take control over the process of converting text into indexable/searchable tokens. It's a user-defined configuration consisting of a single predefined tokenizer and one or more filters. The tokenizer is responsible for breaking text into tokens, and the filters for modifying tokens emitted by the tokenizer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param tokenizer: Required. The name of the tokenizer to use to divide continuous text into a - sequence of tokens, such as breaking a sentence into words. Possible values include: "classic", - "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", - "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", - "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or ~azure.search.documents.indexes.v2020_06.models.LexicalTokenizerName - :param token_filters: A list of token filters used to filter out or modify the tokens generated - by a tokenizer. For example, you can specify a lowercase filter that converts all characters to - lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or - ~azure.search.documents.indexes.v2020_06.models.TokenFilterName] - :param char_filters: A list of character filters used to prepare input text before it is - processed by the tokenizer. For instance, they can replace certain characters or symbols. The - filters are run in the order in which they are listed. - :type char_filters: list[str or ~azure.search.documents.indexes.v2020_06.models.CharFilterName] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'tokenizer': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'tokenizer': {'key': 'tokenizer', 'type': 'str'}, - 'token_filters': {'key': 'tokenFilters', 'type': '[str]'}, - 'char_filters': {'key': 'charFilters', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - tokenizer: Union[str, "LexicalTokenizerName"], - token_filters: Optional[List[Union[str, "TokenFilterName"]]] = None, - char_filters: Optional[List[Union[str, "CharFilterName"]]] = None, - **kwargs - ): - super(CustomAnalyzer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.CustomAnalyzer' # type: str - self.tokenizer = tokenizer - self.token_filters = token_filters - self.char_filters = char_filters - - -class CustomEntity(msrest.serialization.Model): - """An object that contains information about the matches that were found, and related metadata. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The top-level entity descriptor. Matches in the skill output will be - grouped by this name, and it should represent the "normalized" form of the text being found. - :type name: str - :param description: This field can be used as a passthrough for custom metadata about the - matched text(s). The value of this field will appear with every match of its entity in the - skill output. - :type description: str - :param type: This field can be used as a passthrough for custom metadata about the matched - text(s). The value of this field will appear with every match of its entity in the skill - output. - :type type: str - :param subtype: This field can be used as a passthrough for custom metadata about the matched - text(s). The value of this field will appear with every match of its entity in the skill - output. - :type subtype: str - :param id: This field can be used as a passthrough for custom metadata about the matched - text(s). The value of this field will appear with every match of its entity in the skill - output. - :type id: str - :param case_sensitive: Defaults to false. Boolean value denoting whether comparisons with the - entity name should be sensitive to character casing. Sample case insensitive matches of - "Microsoft" could be: microsoft, microSoft, MICROSOFT. - :type case_sensitive: bool - :param accent_sensitive: Defaults to false. Boolean value denoting whether comparisons with the - entity name should be sensitive to accent. - :type accent_sensitive: bool - :param fuzzy_edit_distance: Defaults to 0. Maximum value of 5. Denotes the acceptable number of - divergent characters that would still constitute a match with the entity name. The smallest - possible fuzziness for any given match is returned. For instance, if the edit distance is set - to 3, "Windows10" would still match "Windows", "Windows10" and "Windows 7". When case - sensitivity is set to false, case differences do NOT count towards fuzziness tolerance, but - otherwise do. - :type fuzzy_edit_distance: int - :param default_case_sensitive: Changes the default case sensitivity value for this entity. It - be used to change the default value of all aliases caseSensitive values. - :type default_case_sensitive: bool - :param default_accent_sensitive: Changes the default accent sensitivity value for this entity. - It be used to change the default value of all aliases accentSensitive values. - :type default_accent_sensitive: bool - :param default_fuzzy_edit_distance: Changes the default fuzzy edit distance value for this - entity. It can be used to change the default value of all aliases fuzzyEditDistance values. - :type default_fuzzy_edit_distance: int - :param aliases: An array of complex objects that can be used to specify alternative spellings - or synonyms to the root entity name. - :type aliases: list[~azure.search.documents.indexes.v2020_06.models.CustomEntityAlias] - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'subtype': {'key': 'subtype', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'case_sensitive': {'key': 'caseSensitive', 'type': 'bool'}, - 'accent_sensitive': {'key': 'accentSensitive', 'type': 'bool'}, - 'fuzzy_edit_distance': {'key': 'fuzzyEditDistance', 'type': 'int'}, - 'default_case_sensitive': {'key': 'defaultCaseSensitive', 'type': 'bool'}, - 'default_accent_sensitive': {'key': 'defaultAccentSensitive', 'type': 'bool'}, - 'default_fuzzy_edit_distance': {'key': 'defaultFuzzyEditDistance', 'type': 'int'}, - 'aliases': {'key': 'aliases', 'type': '[CustomEntityAlias]'}, - } - - def __init__( - self, - *, - name: str, - description: Optional[str] = None, - type: Optional[str] = None, - subtype: Optional[str] = None, - id: Optional[str] = None, - case_sensitive: Optional[bool] = None, - accent_sensitive: Optional[bool] = None, - fuzzy_edit_distance: Optional[int] = None, - default_case_sensitive: Optional[bool] = None, - default_accent_sensitive: Optional[bool] = None, - default_fuzzy_edit_distance: Optional[int] = None, - aliases: Optional[List["CustomEntityAlias"]] = None, - **kwargs - ): - super(CustomEntity, self).__init__(**kwargs) - self.name = name - self.description = description - self.type = type - self.subtype = subtype - self.id = id - self.case_sensitive = case_sensitive - self.accent_sensitive = accent_sensitive - self.fuzzy_edit_distance = fuzzy_edit_distance - self.default_case_sensitive = default_case_sensitive - self.default_accent_sensitive = default_accent_sensitive - self.default_fuzzy_edit_distance = default_fuzzy_edit_distance - self.aliases = aliases - - -class CustomEntityAlias(msrest.serialization.Model): - """A complex object that can be used to specify alternative spellings or synonyms to the root entity name. - - All required parameters must be populated in order to send to Azure. - - :param text: Required. The text of the alias. - :type text: str - :param case_sensitive: Determine if the alias is case sensitive. - :type case_sensitive: bool - :param accent_sensitive: Determine if the alias is accent sensitive. - :type accent_sensitive: bool - :param fuzzy_edit_distance: Determine the fuzzy edit distance of the alias. - :type fuzzy_edit_distance: int - """ - - _validation = { - 'text': {'required': True}, - } - - _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'case_sensitive': {'key': 'caseSensitive', 'type': 'bool'}, - 'accent_sensitive': {'key': 'accentSensitive', 'type': 'bool'}, - 'fuzzy_edit_distance': {'key': 'fuzzyEditDistance', 'type': 'int'}, - } - - def __init__( - self, - *, - text: str, - case_sensitive: Optional[bool] = None, - accent_sensitive: Optional[bool] = None, - fuzzy_edit_distance: Optional[int] = None, - **kwargs - ): - super(CustomEntityAlias, self).__init__(**kwargs) - self.text = text - self.case_sensitive = case_sensitive - self.accent_sensitive = accent_sensitive - self.fuzzy_edit_distance = fuzzy_edit_distance - - -class CustomEntityLookupSkill(SearchIndexerSkill): - """A skill looks for text from a custom, user-defined list of words and phrases. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.CustomEntityLookupSkillLanguage - :param entities_definition_uri: Path to a JSON or CSV file containing all the target text to - match against. This entity definition is read at the beginning of an indexer run. Any updates - to this file during an indexer run will not take effect until subsequent runs. This config must - be accessible over HTTPS. - :type entities_definition_uri: str - :param inline_entities_definition: The inline CustomEntity definition. - :type inline_entities_definition: - list[~azure.search.documents.indexes.v2020_06.models.CustomEntity] - :param global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is not - set in CustomEntity, this value will be the default value. - :type global_default_case_sensitive: bool - :param global_default_accent_sensitive: A global flag for AccentSensitive. If AccentSensitive - is not set in CustomEntity, this value will be the default value. - :type global_default_accent_sensitive: bool - :param global_default_fuzzy_edit_distance: A global flag for FuzzyEditDistance. If - FuzzyEditDistance is not set in CustomEntity, this value will be the default value. - :type global_default_fuzzy_edit_distance: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'entities_definition_uri': {'key': 'entitiesDefinitionUri', 'type': 'str'}, - 'inline_entities_definition': {'key': 'inlineEntitiesDefinition', 'type': '[CustomEntity]'}, - 'global_default_case_sensitive': {'key': 'globalDefaultCaseSensitive', 'type': 'bool'}, - 'global_default_accent_sensitive': {'key': 'globalDefaultAccentSensitive', 'type': 'bool'}, - 'global_default_fuzzy_edit_distance': {'key': 'globalDefaultFuzzyEditDistance', 'type': 'int'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - default_language_code: Optional[Union[str, "CustomEntityLookupSkillLanguage"]] = None, - entities_definition_uri: Optional[str] = None, - inline_entities_definition: Optional[List["CustomEntity"]] = None, - global_default_case_sensitive: Optional[bool] = None, - global_default_accent_sensitive: Optional[bool] = None, - global_default_fuzzy_edit_distance: Optional[int] = None, - **kwargs - ): - super(CustomEntityLookupSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Text.CustomEntityLookupSkill' # type: str - self.default_language_code = default_language_code - self.entities_definition_uri = entities_definition_uri - self.inline_entities_definition = inline_entities_definition - self.global_default_case_sensitive = global_default_case_sensitive - self.global_default_accent_sensitive = global_default_accent_sensitive - self.global_default_fuzzy_edit_distance = global_default_fuzzy_edit_distance - - -class DataChangeDetectionPolicy(msrest.serialization.Model): - """Base type for data change detection policies. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: HighWaterMarkChangeDetectionPolicy, SqlIntegratedChangeTrackingPolicy. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data change detection - policy.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy': 'HighWaterMarkChangeDetectionPolicy', '#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy': 'SqlIntegratedChangeTrackingPolicy'} - } - - def __init__( - self, - **kwargs - ): - super(DataChangeDetectionPolicy, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class DataDeletionDetectionPolicy(msrest.serialization.Model): - """Base type for data deletion detection policies. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SoftDeleteColumnDeletionDetectionPolicy. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data deletion detection - policy.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy': 'SoftDeleteColumnDeletionDetectionPolicy'} - } - - def __init__( - self, - **kwargs - ): - super(DataDeletionDetectionPolicy, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class DataSourceCredentials(msrest.serialization.Model): - """Represents credentials that can be used to connect to a datasource. - - :param connection_string: The connection string for the datasource. Set to - ':code:``' if you do not want the connection string updated. - :type connection_string: str - """ - - _attribute_map = { - 'connection_string': {'key': 'connectionString', 'type': 'str'}, - } - - def __init__( - self, - *, - connection_string: Optional[str] = None, - **kwargs - ): - super(DataSourceCredentials, self).__init__(**kwargs) - self.connection_string = connection_string - - -class DefaultCognitiveServicesAccount(CognitiveServicesAccount): - """An empty object that represents the default cognitive service resource for a skillset. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the cognitive service resource - attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - **kwargs - ): - super(DefaultCognitiveServicesAccount, self).__init__(description=description, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.DefaultCognitiveServices' # type: str - - -class DictionaryDecompounderTokenFilter(TokenFilter): - """Decomposes compound words found in many Germanic languages. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param word_list: Required. The list of words to match against. - :type word_list: list[str] - :param min_word_size: The minimum word size. Only words longer than this get processed. Default - is 5. Maximum is 300. - :type min_word_size: int - :param min_subword_size: The minimum subword size. Only subwords longer than this are - outputted. Default is 2. Maximum is 300. - :type min_subword_size: int - :param max_subword_size: The maximum subword size. Only subwords shorter than this are - outputted. Default is 15. Maximum is 300. - :type max_subword_size: int - :param only_longest_match: A value indicating whether to add only the longest matching subword - to the output. Default is false. - :type only_longest_match: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'word_list': {'required': True}, - 'min_word_size': {'maximum': 300}, - 'min_subword_size': {'maximum': 300}, - 'max_subword_size': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'word_list': {'key': 'wordList', 'type': '[str]'}, - 'min_word_size': {'key': 'minWordSize', 'type': 'int'}, - 'min_subword_size': {'key': 'minSubwordSize', 'type': 'int'}, - 'max_subword_size': {'key': 'maxSubwordSize', 'type': 'int'}, - 'only_longest_match': {'key': 'onlyLongestMatch', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - word_list: List[str], - min_word_size: Optional[int] = 5, - min_subword_size: Optional[int] = 2, - max_subword_size: Optional[int] = 15, - only_longest_match: Optional[bool] = False, - **kwargs - ): - super(DictionaryDecompounderTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.DictionaryDecompounderTokenFilter' # type: str - self.word_list = word_list - self.min_word_size = min_word_size - self.min_subword_size = min_subword_size - self.max_subword_size = max_subword_size - self.only_longest_match = only_longest_match - - -class ScoringFunction(msrest.serialization.Model): - """Base type for functions that can modify document scores during ranking. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DistanceScoringFunction, FreshnessScoringFunction, MagnitudeScoringFunction, TagScoringFunction. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'distance': 'DistanceScoringFunction', 'freshness': 'FreshnessScoringFunction', 'magnitude': 'MagnitudeScoringFunction', 'tag': 'TagScoringFunction'} - } - - def __init__( - self, - *, - field_name: str, - boost: float, - interpolation: Optional[Union[str, "ScoringFunctionInterpolation"]] = None, - **kwargs - ): - super(ScoringFunction, self).__init__(**kwargs) - self.type = None # type: Optional[str] - self.field_name = field_name - self.boost = boost - self.interpolation = interpolation - - -class DistanceScoringFunction(ScoringFunction): - """Defines a function that boosts scores based on distance from a geographic location. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the distance scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.DistanceScoringParameters - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - 'parameters': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - 'parameters': {'key': 'distance', 'type': 'DistanceScoringParameters'}, - } - - def __init__( - self, - *, - field_name: str, - boost: float, - parameters: "DistanceScoringParameters", - interpolation: Optional[Union[str, "ScoringFunctionInterpolation"]] = None, - **kwargs - ): - super(DistanceScoringFunction, self).__init__(field_name=field_name, boost=boost, interpolation=interpolation, **kwargs) - self.type = 'distance' # type: str - self.parameters = parameters - - -class DistanceScoringParameters(msrest.serialization.Model): - """Provides parameter values to a distance scoring function. - - All required parameters must be populated in order to send to Azure. - - :param reference_point_parameter: Required. The name of the parameter passed in search queries - to specify the reference location. - :type reference_point_parameter: str - :param boosting_distance: Required. The distance in kilometers from the reference location - where the boosting range ends. - :type boosting_distance: float - """ - - _validation = { - 'reference_point_parameter': {'required': True}, - 'boosting_distance': {'required': True}, - } - - _attribute_map = { - 'reference_point_parameter': {'key': 'referencePointParameter', 'type': 'str'}, - 'boosting_distance': {'key': 'boostingDistance', 'type': 'float'}, - } - - def __init__( - self, - *, - reference_point_parameter: str, - boosting_distance: float, - **kwargs - ): - super(DistanceScoringParameters, self).__init__(**kwargs) - self.reference_point_parameter = reference_point_parameter - self.boosting_distance = boosting_distance - - -class DocumentExtractionSkill(SearchIndexerSkill): - """A skill that extracts content from a file within the enrichment pipeline. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. - :type parsing_mode: str - :param data_to_extract: The type of data to be extracted for the skill. Will be set to - 'contentAndMetadata' if not defined. - :type data_to_extract: str - :param configuration: A dictionary of configurations for the skill. - :type configuration: dict[str, object] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'parsing_mode': {'key': 'parsingMode', 'type': 'str'}, - 'data_to_extract': {'key': 'dataToExtract', 'type': 'str'}, - 'configuration': {'key': 'configuration', 'type': '{object}'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - parsing_mode: Optional[str] = None, - data_to_extract: Optional[str] = None, - configuration: Optional[Dict[str, object]] = None, - **kwargs - ): - super(DocumentExtractionSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Util.DocumentExtractionSkill' # type: str - self.parsing_mode = parsing_mode - self.data_to_extract = data_to_extract - self.configuration = configuration - - -class EdgeNGramTokenFilter(TokenFilter): - """Generates n-grams of the given size(s) starting from the front or the back of an input token. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Must be less than the value of - maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. - :type max_gram: int - :param side: Specifies which side of the input the n-gram should be generated from. Default is - "front". Possible values include: "front", "back". - :type side: str or ~azure.search.documents.indexes.v2020_06.models.EdgeNGramTokenFilterSide - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - 'side': {'key': 'side', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - min_gram: Optional[int] = 1, - max_gram: Optional[int] = 2, - side: Optional[Union[str, "EdgeNGramTokenFilterSide"]] = None, - **kwargs - ): - super(EdgeNGramTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.EdgeNGramTokenFilter' # type: str - self.min_gram = min_gram - self.max_gram = max_gram - self.side = side - - -class EdgeNGramTokenFilterV2(TokenFilter): - """Generates n-grams of the given size(s) starting from the front or the back of an input token. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param side: Specifies which side of the input the n-gram should be generated from. Default is - "front". Possible values include: "front", "back". - :type side: str or ~azure.search.documents.indexes.v2020_06.models.EdgeNGramTokenFilterSide - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_gram': {'maximum': 300}, - 'max_gram': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - 'side': {'key': 'side', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - min_gram: Optional[int] = 1, - max_gram: Optional[int] = 2, - side: Optional[Union[str, "EdgeNGramTokenFilterSide"]] = None, - **kwargs - ): - super(EdgeNGramTokenFilterV2, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.EdgeNGramTokenFilterV2' # type: str - self.min_gram = min_gram - self.max_gram = max_gram - self.side = side - - -class EdgeNGramTokenizer(LexicalTokenizer): - """Tokenizes the input from an edge into n-grams of the given size(s). This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or - ~azure.search.documents.indexes.v2020_06.models.TokenCharacterKind] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_gram': {'maximum': 300}, - 'max_gram': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - 'token_chars': {'key': 'tokenChars', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - min_gram: Optional[int] = 1, - max_gram: Optional[int] = 2, - token_chars: Optional[List[Union[str, "TokenCharacterKind"]]] = None, - **kwargs - ): - super(EdgeNGramTokenizer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.EdgeNGramTokenizer' # type: str - self.min_gram = min_gram - self.max_gram = max_gram - self.token_chars = token_chars - - -class ElisionTokenFilter(TokenFilter): - """Removes elisions. For example, "l'avion" (the plane) will be converted to "avion" (plane). This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param articles: The set of articles to remove. - :type articles: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'articles': {'key': 'articles', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - articles: Optional[List[str]] = None, - **kwargs - ): - super(ElisionTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.ElisionTokenFilter' # type: str - self.articles = articles - - -class EntityRecognitionSkill(SearchIndexerSkill): - """Text analytics entity recognition. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param categories: A list of entity categories that should be extracted. - :type categories: list[str or ~azure.search.documents.indexes.v2020_06.models.EntityCategory] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "ar", "cs", "zh-Hans", "zh-Hant", "da", "nl", "en", "fi", "fr", "de", - "el", "hu", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv", "tr". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.EntityRecognitionSkillLanguage - :param include_typeless_entities: Determines whether or not to include entities which are well - known but don't conform to a pre-defined type. If this configuration is not set (default), set - to null or set to false, entities which don't conform to one of the pre-defined types will not - be surfaced. - :type include_typeless_entities: bool - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose - confidence score is greater than the value specified. If not set (default), or if explicitly - set to null, all entities will be included. - :type minimum_precision: float - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'categories': {'key': 'categories', 'type': '[str]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'include_typeless_entities': {'key': 'includeTypelessEntities', 'type': 'bool'}, - 'minimum_precision': {'key': 'minimumPrecision', 'type': 'float'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - categories: Optional[List[Union[str, "EntityCategory"]]] = None, - default_language_code: Optional[Union[str, "EntityRecognitionSkillLanguage"]] = None, - include_typeless_entities: Optional[bool] = None, - minimum_precision: Optional[float] = None, - **kwargs - ): - super(EntityRecognitionSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Text.EntityRecognitionSkill' # type: str - self.categories = categories - self.default_language_code = default_language_code - self.include_typeless_entities = include_typeless_entities - self.minimum_precision = minimum_precision - - -class FieldMapping(msrest.serialization.Model): - """Defines a mapping between a field in a data source and a target field in an index. - - All required parameters must be populated in order to send to Azure. - - :param source_field_name: Required. The name of the field in the data source. - :type source_field_name: str - :param target_field_name: The name of the target field in the index. Same as the source field - name by default. - :type target_field_name: str - :param mapping_function: A function to apply to each source field value before indexing. - :type mapping_function: ~azure.search.documents.indexes.v2020_06.models.FieldMappingFunction - """ - - _validation = { - 'source_field_name': {'required': True}, - } - - _attribute_map = { - 'source_field_name': {'key': 'sourceFieldName', 'type': 'str'}, - 'target_field_name': {'key': 'targetFieldName', 'type': 'str'}, - 'mapping_function': {'key': 'mappingFunction', 'type': 'FieldMappingFunction'}, - } - - def __init__( - self, - *, - source_field_name: str, - target_field_name: Optional[str] = None, - mapping_function: Optional["FieldMappingFunction"] = None, - **kwargs - ): - super(FieldMapping, self).__init__(**kwargs) - self.source_field_name = source_field_name - self.target_field_name = target_field_name - self.mapping_function = mapping_function - - -class FieldMappingFunction(msrest.serialization.Model): - """Represents a function that transforms a value from a data source before indexing. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the field mapping function. - :type name: str - :param parameters: A dictionary of parameter name/value pairs to pass to the function. Each - value must be of a primitive type. - :type parameters: dict[str, object] - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': '{object}'}, - } - - def __init__( - self, - *, - name: str, - parameters: Optional[Dict[str, object]] = None, - **kwargs - ): - super(FieldMappingFunction, self).__init__(**kwargs) - self.name = name - self.parameters = parameters - - -class FreshnessScoringFunction(ScoringFunction): - """Defines a function that boosts scores based on the value of a date-time field. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the freshness scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.FreshnessScoringParameters - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - 'parameters': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - 'parameters': {'key': 'freshness', 'type': 'FreshnessScoringParameters'}, - } - - def __init__( - self, - *, - field_name: str, - boost: float, - parameters: "FreshnessScoringParameters", - interpolation: Optional[Union[str, "ScoringFunctionInterpolation"]] = None, - **kwargs - ): - super(FreshnessScoringFunction, self).__init__(field_name=field_name, boost=boost, interpolation=interpolation, **kwargs) - self.type = 'freshness' # type: str - self.parameters = parameters - - -class FreshnessScoringParameters(msrest.serialization.Model): - """Provides parameter values to a freshness scoring function. - - All required parameters must be populated in order to send to Azure. - - :param boosting_duration: Required. The expiration period after which boosting will stop for a - particular document. - :type boosting_duration: ~datetime.timedelta - """ - - _validation = { - 'boosting_duration': {'required': True}, - } - - _attribute_map = { - 'boosting_duration': {'key': 'boostingDuration', 'type': 'duration'}, - } - - def __init__( - self, - *, - boosting_duration: datetime.timedelta, - **kwargs - ): - super(FreshnessScoringParameters, self).__init__(**kwargs) - self.boosting_duration = boosting_duration - - -class GetIndexStatisticsResult(msrest.serialization.Model): - """Statistics for a given index. Statistics are collected periodically and are not guaranteed to always be up-to-date. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar document_count: Required. The number of documents in the index. - :vartype document_count: long - :ivar storage_size: Required. The amount of storage in bytes consumed by the index. - :vartype storage_size: long - """ - - _validation = { - 'document_count': {'required': True, 'readonly': True}, - 'storage_size': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'document_count': {'key': 'documentCount', 'type': 'long'}, - 'storage_size': {'key': 'storageSize', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(GetIndexStatisticsResult, self).__init__(**kwargs) - self.document_count = None - self.storage_size = None - - -class HighWaterMarkChangeDetectionPolicy(DataChangeDetectionPolicy): - """Defines a data change detection policy that captures changes based on the value of a high water mark column. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data change detection - policy.Constant filled by server. - :type odata_type: str - :param high_water_mark_column_name: Required. The name of the high water mark column. - :type high_water_mark_column_name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'high_water_mark_column_name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'high_water_mark_column_name': {'key': 'highWaterMarkColumnName', 'type': 'str'}, - } - - def __init__( - self, - *, - high_water_mark_column_name: str, - **kwargs - ): - super(HighWaterMarkChangeDetectionPolicy, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy' # type: str - self.high_water_mark_column_name = high_water_mark_column_name - - -class ImageAnalysisSkill(SearchIndexerSkill): - """A skill that analyzes image files. It extracts a rich set of visual features based on the image content. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "en", "es", "ja", "pt", "zh". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.ImageAnalysisSkillLanguage - :param visual_features: A list of visual features. - :type visual_features: list[str or - ~azure.search.documents.indexes.v2020_06.models.VisualFeature] - :param details: A string indicating which domain-specific details to return. - :type details: list[str or ~azure.search.documents.indexes.v2020_06.models.ImageDetail] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'visual_features': {'key': 'visualFeatures', 'type': '[str]'}, - 'details': {'key': 'details', 'type': '[str]'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - default_language_code: Optional[Union[str, "ImageAnalysisSkillLanguage"]] = None, - visual_features: Optional[List[Union[str, "VisualFeature"]]] = None, - details: Optional[List[Union[str, "ImageDetail"]]] = None, - **kwargs - ): - super(ImageAnalysisSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Vision.ImageAnalysisSkill' # type: str - self.default_language_code = default_language_code - self.visual_features = visual_features - self.details = details - - -class IndexerExecutionResult(msrest.serialization.Model): - """Represents the result of an individual indexer execution. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar status: Required. The outcome of this indexer execution. Possible values include: - "transientFailure", "success", "inProgress", "reset". - :vartype status: str or ~azure.search.documents.indexes.v2020_06.models.IndexerExecutionStatus - :ivar error_message: The error message indicating the top-level error, if any. - :vartype error_message: str - :ivar start_time: The start time of this indexer execution. - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time of this indexer execution, if the execution has already completed. - :vartype end_time: ~datetime.datetime - :ivar errors: Required. The item-level indexing errors. - :vartype errors: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerError] - :ivar warnings: Required. The item-level indexing warnings. - :vartype warnings: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerWarning] - :ivar item_count: Required. The number of items that were processed during this indexer - execution. This includes both successfully processed items and items where indexing was - attempted but failed. - :vartype item_count: int - :ivar failed_item_count: Required. The number of items that failed to be indexed during this - indexer execution. - :vartype failed_item_count: int - :ivar initial_tracking_state: Change tracking state with which an indexer execution started. - :vartype initial_tracking_state: str - :ivar final_tracking_state: Change tracking state with which an indexer execution finished. - :vartype final_tracking_state: str - """ - - _validation = { - 'status': {'required': True, 'readonly': True}, - 'error_message': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'errors': {'required': True, 'readonly': True}, - 'warnings': {'required': True, 'readonly': True}, - 'item_count': {'required': True, 'readonly': True}, - 'failed_item_count': {'required': True, 'readonly': True}, - 'initial_tracking_state': {'readonly': True}, - 'final_tracking_state': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'errors': {'key': 'errors', 'type': '[SearchIndexerError]'}, - 'warnings': {'key': 'warnings', 'type': '[SearchIndexerWarning]'}, - 'item_count': {'key': 'itemsProcessed', 'type': 'int'}, - 'failed_item_count': {'key': 'itemsFailed', 'type': 'int'}, - 'initial_tracking_state': {'key': 'initialTrackingState', 'type': 'str'}, - 'final_tracking_state': {'key': 'finalTrackingState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IndexerExecutionResult, self).__init__(**kwargs) - self.status = None - self.error_message = None - self.start_time = None - self.end_time = None - self.errors = None - self.warnings = None - self.item_count = None - self.failed_item_count = None - self.initial_tracking_state = None - self.final_tracking_state = None - - -class IndexingParameters(msrest.serialization.Model): - """Represents parameters for indexer execution. - - :param batch_size: The number of items that are read from the data source and indexed as a - single batch in order to improve performance. The default depends on the data source type. - :type batch_size: int - :param max_failed_items: The maximum number of items that can fail indexing for indexer - execution to still be considered successful. -1 means no limit. Default is 0. - :type max_failed_items: int - :param max_failed_items_per_batch: The maximum number of items in a single batch that can fail - indexing for the batch to still be considered successful. -1 means no limit. Default is 0. - :type max_failed_items_per_batch: int - :param configuration: A dictionary of indexer-specific configuration properties. Each name is - the name of a specific property. Each value must be of a primitive type. - :type configuration: - ~azure.search.documents.indexes.v2020_06.models.IndexingParametersConfiguration - """ - - _attribute_map = { - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'max_failed_items': {'key': 'maxFailedItems', 'type': 'int'}, - 'max_failed_items_per_batch': {'key': 'maxFailedItemsPerBatch', 'type': 'int'}, - 'configuration': {'key': 'configuration', 'type': 'IndexingParametersConfiguration'}, - } - - def __init__( - self, - *, - batch_size: Optional[int] = None, - max_failed_items: Optional[int] = 0, - max_failed_items_per_batch: Optional[int] = 0, - configuration: Optional["IndexingParametersConfiguration"] = None, - **kwargs - ): - super(IndexingParameters, self).__init__(**kwargs) - self.batch_size = batch_size - self.max_failed_items = max_failed_items - self.max_failed_items_per_batch = max_failed_items_per_batch - self.configuration = configuration - - -class IndexingParametersConfiguration(msrest.serialization.Model): - """A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - - :param additional_properties: Unmatched properties from the message are deserialized to this - collection. - :type additional_properties: dict[str, object] - :param parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. - Possible values include: "default", "text", "delimitedText", "json", "jsonArray", "jsonLines". - Default value: "default". - :type parsing_mode: str or - ~azure.search.documents.indexes.v2020_06.models.BlobIndexerParsingMode - :param excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore - when processing from Azure blob storage. For example, you could exclude ".png, .mp4" to skip - over those files during indexing. - :type excluded_file_name_extensions: str - :param indexed_file_name_extensions: Comma-delimited list of filename extensions to select when - processing from Azure blob storage. For example, you could focus indexing on specific - application files ".docx, .pptx, .msg" to specifically include those file types. - :type indexed_file_name_extensions: str - :param fail_on_unsupported_content_type: For Azure blobs, set to false if you want to continue - indexing when an unsupported content type is encountered, and you don't know all the content - types (file extensions) in advance. - :type fail_on_unsupported_content_type: bool - :param fail_on_unprocessable_document: For Azure blobs, set to false if you want to continue - indexing if a document fails indexing. - :type fail_on_unprocessable_document: bool - :param index_storage_metadata_only_for_oversized_documents: For Azure blobs, set this property - to true to still index storage metadata for blob content that is too large to process. - Oversized blobs are treated as errors by default. For limits on blob size, see - https://docs.microsoft.com/azure/search/search-limits-quotas-capacity. - :type index_storage_metadata_only_for_oversized_documents: bool - :param delimited_text_headers: For CSV blobs, specifies a comma-delimited list of column - headers, useful for mapping source fields to destination fields in an index. - :type delimited_text_headers: str - :param delimited_text_delimiter: For CSV blobs, specifies the end-of-line single-character - delimiter for CSV files where each line starts a new document (for example, "|"). - :type delimited_text_delimiter: str - :param first_line_contains_headers: For CSV blobs, indicates that the first (non-blank) line of - each blob contains headers. - :type first_line_contains_headers: bool - :param document_root: For JSON arrays, given a structured or semi-structured document, you can - specify a path to the array using this property. - :type document_root: str - :param data_to_extract: Specifies the data to extract from Azure blob storage and tells the - indexer which data to extract from image content when "imageAction" is set to a value other - than "none". This applies to embedded image content in a .PDF or other application, or image - files such as .jpg and .png, in Azure blobs. Possible values include: "storageMetadata", - "allMetadata", "contentAndMetadata". Default value: "contentAndMetadata". - :type data_to_extract: str or - ~azure.search.documents.indexes.v2020_06.models.BlobIndexerDataToExtract - :param image_action: Determines how to process embedded images and image files in Azure blob - storage. Setting the "imageAction" configuration to any value other than "none" requires that - a skillset also be attached to that indexer. Possible values include: "none", - "generateNormalizedImages", "generateNormalizedImagePerPage". Default value: "none". - :type image_action: str or - ~azure.search.documents.indexes.v2020_06.models.BlobIndexerImageAction - :param allow_skillset_to_read_file_data: If true, will create a path //document//file_data that - is an object representing the original file data downloaded from your blob data source. This - allows you to pass the original file data to a custom skill for processing within the - enrichment pipeline, or to the Document Extraction skill. - :type allow_skillset_to_read_file_data: bool - :param pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files in - Azure blob storage. Possible values include: "none", "detectAngles". Default value: "none". - :type pdf_text_rotation_algorithm: str or - ~azure.search.documents.indexes.v2020_06.models.BlobIndexerPDFTextRotationAlgorithm - :param execution_environment: Specifies the environment in which the indexer should execute. - Possible values include: "standard", "private". Default value: "standard". - :type execution_environment: str or - ~azure.search.documents.indexes.v2020_06.models.IndexerExecutionEnvironment - :param query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL database - data sources, specified in the format "hh:mm:ss". - :type query_timeout: str - """ - - _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'parsing_mode': {'key': 'parsingMode', 'type': 'str'}, - 'excluded_file_name_extensions': {'key': 'excludedFileNameExtensions', 'type': 'str'}, - 'indexed_file_name_extensions': {'key': 'indexedFileNameExtensions', 'type': 'str'}, - 'fail_on_unsupported_content_type': {'key': 'failOnUnsupportedContentType', 'type': 'bool'}, - 'fail_on_unprocessable_document': {'key': 'failOnUnprocessableDocument', 'type': 'bool'}, - 'index_storage_metadata_only_for_oversized_documents': {'key': 'indexStorageMetadataOnlyForOversizedDocuments', 'type': 'bool'}, - 'delimited_text_headers': {'key': 'delimitedTextHeaders', 'type': 'str'}, - 'delimited_text_delimiter': {'key': 'delimitedTextDelimiter', 'type': 'str'}, - 'first_line_contains_headers': {'key': 'firstLineContainsHeaders', 'type': 'bool'}, - 'document_root': {'key': 'documentRoot', 'type': 'str'}, - 'data_to_extract': {'key': 'dataToExtract', 'type': 'str'}, - 'image_action': {'key': 'imageAction', 'type': 'str'}, - 'allow_skillset_to_read_file_data': {'key': 'allowSkillsetToReadFileData', 'type': 'bool'}, - 'pdf_text_rotation_algorithm': {'key': 'pdfTextRotationAlgorithm', 'type': 'str'}, - 'execution_environment': {'key': 'executionEnvironment', 'type': 'str'}, - 'query_timeout': {'key': 'queryTimeout', 'type': 'str'}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, object]] = None, - parsing_mode: Optional[Union[str, "BlobIndexerParsingMode"]] = "default", - excluded_file_name_extensions: Optional[str] = "", - indexed_file_name_extensions: Optional[str] = "", - fail_on_unsupported_content_type: Optional[bool] = False, - fail_on_unprocessable_document: Optional[bool] = False, - index_storage_metadata_only_for_oversized_documents: Optional[bool] = False, - delimited_text_headers: Optional[str] = None, - delimited_text_delimiter: Optional[str] = None, - first_line_contains_headers: Optional[bool] = True, - document_root: Optional[str] = None, - data_to_extract: Optional[Union[str, "BlobIndexerDataToExtract"]] = "contentAndMetadata", - image_action: Optional[Union[str, "BlobIndexerImageAction"]] = "none", - allow_skillset_to_read_file_data: Optional[bool] = False, - pdf_text_rotation_algorithm: Optional[Union[str, "BlobIndexerPDFTextRotationAlgorithm"]] = "none", - execution_environment: Optional[Union[str, "IndexerExecutionEnvironment"]] = "standard", - query_timeout: Optional[str] = "00:05:00", - **kwargs - ): - super(IndexingParametersConfiguration, self).__init__(**kwargs) - self.additional_properties = additional_properties - self.parsing_mode = parsing_mode - self.excluded_file_name_extensions = excluded_file_name_extensions - self.indexed_file_name_extensions = indexed_file_name_extensions - self.fail_on_unsupported_content_type = fail_on_unsupported_content_type - self.fail_on_unprocessable_document = fail_on_unprocessable_document - self.index_storage_metadata_only_for_oversized_documents = index_storage_metadata_only_for_oversized_documents - self.delimited_text_headers = delimited_text_headers - self.delimited_text_delimiter = delimited_text_delimiter - self.first_line_contains_headers = first_line_contains_headers - self.document_root = document_root - self.data_to_extract = data_to_extract - self.image_action = image_action - self.allow_skillset_to_read_file_data = allow_skillset_to_read_file_data - self.pdf_text_rotation_algorithm = pdf_text_rotation_algorithm - self.execution_environment = execution_environment - self.query_timeout = query_timeout - - -class IndexingSchedule(msrest.serialization.Model): - """Represents a schedule for indexer execution. - - All required parameters must be populated in order to send to Azure. - - :param interval: Required. The interval of time between indexer executions. - :type interval: ~datetime.timedelta - :param start_time: The time when an indexer should start running. - :type start_time: ~datetime.datetime - """ - - _validation = { - 'interval': {'required': True}, - } - - _attribute_map = { - 'interval': {'key': 'interval', 'type': 'duration'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - interval: datetime.timedelta, - start_time: Optional[datetime.datetime] = None, - **kwargs - ): - super(IndexingSchedule, self).__init__(**kwargs) - self.interval = interval - self.start_time = start_time - - -class InputFieldMappingEntry(msrest.serialization.Model): - """Input field mapping for a skill. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the input. - :type name: str - :param source: The source of the input. - :type source: str - :param source_context: The source context used for selecting recursive inputs. - :type source_context: str - :param inputs: The recursive inputs used when creating a complex type. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'source_context': {'key': 'sourceContext', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - } - - def __init__( - self, - *, - name: str, - source: Optional[str] = None, - source_context: Optional[str] = None, - inputs: Optional[List["InputFieldMappingEntry"]] = None, - **kwargs - ): - super(InputFieldMappingEntry, self).__init__(**kwargs) - self.name = name - self.source = source - self.source_context = source_context - self.inputs = inputs - - -class KeepTokenFilter(TokenFilter): - """A token filter that only keeps tokens with text contained in a specified list of words. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param keep_words: Required. The list of words to keep. - :type keep_words: list[str] - :param lower_case_keep_words: A value indicating whether to lower case all words first. Default - is false. - :type lower_case_keep_words: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'keep_words': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'keep_words': {'key': 'keepWords', 'type': '[str]'}, - 'lower_case_keep_words': {'key': 'keepWordsCase', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - keep_words: List[str], - lower_case_keep_words: Optional[bool] = False, - **kwargs - ): - super(KeepTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.KeepTokenFilter' # type: str - self.keep_words = keep_words - self.lower_case_keep_words = lower_case_keep_words - - -class KeyPhraseExtractionSkill(SearchIndexerSkill): - """A skill that uses text analytics for key phrase extraction. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", "pt- - PT", "pt-BR", "ru", "es", "sv". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.KeyPhraseExtractionSkillLanguage - :param max_key_phrase_count: A number indicating how many key phrases to return. If absent, all - identified key phrases will be returned. - :type max_key_phrase_count: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'max_key_phrase_count': {'key': 'maxKeyPhraseCount', 'type': 'int'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - default_language_code: Optional[Union[str, "KeyPhraseExtractionSkillLanguage"]] = None, - max_key_phrase_count: Optional[int] = None, - **kwargs - ): - super(KeyPhraseExtractionSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Text.KeyPhraseExtractionSkill' # type: str - self.default_language_code = default_language_code - self.max_key_phrase_count = max_key_phrase_count - - -class KeywordMarkerTokenFilter(TokenFilter): - """Marks terms as keywords. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param keywords: Required. A list of words to mark as keywords. - :type keywords: list[str] - :param ignore_case: A value indicating whether to ignore case. If true, all words are converted - to lower case first. Default is false. - :type ignore_case: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'keywords': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'keywords': {'key': 'keywords', 'type': '[str]'}, - 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - keywords: List[str], - ignore_case: Optional[bool] = False, - **kwargs - ): - super(KeywordMarkerTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.KeywordMarkerTokenFilter' # type: str - self.keywords = keywords - self.ignore_case = ignore_case - - -class KeywordTokenizer(LexicalTokenizer): - """Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param buffer_size: The read buffer size in bytes. Default is 256. - :type buffer_size: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'buffer_size': {'key': 'bufferSize', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - buffer_size: Optional[int] = 256, - **kwargs - ): - super(KeywordTokenizer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.KeywordTokenizer' # type: str - self.buffer_size = buffer_size - - -class KeywordTokenizerV2(LexicalTokenizer): - """Emits the entire input as a single token. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 256. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - max_token_length: Optional[int] = 256, - **kwargs - ): - super(KeywordTokenizerV2, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.KeywordTokenizerV2' # type: str - self.max_token_length = max_token_length - - -class LanguageDetectionSkill(SearchIndexerSkill): - """A skill that detects the language of input text and reports a single language code for every document submitted on the request. The language code is paired with a score indicating the confidence of the analysis. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - **kwargs - ): - super(LanguageDetectionSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Text.LanguageDetectionSkill' # type: str - - -class LengthTokenFilter(TokenFilter): - """Removes words that are too long or too short. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_length: The minimum length in characters. Default is 0. Maximum is 300. Must be less - than the value of max. - :type min_length: int - :param max_length: The maximum length in characters. Default and maximum is 300. - :type max_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_length': {'maximum': 300}, - 'max_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_length': {'key': 'min', 'type': 'int'}, - 'max_length': {'key': 'max', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - min_length: Optional[int] = 0, - max_length: Optional[int] = 300, - **kwargs - ): - super(LengthTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.LengthTokenFilter' # type: str - self.min_length = min_length - self.max_length = max_length - - -class LimitTokenFilter(TokenFilter): - """Limits the number of tokens while indexing. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param max_token_count: The maximum number of tokens to produce. Default is 1. - :type max_token_count: int - :param consume_all_tokens: A value indicating whether all tokens from the input must be - consumed even if maxTokenCount is reached. Default is false. - :type consume_all_tokens: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_count': {'key': 'maxTokenCount', 'type': 'int'}, - 'consume_all_tokens': {'key': 'consumeAllTokens', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - max_token_count: Optional[int] = 1, - consume_all_tokens: Optional[bool] = False, - **kwargs - ): - super(LimitTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.LimitTokenFilter' # type: str - self.max_token_count = max_token_count - self.consume_all_tokens = consume_all_tokens - - -class ListDataSourcesResult(msrest.serialization.Model): - """Response from a List Datasources request. If successful, it includes the full definitions of all datasources. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar data_sources: Required. The datasources in the Search service. - :vartype data_sources: - list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource] - """ - - _validation = { - 'data_sources': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'data_sources': {'key': 'value', 'type': '[SearchIndexerDataSource]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListDataSourcesResult, self).__init__(**kwargs) - self.data_sources = None - - -class ListIndexersResult(msrest.serialization.Model): - """Response from a List Indexers request. If successful, it includes the full definitions of all indexers. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar indexers: Required. The indexers in the Search service. - :vartype indexers: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexer] - """ - - _validation = { - 'indexers': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'indexers': {'key': 'value', 'type': '[SearchIndexer]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListIndexersResult, self).__init__(**kwargs) - self.indexers = None - - -class ListIndexesResult(msrest.serialization.Model): - """Response from a List Indexes request. If successful, it includes the full definitions of all indexes. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar indexes: Required. The indexes in the Search service. - :vartype indexes: list[~azure.search.documents.indexes.v2020_06.models.SearchIndex] - """ - - _validation = { - 'indexes': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'indexes': {'key': 'value', 'type': '[SearchIndex]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListIndexesResult, self).__init__(**kwargs) - self.indexes = None - - -class ListSkillsetsResult(msrest.serialization.Model): - """Response from a list skillset request. If successful, it includes the full definitions of all skillsets. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar skillsets: Required. The skillsets defined in the Search service. - :vartype skillsets: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset] - """ - - _validation = { - 'skillsets': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'skillsets': {'key': 'value', 'type': '[SearchIndexerSkillset]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListSkillsetsResult, self).__init__(**kwargs) - self.skillsets = None - - -class ListSynonymMapsResult(msrest.serialization.Model): - """Response from a List SynonymMaps request. If successful, it includes the full definitions of all synonym maps. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar synonym_maps: Required. The synonym maps in the Search service. - :vartype synonym_maps: list[~azure.search.documents.indexes.v2020_06.models.SynonymMap] - """ - - _validation = { - 'synonym_maps': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'synonym_maps': {'key': 'value', 'type': '[SynonymMap]'}, - } - - def __init__( - self, - **kwargs - ): - super(ListSynonymMapsResult, self).__init__(**kwargs) - self.synonym_maps = None - - -class LuceneStandardAnalyzer(LexicalAnalyzer): - """Standard Apache Lucene analyzer; Composed of the standard tokenizer, lowercase filter and stop filter. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - :param stopwords: A list of stopwords. - :type stopwords: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - 'stopwords': {'key': 'stopwords', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - max_token_length: Optional[int] = 255, - stopwords: Optional[List[str]] = None, - **kwargs - ): - super(LuceneStandardAnalyzer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.StandardAnalyzer' # type: str - self.max_token_length = max_token_length - self.stopwords = stopwords - - -class LuceneStandardTokenizer(LexicalTokenizer): - """Breaks text following the Unicode Text Segmentation rules. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - max_token_length: Optional[int] = 255, - **kwargs - ): - super(LuceneStandardTokenizer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.StandardTokenizer' # type: str - self.max_token_length = max_token_length - - -class LuceneStandardTokenizerV2(LexicalTokenizer): - """Breaks text following the Unicode Text Segmentation rules. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - max_token_length: Optional[int] = 255, - **kwargs - ): - super(LuceneStandardTokenizerV2, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.StandardTokenizerV2' # type: str - self.max_token_length = max_token_length - - -class MagnitudeScoringFunction(ScoringFunction): - """Defines a function that boosts scores based on the magnitude of a numeric field. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the magnitude scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.MagnitudeScoringParameters - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - 'parameters': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - 'parameters': {'key': 'magnitude', 'type': 'MagnitudeScoringParameters'}, - } - - def __init__( - self, - *, - field_name: str, - boost: float, - parameters: "MagnitudeScoringParameters", - interpolation: Optional[Union[str, "ScoringFunctionInterpolation"]] = None, - **kwargs - ): - super(MagnitudeScoringFunction, self).__init__(field_name=field_name, boost=boost, interpolation=interpolation, **kwargs) - self.type = 'magnitude' # type: str - self.parameters = parameters - - -class MagnitudeScoringParameters(msrest.serialization.Model): - """Provides parameter values to a magnitude scoring function. - - All required parameters must be populated in order to send to Azure. - - :param boosting_range_start: Required. The field value at which boosting starts. - :type boosting_range_start: float - :param boosting_range_end: Required. The field value at which boosting ends. - :type boosting_range_end: float - :param should_boost_beyond_range_by_constant: A value indicating whether to apply a constant - boost for field values beyond the range end value; default is false. - :type should_boost_beyond_range_by_constant: bool - """ - - _validation = { - 'boosting_range_start': {'required': True}, - 'boosting_range_end': {'required': True}, - } - - _attribute_map = { - 'boosting_range_start': {'key': 'boostingRangeStart', 'type': 'float'}, - 'boosting_range_end': {'key': 'boostingRangeEnd', 'type': 'float'}, - 'should_boost_beyond_range_by_constant': {'key': 'constantBoostBeyondRange', 'type': 'bool'}, - } - - def __init__( - self, - *, - boosting_range_start: float, - boosting_range_end: float, - should_boost_beyond_range_by_constant: Optional[bool] = None, - **kwargs - ): - super(MagnitudeScoringParameters, self).__init__(**kwargs) - self.boosting_range_start = boosting_range_start - self.boosting_range_end = boosting_range_end - self.should_boost_beyond_range_by_constant = should_boost_beyond_range_by_constant - - -class MappingCharFilter(CharFilter): - """A character filter that applies mappings defined with the mappings option. Matching is greedy (longest pattern matching at a given point wins). Replacement is allowed to be the empty string. This character filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param mappings: Required. A list of mappings of the following format: "a=>b" (all occurrences - of the character "a" will be replaced with character "b"). - :type mappings: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'mappings': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'mappings': {'key': 'mappings', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - mappings: List[str], - **kwargs - ): - super(MappingCharFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.MappingCharFilter' # type: str - self.mappings = mappings - - -class MergeSkill(SearchIndexerSkill): - """A skill for merging two or more strings into a single unified string, with an optional user-defined delimiter separating each component part. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is - an empty space. - :type insert_pre_tag: str - :param insert_post_tag: The tag indicates the end of the merged text. By default, the tag is an - empty space. - :type insert_post_tag: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'insert_pre_tag': {'key': 'insertPreTag', 'type': 'str'}, - 'insert_post_tag': {'key': 'insertPostTag', 'type': 'str'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - insert_pre_tag: Optional[str] = " ", - insert_post_tag: Optional[str] = " ", - **kwargs - ): - super(MergeSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Text.MergeSkill' # type: str - self.insert_pre_tag = insert_pre_tag - self.insert_post_tag = insert_post_tag - - -class MicrosoftLanguageStemmingTokenizer(LexicalTokenizer): - """Divides text using language-specific rules and reduces words to their base forms. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Tokens longer than the maximum length are - split. Maximum token length that can be used is 300 characters. Tokens longer than 300 - characters are first split into tokens of length 300 and then each of those tokens is split - based on the max token length set. Default is 255. - :type max_token_length: int - :param is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used - as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. - :type is_search_tokenizer: bool - :param language: The language to use. The default is English. Possible values include: - "arabic", "bangla", "bulgarian", "catalan", "croatian", "czech", "danish", "dutch", "english", - "estonian", "finnish", "french", "german", "greek", "gujarati", "hebrew", "hindi", "hungarian", - "icelandic", "indonesian", "italian", "kannada", "latvian", "lithuanian", "malay", "malayalam", - "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", - "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovak", "slovenian", "spanish", - "swedish", "tamil", "telugu", "turkish", "ukrainian", "urdu". - :type language: str or - ~azure.search.documents.indexes.v2020_06.models.MicrosoftStemmingTokenizerLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - 'is_search_tokenizer': {'key': 'isSearchTokenizer', 'type': 'bool'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - max_token_length: Optional[int] = 255, - is_search_tokenizer: Optional[bool] = False, - language: Optional[Union[str, "MicrosoftStemmingTokenizerLanguage"]] = None, - **kwargs - ): - super(MicrosoftLanguageStemmingTokenizer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer' # type: str - self.max_token_length = max_token_length - self.is_search_tokenizer = is_search_tokenizer - self.language = language - - -class MicrosoftLanguageTokenizer(LexicalTokenizer): - """Divides text using language-specific rules. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Tokens longer than the maximum length are - split. Maximum token length that can be used is 300 characters. Tokens longer than 300 - characters are first split into tokens of length 300 and then each of those tokens is split - based on the max token length set. Default is 255. - :type max_token_length: int - :param is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used - as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. - :type is_search_tokenizer: bool - :param language: The language to use. The default is English. Possible values include: - "bangla", "bulgarian", "catalan", "chineseSimplified", "chineseTraditional", "croatian", - "czech", "danish", "dutch", "english", "french", "german", "greek", "gujarati", "hindi", - "icelandic", "indonesian", "italian", "japanese", "kannada", "korean", "malay", "malayalam", - "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", - "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovenian", "spanish", "swedish", - "tamil", "telugu", "thai", "ukrainian", "urdu", "vietnamese". - :type language: str or - ~azure.search.documents.indexes.v2020_06.models.MicrosoftTokenizerLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - 'is_search_tokenizer': {'key': 'isSearchTokenizer', 'type': 'bool'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - max_token_length: Optional[int] = 255, - is_search_tokenizer: Optional[bool] = False, - language: Optional[Union[str, "MicrosoftTokenizerLanguage"]] = None, - **kwargs - ): - super(MicrosoftLanguageTokenizer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.MicrosoftLanguageTokenizer' # type: str - self.max_token_length = max_token_length - self.is_search_tokenizer = is_search_tokenizer - self.language = language - - -class NGramTokenFilter(TokenFilter): - """Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Must be less than the value of - maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. - :type max_gram: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - min_gram: Optional[int] = 1, - max_gram: Optional[int] = 2, - **kwargs - ): - super(NGramTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.NGramTokenFilter' # type: str - self.min_gram = min_gram - self.max_gram = max_gram - - -class NGramTokenFilterV2(TokenFilter): - """Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_gram': {'maximum': 300}, - 'max_gram': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - min_gram: Optional[int] = 1, - max_gram: Optional[int] = 2, - **kwargs - ): - super(NGramTokenFilterV2, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.NGramTokenFilterV2' # type: str - self.min_gram = min_gram - self.max_gram = max_gram - - -class NGramTokenizer(LexicalTokenizer): - """Tokenizes the input into n-grams of the given size(s). This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or - ~azure.search.documents.indexes.v2020_06.models.TokenCharacterKind] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'min_gram': {'maximum': 300}, - 'max_gram': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'min_gram': {'key': 'minGram', 'type': 'int'}, - 'max_gram': {'key': 'maxGram', 'type': 'int'}, - 'token_chars': {'key': 'tokenChars', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - min_gram: Optional[int] = 1, - max_gram: Optional[int] = 2, - token_chars: Optional[List[Union[str, "TokenCharacterKind"]]] = None, - **kwargs - ): - super(NGramTokenizer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.NGramTokenizer' # type: str - self.min_gram = min_gram - self.max_gram = max_gram - self.token_chars = token_chars - - -class OcrSkill(SearchIndexerSkill): - """A skill that extracts text from image files. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "zh-Hans", "zh-Hant", "cs", "da", "nl", "en", "fi", "fr", "de", "el", - "hu", "it", "ja", "ko", "nb", "pl", "pt", "ru", "es", "sv", "tr", "ar", "ro", "sr-Cyrl", "sr- - Latn", "sk". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.OcrSkillLanguage - :param should_detect_orientation: A value indicating to turn orientation detection on or not. - Default is false. - :type should_detect_orientation: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'should_detect_orientation': {'key': 'detectOrientation', 'type': 'bool'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - default_language_code: Optional[Union[str, "OcrSkillLanguage"]] = None, - should_detect_orientation: Optional[bool] = False, - **kwargs - ): - super(OcrSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Vision.OcrSkill' # type: str - self.default_language_code = default_language_code - self.should_detect_orientation = should_detect_orientation - - -class OutputFieldMappingEntry(msrest.serialization.Model): - """Output field mapping for a skill. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the output defined by the skill. - :type name: str - :param target_name: The target name of the output. It is optional and default to name. - :type target_name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'target_name': {'key': 'targetName', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - target_name: Optional[str] = None, - **kwargs - ): - super(OutputFieldMappingEntry, self).__init__(**kwargs) - self.name = name - self.target_name = target_name - - -class PathHierarchyTokenizerV2(LexicalTokenizer): - """Tokenizer for path-like hierarchies. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param delimiter: The delimiter character to use. Default is "/". - :type delimiter: str - :param replacement: A value that, if set, replaces the delimiter character. Default is "/". - :type replacement: str - :param max_token_length: The maximum token length. Default and maximum is 300. - :type max_token_length: int - :param reverse_token_order: A value indicating whether to generate tokens in reverse order. - Default is false. - :type reverse_token_order: bool - :param number_of_tokens_to_skip: The number of initial tokens to skip. Default is 0. - :type number_of_tokens_to_skip: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'delimiter': {'key': 'delimiter', 'type': 'str'}, - 'replacement': {'key': 'replacement', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - 'reverse_token_order': {'key': 'reverse', 'type': 'bool'}, - 'number_of_tokens_to_skip': {'key': 'skip', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - delimiter: Optional[str] = "/", - replacement: Optional[str] = "/", - max_token_length: Optional[int] = 300, - reverse_token_order: Optional[bool] = False, - number_of_tokens_to_skip: Optional[int] = 0, - **kwargs - ): - super(PathHierarchyTokenizerV2, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.PathHierarchyTokenizerV2' # type: str - self.delimiter = delimiter - self.replacement = replacement - self.max_token_length = max_token_length - self.reverse_token_order = reverse_token_order - self.number_of_tokens_to_skip = number_of_tokens_to_skip - - -class PatternAnalyzer(LexicalAnalyzer): - """Flexibly separates text into terms via a regular expression pattern. This analyzer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param lower_case_terms: A value indicating whether terms should be lower-cased. Default is - true. - :type lower_case_terms: bool - :param pattern: A regular expression pattern to match token separators. Default is an - expression that matches one or more non-word characters. - :type pattern: str - :param flags: Regular expression flags. Possible values include: "CANON_EQ", - "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.v2020_06.models.RegexFlags - :param stopwords: A list of stopwords. - :type stopwords: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'lower_case_terms': {'key': 'lowercase', 'type': 'bool'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'flags': {'key': 'flags', 'type': 'str'}, - 'stopwords': {'key': 'stopwords', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - lower_case_terms: Optional[bool] = True, - pattern: Optional[str] = "\W+", - flags: Optional[Union[str, "RegexFlags"]] = None, - stopwords: Optional[List[str]] = None, - **kwargs - ): - super(PatternAnalyzer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternAnalyzer' # type: str - self.lower_case_terms = lower_case_terms - self.pattern = pattern - self.flags = flags - self.stopwords = stopwords - - -class PatternCaptureTokenFilter(TokenFilter): - """Uses Java regexes to emit multiple tokens - one for each capture group in one or more patterns. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param patterns: Required. A list of patterns to match against each token. - :type patterns: list[str] - :param preserve_original: A value indicating whether to return the original token even if one - of the patterns matches. Default is true. - :type preserve_original: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'patterns': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'patterns': {'key': 'patterns', 'type': '[str]'}, - 'preserve_original': {'key': 'preserveOriginal', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - patterns: List[str], - preserve_original: Optional[bool] = True, - **kwargs - ): - super(PatternCaptureTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternCaptureTokenFilter' # type: str - self.patterns = patterns - self.preserve_original = preserve_original - - -class PatternReplaceCharFilter(CharFilter): - """A character filter that replaces characters in the input string. It uses a regular expression to identify character sequences to preserve and a replacement pattern to identify characters to replace. For example, given the input text "aa bb aa bb", pattern "(aa)\s+(bb)", and replacement "$1#$2", the result would be "aa#bb aa#bb". This character filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param pattern: Required. A regular expression pattern. - :type pattern: str - :param replacement: Required. The replacement text. - :type replacement: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'pattern': {'required': True}, - 'replacement': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'replacement': {'key': 'replacement', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - pattern: str, - replacement: str, - **kwargs - ): - super(PatternReplaceCharFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternReplaceCharFilter' # type: str - self.pattern = pattern - self.replacement = replacement - - -class PatternReplaceTokenFilter(TokenFilter): - """A character filter that replaces characters in the input string. It uses a regular expression to identify character sequences to preserve and a replacement pattern to identify characters to replace. For example, given the input text "aa bb aa bb", pattern "(aa)\s+(bb)", and replacement "$1#$2", the result would be "aa#bb aa#bb". This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param pattern: Required. A regular expression pattern. - :type pattern: str - :param replacement: Required. The replacement text. - :type replacement: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'pattern': {'required': True}, - 'replacement': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'replacement': {'key': 'replacement', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - pattern: str, - replacement: str, - **kwargs - ): - super(PatternReplaceTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternReplaceTokenFilter' # type: str - self.pattern = pattern - self.replacement = replacement - - -class PatternTokenizer(LexicalTokenizer): - """Tokenizer that uses regex pattern matching to construct distinct tokens. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param pattern: A regular expression pattern to match token separators. Default is an - expression that matches one or more non-word characters. - :type pattern: str - :param flags: Regular expression flags. Possible values include: "CANON_EQ", - "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.v2020_06.models.RegexFlags - :param group: The zero-based ordinal of the matching group in the regular expression pattern to - extract into tokens. Use -1 if you want to use the entire pattern to split the input into - tokens, irrespective of matching groups. Default is -1. - :type group: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'pattern': {'key': 'pattern', 'type': 'str'}, - 'flags': {'key': 'flags', 'type': 'str'}, - 'group': {'key': 'group', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - pattern: Optional[str] = "\W+", - flags: Optional[Union[str, "RegexFlags"]] = None, - group: Optional[int] = -1, - **kwargs - ): - super(PatternTokenizer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.PatternTokenizer' # type: str - self.pattern = pattern - self.flags = flags - self.group = group - - -class PhoneticTokenFilter(TokenFilter): - """Create tokens for phonetic matches. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param encoder: The phonetic encoder to use. Default is "metaphone". Possible values include: - "metaphone", "doubleMetaphone", "soundex", "refinedSoundex", "caverphone1", "caverphone2", - "cologne", "nysiis", "koelnerPhonetik", "haasePhonetik", "beiderMorse". - :type encoder: str or ~azure.search.documents.indexes.v2020_06.models.PhoneticEncoder - :param replace_original_tokens: A value indicating whether encoded tokens should replace - original tokens. If false, encoded tokens are added as synonyms. Default is true. - :type replace_original_tokens: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'encoder': {'key': 'encoder', 'type': 'str'}, - 'replace_original_tokens': {'key': 'replace', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - encoder: Optional[Union[str, "PhoneticEncoder"]] = None, - replace_original_tokens: Optional[bool] = True, - **kwargs - ): - super(PhoneticTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.PhoneticTokenFilter' # type: str - self.encoder = encoder - self.replace_original_tokens = replace_original_tokens - - -class RequestOptions(msrest.serialization.Model): - """Parameter group. - - :param x_ms_client_request_id: The tracking ID sent with the request to help with debugging. - :type x_ms_client_request_id: str - """ - - _attribute_map = { - 'x_ms_client_request_id': {'key': 'x-ms-client-request-id', 'type': 'str'}, - } - - def __init__( - self, - *, - x_ms_client_request_id: Optional[str] = None, - **kwargs - ): - super(RequestOptions, self).__init__(**kwargs) - self.x_ms_client_request_id = x_ms_client_request_id - - -class ResourceCounter(msrest.serialization.Model): - """Represents a resource's usage and quota. - - All required parameters must be populated in order to send to Azure. - - :param usage: Required. The resource usage amount. - :type usage: long - :param quota: The resource amount quota. - :type quota: long - """ - - _validation = { - 'usage': {'required': True}, - } - - _attribute_map = { - 'usage': {'key': 'usage', 'type': 'long'}, - 'quota': {'key': 'quota', 'type': 'long'}, - } - - def __init__( - self, - *, - usage: int, - quota: Optional[int] = None, - **kwargs - ): - super(ResourceCounter, self).__init__(**kwargs) - self.usage = usage - self.quota = quota - - -class ScoringProfile(msrest.serialization.Model): - """Defines parameters for a search index that influence scoring in search queries. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the scoring profile. - :type name: str - :param text_weights: Parameters that boost scoring based on text matches in certain index - fields. - :type text_weights: ~azure.search.documents.indexes.v2020_06.models.TextWeights - :param functions: The collection of functions that influence the scoring of documents. - :type functions: list[~azure.search.documents.indexes.v2020_06.models.ScoringFunction] - :param function_aggregation: A value indicating how the results of individual scoring functions - should be combined. Defaults to "Sum". Ignored if there are no scoring functions. Possible - values include: "sum", "average", "minimum", "maximum", "firstMatching". - :type function_aggregation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionAggregation - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'text_weights': {'key': 'text', 'type': 'TextWeights'}, - 'functions': {'key': 'functions', 'type': '[ScoringFunction]'}, - 'function_aggregation': {'key': 'functionAggregation', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - text_weights: Optional["TextWeights"] = None, - functions: Optional[List["ScoringFunction"]] = None, - function_aggregation: Optional[Union[str, "ScoringFunctionAggregation"]] = None, - **kwargs - ): - super(ScoringProfile, self).__init__(**kwargs) - self.name = name - self.text_weights = text_weights - self.functions = functions - self.function_aggregation = function_aggregation - - -class SearchError(msrest.serialization.Model): - """Describes an error condition for the Azure Cognitive Search API. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar code: One of a server-defined set of error codes. - :vartype code: str - :ivar message: Required. A human-readable representation of the error. - :vartype message: str - :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.search.documents.indexes.v2020_06.models.SearchError] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'required': True, 'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[SearchError]'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchError, self).__init__(**kwargs) - self.code = None - self.message = None - self.details = None - - -class SearchField(msrest.serialization.Model): - """Represents a field in an index definition, which describes the name, data type, and search behavior of a field. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the field, which must be unique within the fields collection - of the index or parent field. - :type name: str - :param type: Required. The data type of the field. Possible values include: "Edm.String", - "Edm.Int32", "Edm.Int64", "Edm.Double", "Edm.Boolean", "Edm.DateTimeOffset", - "Edm.GeographyPoint", "Edm.ComplexType". - :type type: str or ~azure.search.documents.indexes.v2020_06.models.SearchFieldDataType - :param key: A value indicating whether the field uniquely identifies documents in the index. - Exactly one top-level field in each index must be chosen as the key field and it must be of - type Edm.String. Key fields can be used to look up documents directly and update or delete - specific documents. Default is false for simple fields and null for complex fields. - :type key: bool - :param retrievable: A value indicating whether the field can be returned in a search result. - You can disable this option if you want to use a field (for example, margin) as a filter, - sorting, or scoring mechanism but do not want the field to be visible to the end user. This - property must be true for key fields, and it must be null for complex fields. This property can - be changed on existing fields. Enabling this property does not cause any increase in index - storage requirements. Default is true for simple fields and null for complex fields. - :type retrievable: bool - :param searchable: A value indicating whether the field is full-text searchable. This means it - will undergo analysis such as word-breaking during indexing. If you set a searchable field to a - value like "sunny day", internally it will be split into the individual tokens "sunny" and - "day". This enables full-text searches for these terms. Fields of type Edm.String or - Collection(Edm.String) are searchable by default. This property must be false for simple fields - of other non-string data types, and it must be null for complex fields. Note: searchable fields - consume extra space in your index since Azure Cognitive Search will store an additional - tokenized version of the field value for full-text searches. If you want to save space in your - index and you don't need a field to be included in searches, set searchable to false. - :type searchable: bool - :param filterable: A value indicating whether to enable the field to be referenced in $filter - queries. filterable differs from searchable in how strings are handled. Fields of type - Edm.String or Collection(Edm.String) that are filterable do not undergo word-breaking, so - comparisons are for exact matches only. For example, if you set such a field f to "sunny day", - $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' will. This property - must be null for complex fields. Default is true for simple fields and null for complex fields. - :type filterable: bool - :param sortable: A value indicating whether to enable the field to be referenced in $orderby - expressions. By default Azure Cognitive Search sorts results by score, but in many experiences - users will want to sort by fields in the documents. A simple field can be sortable only if it - is single-valued (it has a single value in the scope of the parent document). Simple collection - fields cannot be sortable, since they are multi-valued. Simple sub-fields of complex - collections are also multi-valued, and therefore cannot be sortable. This is true whether it's - an immediate parent field, or an ancestor field, that's the complex collection. Complex fields - cannot be sortable and the sortable property must be null for such fields. The default for - sortable is true for single-valued simple fields, false for multi-valued simple fields, and - null for complex fields. - :type sortable: bool - :param facetable: A value indicating whether to enable the field to be referenced in facet - queries. Typically used in a presentation of search results that includes hit count by category - (for example, search for digital cameras and see hits by brand, by megapixels, by price, and so - on). This property must be null for complex fields. Fields of type Edm.GeographyPoint or - Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all other simple - fields. - :type facetable: bool - :param analyzer: The name of the analyzer to use for the field. This option can be used only - with searchable fields and it can't be set together with either searchAnalyzer or - indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null - for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", - "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- - Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", - "cs.microsoft", "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", - "en.microsoft", "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", - "fr.lucene", "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", - "gu.microsoft", "he.microsoft", "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", - "is.microsoft", "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", - "ja.microsoft", "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", - "lv.lucene", "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", - "no.lucene", "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt- - PT.microsoft", "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", - "ru.lucene", "sr-cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", - "es.microsoft", "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", - "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", - "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", - "simple", "stop", "whitespace". - :type analyzer: str or ~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzerName - :param search_analyzer: The name of the analyzer used at search time for the field. This option - can be used only with searchable fields. It must be set together with indexAnalyzer and it - cannot be set together with the analyzer option. This property cannot be set to the name of a - language analyzer; use the analyzer property instead if you need a language analyzer. This - analyzer can be updated on an existing field. Must be null for complex fields. Possible values - include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", - "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", "zh- - Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", "da.microsoft", - "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", "en.lucene", "et.microsoft", - "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", "gl.lucene", "de.microsoft", - "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", "he.microsoft", "hi.microsoft", - "hi.lucene", "hu.microsoft", "hu.lucene", "is.microsoft", "id.microsoft", "id.lucene", - "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", "ja.lucene", "kn.microsoft", - "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", "lt.microsoft", "ml.microsoft", - "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", "fa.lucene", "pl.microsoft", - "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", "pt-PT.lucene", - "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr- - cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", - "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", - "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", - "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", - "whitespace". - :type search_analyzer: str or - ~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzerName - :param index_analyzer: The name of the analyzer used at indexing time for the field. This - option can be used only with searchable fields. It must be set together with searchAnalyzer and - it cannot be set together with the analyzer option. This property cannot be set to the name of - a language analyzer; use the analyzer property instead if you need a language analyzer. Once - the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. - Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", - "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh- - Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", - "cs.lucene", "da.microsoft", "da.lucene", "nl.microsoft", "nl.lucene", "en.microsoft", - "en.lucene", "et.microsoft", "fi.microsoft", "fi.lucene", "fr.microsoft", "fr.lucene", - "gl.lucene", "de.microsoft", "de.lucene", "el.microsoft", "el.lucene", "gu.microsoft", - "he.microsoft", "hi.microsoft", "hi.lucene", "hu.microsoft", "hu.lucene", "is.microsoft", - "id.microsoft", "id.lucene", "ga.lucene", "it.microsoft", "it.lucene", "ja.microsoft", - "ja.lucene", "kn.microsoft", "ko.microsoft", "ko.lucene", "lv.microsoft", "lv.lucene", - "lt.microsoft", "ml.microsoft", "ms.microsoft", "mr.microsoft", "nb.microsoft", "no.lucene", - "fa.lucene", "pl.microsoft", "pl.lucene", "pt-BR.microsoft", "pt-BR.lucene", "pt-PT.microsoft", - "pt-PT.lucene", "pa.microsoft", "ro.microsoft", "ro.lucene", "ru.microsoft", "ru.lucene", "sr- - cyrillic.microsoft", "sr-latin.microsoft", "sk.microsoft", "sl.microsoft", "es.microsoft", - "es.lucene", "sv.microsoft", "sv.lucene", "ta.microsoft", "te.microsoft", "th.microsoft", - "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", - "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", - "whitespace". - :type index_analyzer: str or - ~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzerName - :param synonym_maps: A list of the names of synonym maps to associate with this field. This - option can be used only with searchable fields. Currently only one synonym map per field is - supported. Assigning a synonym map to a field ensures that query terms targeting that field are - expanded at query-time using the rules in the synonym map. This attribute can be changed on - existing fields. Must be null or an empty collection for complex fields. - :type synonym_maps: list[str] - :param fields: A list of sub-fields if this is a field of type Edm.ComplexType or - Collection(Edm.ComplexType). Must be null or empty for simple fields. - :type fields: list[~azure.search.documents.indexes.v2020_06.models.SearchField] - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'bool'}, - 'retrievable': {'key': 'retrievable', 'type': 'bool'}, - 'searchable': {'key': 'searchable', 'type': 'bool'}, - 'filterable': {'key': 'filterable', 'type': 'bool'}, - 'sortable': {'key': 'sortable', 'type': 'bool'}, - 'facetable': {'key': 'facetable', 'type': 'bool'}, - 'analyzer': {'key': 'analyzer', 'type': 'str'}, - 'search_analyzer': {'key': 'searchAnalyzer', 'type': 'str'}, - 'index_analyzer': {'key': 'indexAnalyzer', 'type': 'str'}, - 'synonym_maps': {'key': 'synonymMaps', 'type': '[str]'}, - 'fields': {'key': 'fields', 'type': '[SearchField]'}, - } - - def __init__( - self, - *, - name: str, - type: Union[str, "SearchFieldDataType"], - key: Optional[bool] = None, - retrievable: Optional[bool] = None, - searchable: Optional[bool] = None, - filterable: Optional[bool] = None, - sortable: Optional[bool] = None, - facetable: Optional[bool] = None, - analyzer: Optional[Union[str, "LexicalAnalyzerName"]] = None, - search_analyzer: Optional[Union[str, "LexicalAnalyzerName"]] = None, - index_analyzer: Optional[Union[str, "LexicalAnalyzerName"]] = None, - synonym_maps: Optional[List[str]] = None, - fields: Optional[List["SearchField"]] = None, - **kwargs - ): - super(SearchField, self).__init__(**kwargs) - self.name = name - self.type = type - self.key = key - self.retrievable = retrievable - self.searchable = searchable - self.filterable = filterable - self.sortable = sortable - self.facetable = facetable - self.analyzer = analyzer - self.search_analyzer = search_analyzer - self.index_analyzer = index_analyzer - self.synonym_maps = synonym_maps - self.fields = fields - - -class SearchIndex(msrest.serialization.Model): - """Represents a search index definition, which describes the fields and search behavior of an index. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the index. - :type name: str - :param fields: Required. The fields of the index. - :type fields: list[~azure.search.documents.indexes.v2020_06.models.SearchField] - :param scoring_profiles: The scoring profiles for the index. - :type scoring_profiles: list[~azure.search.documents.indexes.v2020_06.models.ScoringProfile] - :param default_scoring_profile: The name of the scoring profile to use if none is specified in - the query. If this property is not set and no scoring profile is specified in the query, then - default scoring (tf-idf) will be used. - :type default_scoring_profile: str - :param cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. - :type cors_options: ~azure.search.documents.indexes.v2020_06.models.CorsOptions - :param suggesters: The suggesters for the index. - :type suggesters: list[~azure.search.documents.indexes.v2020_06.models.Suggester] - :param analyzers: The analyzers for the index. - :type analyzers: list[~azure.search.documents.indexes.v2020_06.models.LexicalAnalyzer] - :param tokenizers: The tokenizers for the index. - :type tokenizers: list[~azure.search.documents.indexes.v2020_06.models.LexicalTokenizer] - :param token_filters: The token filters for the index. - :type token_filters: list[~azure.search.documents.indexes.v2020_06.models.TokenFilter] - :param char_filters: The character filters for the index. - :type char_filters: list[~azure.search.documents.indexes.v2020_06.models.CharFilter] - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your data when you - want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive - Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive - Search will ignore attempts to set this property to null. You can change this property as - needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with - customer-managed keys is not available for free search services, and is only available for paid - services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - :param similarity: The type of similarity algorithm to be used when scoring and ranking the - documents matching a search query. The similarity algorithm can only be defined at index - creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity - algorithm is used. - :type similarity: ~azure.search.documents.indexes.v2020_06.models.Similarity - :param e_tag: The ETag of the index. - :type e_tag: str - """ - - _validation = { - 'name': {'required': True}, - 'fields': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'fields': {'key': 'fields', 'type': '[SearchField]'}, - 'scoring_profiles': {'key': 'scoringProfiles', 'type': '[ScoringProfile]'}, - 'default_scoring_profile': {'key': 'defaultScoringProfile', 'type': 'str'}, - 'cors_options': {'key': 'corsOptions', 'type': 'CorsOptions'}, - 'suggesters': {'key': 'suggesters', 'type': '[Suggester]'}, - 'analyzers': {'key': 'analyzers', 'type': '[LexicalAnalyzer]'}, - 'tokenizers': {'key': 'tokenizers', 'type': '[LexicalTokenizer]'}, - 'token_filters': {'key': 'tokenFilters', 'type': '[TokenFilter]'}, - 'char_filters': {'key': 'charFilters', 'type': '[CharFilter]'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - 'similarity': {'key': 'similarity', 'type': 'Similarity'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - fields: List["SearchField"], - scoring_profiles: Optional[List["ScoringProfile"]] = None, - default_scoring_profile: Optional[str] = None, - cors_options: Optional["CorsOptions"] = None, - suggesters: Optional[List["Suggester"]] = None, - analyzers: Optional[List["LexicalAnalyzer"]] = None, - tokenizers: Optional[List["LexicalTokenizer"]] = None, - token_filters: Optional[List["TokenFilter"]] = None, - char_filters: Optional[List["CharFilter"]] = None, - encryption_key: Optional["SearchResourceEncryptionKey"] = None, - similarity: Optional["Similarity"] = None, - e_tag: Optional[str] = None, - **kwargs - ): - super(SearchIndex, self).__init__(**kwargs) - self.name = name - self.fields = fields - self.scoring_profiles = scoring_profiles - self.default_scoring_profile = default_scoring_profile - self.cors_options = cors_options - self.suggesters = suggesters - self.analyzers = analyzers - self.tokenizers = tokenizers - self.token_filters = token_filters - self.char_filters = char_filters - self.encryption_key = encryption_key - self.similarity = similarity - self.e_tag = e_tag - - -class SearchIndexer(msrest.serialization.Model): - """Represents an indexer. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the indexer. - :type name: str - :param description: The description of the indexer. - :type description: str - :param data_source_name: Required. The name of the datasource from which this indexer reads - data. - :type data_source_name: str - :param skillset_name: The name of the skillset executing with this indexer. - :type skillset_name: str - :param target_index_name: Required. The name of the index to which this indexer writes data. - :type target_index_name: str - :param schedule: The schedule for this indexer. - :type schedule: ~azure.search.documents.indexes.v2020_06.models.IndexingSchedule - :param parameters: Parameters for indexer execution. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.IndexingParameters - :param field_mappings: Defines mappings between fields in the data source and corresponding - target fields in the index. - :type field_mappings: list[~azure.search.documents.indexes.v2020_06.models.FieldMapping] - :param output_field_mappings: Output field mappings are applied after enrichment and - immediately before indexing. - :type output_field_mappings: list[~azure.search.documents.indexes.v2020_06.models.FieldMapping] - :param is_disabled: A value indicating whether the indexer is disabled. Default is false. - :type is_disabled: bool - :param e_tag: The ETag of the indexer. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your indexer - definition (as well as indexer execution status) when you want full assurance that no one, not - even Microsoft, can decrypt them in Azure Cognitive Search. Once you have encrypted your - indexer definition, it will always remain encrypted. Azure Cognitive Search will ignore - attempts to set this property to null. You can change this property as needed if you want to - rotate your encryption key; Your indexer definition (and indexer execution status) will be - unaffected. Encryption with customer-managed keys is not available for free search services, - and is only available for paid services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - """ - - _validation = { - 'name': {'required': True}, - 'data_source_name': {'required': True}, - 'target_index_name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, - 'skillset_name': {'key': 'skillsetName', 'type': 'str'}, - 'target_index_name': {'key': 'targetIndexName', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'IndexingSchedule'}, - 'parameters': {'key': 'parameters', 'type': 'IndexingParameters'}, - 'field_mappings': {'key': 'fieldMappings', 'type': '[FieldMapping]'}, - 'output_field_mappings': {'key': 'outputFieldMappings', 'type': '[FieldMapping]'}, - 'is_disabled': {'key': 'disabled', 'type': 'bool'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - } - - def __init__( - self, - *, - name: str, - data_source_name: str, - target_index_name: str, - description: Optional[str] = None, - skillset_name: Optional[str] = None, - schedule: Optional["IndexingSchedule"] = None, - parameters: Optional["IndexingParameters"] = None, - field_mappings: Optional[List["FieldMapping"]] = None, - output_field_mappings: Optional[List["FieldMapping"]] = None, - is_disabled: Optional[bool] = False, - e_tag: Optional[str] = None, - encryption_key: Optional["SearchResourceEncryptionKey"] = None, - **kwargs - ): - super(SearchIndexer, self).__init__(**kwargs) - self.name = name - self.description = description - self.data_source_name = data_source_name - self.skillset_name = skillset_name - self.target_index_name = target_index_name - self.schedule = schedule - self.parameters = parameters - self.field_mappings = field_mappings - self.output_field_mappings = output_field_mappings - self.is_disabled = is_disabled - self.e_tag = e_tag - self.encryption_key = encryption_key - - -class SearchIndexerDataContainer(msrest.serialization.Model): - """Represents information about the entity (such as Azure SQL table or CosmosDB collection) that will be indexed. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the table or view (for Azure SQL data source) or collection - (for CosmosDB data source) that will be indexed. - :type name: str - :param query: A query that is applied to this data container. The syntax and meaning of this - parameter is datasource-specific. Not supported by Azure SQL datasources. - :type query: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'query': {'key': 'query', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - query: Optional[str] = None, - **kwargs - ): - super(SearchIndexerDataContainer, self).__init__(**kwargs) - self.name = name - self.query = query - - -class SearchIndexerDataSource(msrest.serialization.Model): - """Represents a datasource definition, which can be used to configure an indexer. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the datasource. - :type name: str - :param description: The description of the datasource. - :type description: str - :param type: Required. The type of the datasource. Possible values include: "azuresql", - "cosmosdb", "azureblob", "azuretable", "mysql", "adlsgen2". - :type type: str or ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSourceType - :param credentials: Required. Credentials for the datasource. - :type credentials: ~azure.search.documents.indexes.v2020_06.models.DataSourceCredentials - :param container: Required. The data container for the datasource. - :type container: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataContainer - :param data_change_detection_policy: The data change detection policy for the datasource. - :type data_change_detection_policy: - ~azure.search.documents.indexes.v2020_06.models.DataChangeDetectionPolicy - :param data_deletion_detection_policy: The data deletion detection policy for the datasource. - :type data_deletion_detection_policy: - ~azure.search.documents.indexes.v2020_06.models.DataDeletionDetectionPolicy - :param e_tag: The ETag of the data source. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your datasource - definition when you want full assurance that no one, not even Microsoft, can decrypt your data - source definition in Azure Cognitive Search. Once you have encrypted your data source - definition, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set - this property to null. You can change this property as needed if you want to rotate your - encryption key; Your datasource definition will be unaffected. Encryption with customer-managed - keys is not available for free search services, and is only available for paid services created - on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True}, - 'credentials': {'required': True}, - 'container': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'DataSourceCredentials'}, - 'container': {'key': 'container', 'type': 'SearchIndexerDataContainer'}, - 'data_change_detection_policy': {'key': 'dataChangeDetectionPolicy', 'type': 'DataChangeDetectionPolicy'}, - 'data_deletion_detection_policy': {'key': 'dataDeletionDetectionPolicy', 'type': 'DataDeletionDetectionPolicy'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - } - - def __init__( - self, - *, - name: str, - type: Union[str, "SearchIndexerDataSourceType"], - credentials: "DataSourceCredentials", - container: "SearchIndexerDataContainer", - description: Optional[str] = None, - data_change_detection_policy: Optional["DataChangeDetectionPolicy"] = None, - data_deletion_detection_policy: Optional["DataDeletionDetectionPolicy"] = None, - e_tag: Optional[str] = None, - encryption_key: Optional["SearchResourceEncryptionKey"] = None, - **kwargs - ): - super(SearchIndexerDataSource, self).__init__(**kwargs) - self.name = name - self.description = description - self.type = type - self.credentials = credentials - self.container = container - self.data_change_detection_policy = data_change_detection_policy - self.data_deletion_detection_policy = data_deletion_detection_policy - self.e_tag = e_tag - self.encryption_key = encryption_key - - -class SearchIndexerError(msrest.serialization.Model): - """Represents an item- or document-level indexing error. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar key: The key of the item for which indexing failed. - :vartype key: str - :ivar error_message: Required. The message describing the error that occurred while processing - the item. - :vartype error_message: str - :ivar status_code: Required. The status code indicating why the indexing operation failed. - Possible values include: 400 for a malformed input document, 404 for document not found, 409 - for a version conflict, 422 when the index is temporarily unavailable, or 503 for when the - service is too busy. - :vartype status_code: int - :ivar name: The name of the source at which the error originated. For example, this could refer - to a particular skill in the attached skillset. This may not be always available. - :vartype name: str - :ivar details: Additional, verbose details about the error to assist in debugging the indexer. - This may not be always available. - :vartype details: str - :ivar documentation_link: A link to a troubleshooting guide for these classes of errors. This - may not be always available. - :vartype documentation_link: str - """ - - _validation = { - 'key': {'readonly': True}, - 'error_message': {'required': True, 'readonly': True}, - 'status_code': {'required': True, 'readonly': True}, - 'name': {'readonly': True}, - 'details': {'readonly': True}, - 'documentation_link': {'readonly': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - 'documentation_link': {'key': 'documentationLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerError, self).__init__(**kwargs) - self.key = None - self.error_message = None - self.status_code = None - self.name = None - self.details = None - self.documentation_link = None - - -class SearchIndexerLimits(msrest.serialization.Model): - """SearchIndexerLimits. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar max_run_time: The maximum duration that the indexer is permitted to run for one - execution. - :vartype max_run_time: ~datetime.timedelta - :ivar max_document_extraction_size: The maximum size of a document, in bytes, which will be - considered valid for indexing. - :vartype max_document_extraction_size: long - :ivar max_document_content_characters_to_extract: The maximum number of characters that will be - extracted from a document picked up for indexing. - :vartype max_document_content_characters_to_extract: long - """ - - _validation = { - 'max_run_time': {'readonly': True}, - 'max_document_extraction_size': {'readonly': True}, - 'max_document_content_characters_to_extract': {'readonly': True}, - } - - _attribute_map = { - 'max_run_time': {'key': 'maxRunTime', 'type': 'duration'}, - 'max_document_extraction_size': {'key': 'maxDocumentExtractionSize', 'type': 'long'}, - 'max_document_content_characters_to_extract': {'key': 'maxDocumentContentCharactersToExtract', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerLimits, self).__init__(**kwargs) - self.max_run_time = None - self.max_document_extraction_size = None - self.max_document_content_characters_to_extract = None - - -class SearchIndexerSkillset(msrest.serialization.Model): - """A list of skills. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the skillset. - :type name: str - :param description: The description of the skillset. - :type description: str - :param skills: Required. A list of skills in the skillset. - :type skills: list[~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkill] - :param cognitive_services_account: Details about cognitive services to be used when running - skills. - :type cognitive_services_account: - ~azure.search.documents.indexes.v2020_06.models.CognitiveServicesAccount - :param e_tag: The ETag of the skillset. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your skillset - definition when you want full assurance that no one, not even Microsoft, can decrypt your - skillset definition in Azure Cognitive Search. Once you have encrypted your skillset - definition, it will always remain encrypted. Azure Cognitive Search will ignore attempts to set - this property to null. You can change this property as needed if you want to rotate your - encryption key; Your skillset definition will be unaffected. Encryption with customer-managed - keys is not available for free search services, and is only available for paid services created - on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - """ - - _validation = { - 'name': {'required': True}, - 'skills': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'skills': {'key': 'skills', 'type': '[SearchIndexerSkill]'}, - 'cognitive_services_account': {'key': 'cognitiveServices', 'type': 'CognitiveServicesAccount'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - } - - def __init__( - self, - *, - name: str, - skills: List["SearchIndexerSkill"], - description: Optional[str] = None, - cognitive_services_account: Optional["CognitiveServicesAccount"] = None, - e_tag: Optional[str] = None, - encryption_key: Optional["SearchResourceEncryptionKey"] = None, - **kwargs - ): - super(SearchIndexerSkillset, self).__init__(**kwargs) - self.name = name - self.description = description - self.skills = skills - self.cognitive_services_account = cognitive_services_account - self.e_tag = e_tag - self.encryption_key = encryption_key - - -class SearchIndexerStatus(msrest.serialization.Model): - """Represents the current status and execution history of an indexer. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar status: Required. Overall indexer status. Possible values include: "unknown", "error", - "running". - :vartype status: str or ~azure.search.documents.indexes.v2020_06.models.IndexerStatus - :ivar last_result: The result of the most recent or an in-progress indexer execution. - :vartype last_result: ~azure.search.documents.indexes.v2020_06.models.IndexerExecutionResult - :ivar execution_history: Required. History of the recent indexer executions, sorted in reverse - chronological order. - :vartype execution_history: - list[~azure.search.documents.indexes.v2020_06.models.IndexerExecutionResult] - :ivar limits: Required. The execution limits for the indexer. - :vartype limits: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerLimits - """ - - _validation = { - 'status': {'required': True, 'readonly': True}, - 'last_result': {'readonly': True}, - 'execution_history': {'required': True, 'readonly': True}, - 'limits': {'required': True, 'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'last_result': {'key': 'lastResult', 'type': 'IndexerExecutionResult'}, - 'execution_history': {'key': 'executionHistory', 'type': '[IndexerExecutionResult]'}, - 'limits': {'key': 'limits', 'type': 'SearchIndexerLimits'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerStatus, self).__init__(**kwargs) - self.status = None - self.last_result = None - self.execution_history = None - self.limits = None - - -class SearchIndexerWarning(msrest.serialization.Model): - """Represents an item-level warning. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar key: The key of the item which generated a warning. - :vartype key: str - :ivar message: Required. The message describing the warning that occurred while processing the - item. - :vartype message: str - :ivar name: The name of the source at which the warning originated. For example, this could - refer to a particular skill in the attached skillset. This may not be always available. - :vartype name: str - :ivar details: Additional, verbose details about the warning to assist in debugging the - indexer. This may not be always available. - :vartype details: str - :ivar documentation_link: A link to a troubleshooting guide for these classes of warnings. This - may not be always available. - :vartype documentation_link: str - """ - - _validation = { - 'key': {'readonly': True}, - 'message': {'required': True, 'readonly': True}, - 'name': {'readonly': True}, - 'details': {'readonly': True}, - 'documentation_link': {'readonly': True}, - } - - _attribute_map = { - 'key': {'key': 'key', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - 'documentation_link': {'key': 'documentationLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SearchIndexerWarning, self).__init__(**kwargs) - self.key = None - self.message = None - self.name = None - self.details = None - self.documentation_link = None - - -class SearchResourceEncryptionKey(msrest.serialization.Model): - """A customer-managed encryption key in Azure Key Vault. Keys that you create and manage can be used to encrypt or decrypt data-at-rest in Azure Cognitive Search, such as indexes and synonym maps. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of your Azure Key Vault key to be used to encrypt your data - at rest. - :type key_name: str - :param key_version: Required. The version of your Azure Key Vault key to be used to encrypt - your data at rest. - :type key_version: str - :param vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, that - contains the key to be used to encrypt your data at rest. An example URI might be https://my- - keyvault-name.vault.azure.net. - :type vault_uri: str - :param access_credentials: Optional Azure Active Directory credentials used for accessing your - Azure Key Vault. Not required if using managed identity instead. - :type access_credentials: - ~azure.search.documents.indexes.v2020_06.models.AzureActiveDirectoryApplicationCredentials - """ - - _validation = { - 'key_name': {'required': True}, - 'key_version': {'required': True}, - 'vault_uri': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyVaultKeyName', 'type': 'str'}, - 'key_version': {'key': 'keyVaultKeyVersion', 'type': 'str'}, - 'vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, - 'access_credentials': {'key': 'accessCredentials', 'type': 'AzureActiveDirectoryApplicationCredentials'}, - } - - def __init__( - self, - *, - key_name: str, - key_version: str, - vault_uri: str, - access_credentials: Optional["AzureActiveDirectoryApplicationCredentials"] = None, - **kwargs - ): - super(SearchResourceEncryptionKey, self).__init__(**kwargs) - self.key_name = key_name - self.key_version = key_version - self.vault_uri = vault_uri - self.access_credentials = access_credentials - - -class SentimentSkill(SearchIndexerSkill): - """Text analytics positive-negative sentiment analysis, scored as a floating point value in a range of zero to 1. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "nl", "en", "fi", "fr", "de", "el", "it", "no", "pl", "pt-PT", - "ru", "es", "sv", "tr". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.SentimentSkillLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - default_language_code: Optional[Union[str, "SentimentSkillLanguage"]] = None, - **kwargs - ): - super(SentimentSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Text.SentimentSkill' # type: str - self.default_language_code = default_language_code - - -class ServiceCounters(msrest.serialization.Model): - """Represents service-level resource counters and quotas. - - All required parameters must be populated in order to send to Azure. - - :param document_counter: Required. Total number of documents across all indexes in the service. - :type document_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param index_counter: Required. Total number of indexes. - :type index_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param indexer_counter: Required. Total number of indexers. - :type indexer_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param data_source_counter: Required. Total number of data sources. - :type data_source_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param storage_size_counter: Required. Total size of used storage in bytes. - :type storage_size_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - :param synonym_map_counter: Required. Total number of synonym maps. - :type synonym_map_counter: ~azure.search.documents.indexes.v2020_06.models.ResourceCounter - """ - - _validation = { - 'document_counter': {'required': True}, - 'index_counter': {'required': True}, - 'indexer_counter': {'required': True}, - 'data_source_counter': {'required': True}, - 'storage_size_counter': {'required': True}, - 'synonym_map_counter': {'required': True}, - } - - _attribute_map = { - 'document_counter': {'key': 'documentCount', 'type': 'ResourceCounter'}, - 'index_counter': {'key': 'indexesCount', 'type': 'ResourceCounter'}, - 'indexer_counter': {'key': 'indexersCount', 'type': 'ResourceCounter'}, - 'data_source_counter': {'key': 'dataSourcesCount', 'type': 'ResourceCounter'}, - 'storage_size_counter': {'key': 'storageSize', 'type': 'ResourceCounter'}, - 'synonym_map_counter': {'key': 'synonymMaps', 'type': 'ResourceCounter'}, - } - - def __init__( - self, - *, - document_counter: "ResourceCounter", - index_counter: "ResourceCounter", - indexer_counter: "ResourceCounter", - data_source_counter: "ResourceCounter", - storage_size_counter: "ResourceCounter", - synonym_map_counter: "ResourceCounter", - **kwargs - ): - super(ServiceCounters, self).__init__(**kwargs) - self.document_counter = document_counter - self.index_counter = index_counter - self.indexer_counter = indexer_counter - self.data_source_counter = data_source_counter - self.storage_size_counter = storage_size_counter - self.synonym_map_counter = synonym_map_counter - - -class ServiceLimits(msrest.serialization.Model): - """Represents various service level limits. - - :param max_fields_per_index: The maximum allowed fields per index. - :type max_fields_per_index: int - :param max_field_nesting_depth_per_index: The maximum depth which you can nest sub-fields in an - index, including the top-level complex field. For example, a/b/c has a nesting depth of 3. - :type max_field_nesting_depth_per_index: int - :param max_complex_collection_fields_per_index: The maximum number of fields of type - Collection(Edm.ComplexType) allowed in an index. - :type max_complex_collection_fields_per_index: int - :param max_complex_objects_in_collections_per_document: The maximum number of objects in - complex collections allowed per document. - :type max_complex_objects_in_collections_per_document: int - """ - - _attribute_map = { - 'max_fields_per_index': {'key': 'maxFieldsPerIndex', 'type': 'int'}, - 'max_field_nesting_depth_per_index': {'key': 'maxFieldNestingDepthPerIndex', 'type': 'int'}, - 'max_complex_collection_fields_per_index': {'key': 'maxComplexCollectionFieldsPerIndex', 'type': 'int'}, - 'max_complex_objects_in_collections_per_document': {'key': 'maxComplexObjectsInCollectionsPerDocument', 'type': 'int'}, - } - - def __init__( - self, - *, - max_fields_per_index: Optional[int] = None, - max_field_nesting_depth_per_index: Optional[int] = None, - max_complex_collection_fields_per_index: Optional[int] = None, - max_complex_objects_in_collections_per_document: Optional[int] = None, - **kwargs - ): - super(ServiceLimits, self).__init__(**kwargs) - self.max_fields_per_index = max_fields_per_index - self.max_field_nesting_depth_per_index = max_field_nesting_depth_per_index - self.max_complex_collection_fields_per_index = max_complex_collection_fields_per_index - self.max_complex_objects_in_collections_per_document = max_complex_objects_in_collections_per_document - - -class ServiceStatistics(msrest.serialization.Model): - """Response from a get service statistics request. If successful, it includes service level counters and limits. - - All required parameters must be populated in order to send to Azure. - - :param counters: Required. Service level resource counters. - :type counters: ~azure.search.documents.indexes.v2020_06.models.ServiceCounters - :param limits: Required. Service level general limits. - :type limits: ~azure.search.documents.indexes.v2020_06.models.ServiceLimits - """ - - _validation = { - 'counters': {'required': True}, - 'limits': {'required': True}, - } - - _attribute_map = { - 'counters': {'key': 'counters', 'type': 'ServiceCounters'}, - 'limits': {'key': 'limits', 'type': 'ServiceLimits'}, - } - - def __init__( - self, - *, - counters: "ServiceCounters", - limits: "ServiceLimits", - **kwargs - ): - super(ServiceStatistics, self).__init__(**kwargs) - self.counters = counters - self.limits = limits - - -class ShaperSkill(SearchIndexerSkill): - """A skill for reshaping the outputs. It creates a complex type to support composite fields (also known as multipart fields). - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - **kwargs - ): - super(ShaperSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Util.ShaperSkill' # type: str - - -class ShingleTokenFilter(TokenFilter): - """Creates combinations of tokens as a single token. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param max_shingle_size: The maximum shingle size. Default and minimum value is 2. - :type max_shingle_size: int - :param min_shingle_size: The minimum shingle size. Default and minimum value is 2. Must be less - than the value of maxShingleSize. - :type min_shingle_size: int - :param output_unigrams: A value indicating whether the output stream will contain the input - tokens (unigrams) as well as shingles. Default is true. - :type output_unigrams: bool - :param output_unigrams_if_no_shingles: A value indicating whether to output unigrams for those - times when no shingles are available. This property takes precedence when outputUnigrams is set - to false. Default is false. - :type output_unigrams_if_no_shingles: bool - :param token_separator: The string to use when joining adjacent tokens to form a shingle. - Default is a single space (" "). - :type token_separator: str - :param filter_token: The string to insert for each position at which there is no token. Default - is an underscore ("_"). - :type filter_token: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_shingle_size': {'minimum': 2}, - 'min_shingle_size': {'minimum': 2}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_shingle_size': {'key': 'maxShingleSize', 'type': 'int'}, - 'min_shingle_size': {'key': 'minShingleSize', 'type': 'int'}, - 'output_unigrams': {'key': 'outputUnigrams', 'type': 'bool'}, - 'output_unigrams_if_no_shingles': {'key': 'outputUnigramsIfNoShingles', 'type': 'bool'}, - 'token_separator': {'key': 'tokenSeparator', 'type': 'str'}, - 'filter_token': {'key': 'filterToken', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - max_shingle_size: Optional[int] = 2, - min_shingle_size: Optional[int] = 2, - output_unigrams: Optional[bool] = True, - output_unigrams_if_no_shingles: Optional[bool] = False, - token_separator: Optional[str] = " ", - filter_token: Optional[str] = "_", - **kwargs - ): - super(ShingleTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.ShingleTokenFilter' # type: str - self.max_shingle_size = max_shingle_size - self.min_shingle_size = min_shingle_size - self.output_unigrams = output_unigrams - self.output_unigrams_if_no_shingles = output_unigrams_if_no_shingles - self.token_separator = token_separator - self.filter_token = filter_token - - -class SnowballTokenFilter(TokenFilter): - """A filter that stems words using a Snowball-generated stemmer. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param language: Required. The language to use. Possible values include: "armenian", "basque", - "catalan", "danish", "dutch", "english", "finnish", "french", "german", "german2", "hungarian", - "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", "russian", - "spanish", "swedish", "turkish". - :type language: str or - ~azure.search.documents.indexes.v2020_06.models.SnowballTokenFilterLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'language': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - language: Union[str, "SnowballTokenFilterLanguage"], - **kwargs - ): - super(SnowballTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.SnowballTokenFilter' # type: str - self.language = language - - -class SoftDeleteColumnDeletionDetectionPolicy(DataDeletionDetectionPolicy): - """Defines a data deletion detection policy that implements a soft-deletion strategy. It determines whether an item should be deleted based on the value of a designated 'soft delete' column. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data deletion detection - policy.Constant filled by server. - :type odata_type: str - :param soft_delete_column_name: The name of the column to use for soft-deletion detection. - :type soft_delete_column_name: str - :param soft_delete_marker_value: The marker value that identifies an item as deleted. - :type soft_delete_marker_value: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'soft_delete_column_name': {'key': 'softDeleteColumnName', 'type': 'str'}, - 'soft_delete_marker_value': {'key': 'softDeleteMarkerValue', 'type': 'str'}, - } - - def __init__( - self, - *, - soft_delete_column_name: Optional[str] = None, - soft_delete_marker_value: Optional[str] = None, - **kwargs - ): - super(SoftDeleteColumnDeletionDetectionPolicy, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy' # type: str - self.soft_delete_column_name = soft_delete_column_name - self.soft_delete_marker_value = soft_delete_marker_value - - -class SplitSkill(SearchIndexerSkill): - """A skill to split a string into chunks of text. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.SplitSkillLanguage - :param text_split_mode: A value indicating which split mode to perform. Possible values - include: "pages", "sentences". - :type text_split_mode: str or ~azure.search.documents.indexes.v2020_06.models.TextSplitMode - :param maximum_page_length: The desired maximum page length. Default is 10000. - :type maximum_page_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, - 'text_split_mode': {'key': 'textSplitMode', 'type': 'str'}, - 'maximum_page_length': {'key': 'maximumPageLength', 'type': 'int'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - default_language_code: Optional[Union[str, "SplitSkillLanguage"]] = None, - text_split_mode: Optional[Union[str, "TextSplitMode"]] = None, - maximum_page_length: Optional[int] = None, - **kwargs - ): - super(SplitSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Text.SplitSkill' # type: str - self.default_language_code = default_language_code - self.text_split_mode = text_split_mode - self.maximum_page_length = maximum_page_length - - -class SqlIntegratedChangeTrackingPolicy(DataChangeDetectionPolicy): - """Defines a data change detection policy that captures changes using the Integrated Change Tracking feature of Azure SQL Database. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the data change detection - policy.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SqlIntegratedChangeTrackingPolicy, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Azure.Search.SqlIntegratedChangeTrackingPolicy' # type: str - - -class StemmerOverrideTokenFilter(TokenFilter): - """Provides the ability to override other stemming filters with custom dictionary-based stemming. Any dictionary-stemmed terms will be marked as keywords so that they will not be stemmed with stemmers down the chain. Must be placed before any stemming filters. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param rules: Required. A list of stemming rules in the following format: "word => stem", for - example: "ran => run". - :type rules: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'rules': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - rules: List[str], - **kwargs - ): - super(StemmerOverrideTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.StemmerOverrideTokenFilter' # type: str - self.rules = rules - - -class StemmerTokenFilter(TokenFilter): - """Language specific stemming filter. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param language: Required. The language to use. Possible values include: "arabic", "armenian", - "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "dutchKp", - "english", "lightEnglish", "minimalEnglish", "possessiveEnglish", "porter2", "lovins", - "finnish", "lightFinnish", "french", "lightFrench", "minimalFrench", "galician", - "minimalGalician", "german", "german2", "lightGerman", "minimalGerman", "greek", "hindi", - "hungarian", "lightHungarian", "indonesian", "irish", "italian", "lightItalian", "sorani", - "latvian", "norwegian", "lightNorwegian", "minimalNorwegian", "lightNynorsk", "minimalNynorsk", - "portuguese", "lightPortuguese", "minimalPortuguese", "portugueseRslp", "romanian", "russian", - "lightRussian", "spanish", "lightSpanish", "swedish", "lightSwedish", "turkish". - :type language: str or - ~azure.search.documents.indexes.v2020_06.models.StemmerTokenFilterLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'language': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'language': {'key': 'language', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - language: Union[str, "StemmerTokenFilterLanguage"], - **kwargs - ): - super(StemmerTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.StemmerTokenFilter' # type: str - self.language = language - - -class StopAnalyzer(LexicalAnalyzer): - """Divides text at non-letters; Applies the lowercase and stopword token filters. This analyzer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param stopwords: A list of stopwords. - :type stopwords: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'stopwords': {'key': 'stopwords', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - stopwords: Optional[List[str]] = None, - **kwargs - ): - super(StopAnalyzer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.StopAnalyzer' # type: str - self.stopwords = stopwords - - -class StopwordsTokenFilter(TokenFilter): - """Removes stop words from a token stream. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param stopwords: The list of stopwords. This property and the stopwords list property cannot - both be set. - :type stopwords: list[str] - :param stopwords_list: A predefined list of stopwords to use. This property and the stopwords - property cannot both be set. Default is English. Possible values include: "arabic", "armenian", - "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "english", - "finnish", "french", "galician", "german", "greek", "hindi", "hungarian", "indonesian", - "irish", "italian", "latvian", "norwegian", "persian", "portuguese", "romanian", "russian", - "sorani", "spanish", "swedish", "thai", "turkish". - :type stopwords_list: str or ~azure.search.documents.indexes.v2020_06.models.StopwordsList - :param ignore_case: A value indicating whether to ignore case. If true, all words are converted - to lower case first. Default is false. - :type ignore_case: bool - :param remove_trailing_stop_words: A value indicating whether to ignore the last search term if - it's a stop word. Default is true. - :type remove_trailing_stop_words: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'stopwords': {'key': 'stopwords', 'type': '[str]'}, - 'stopwords_list': {'key': 'stopwordsList', 'type': 'str'}, - 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, - 'remove_trailing_stop_words': {'key': 'removeTrailing', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - stopwords: Optional[List[str]] = None, - stopwords_list: Optional[Union[str, "StopwordsList"]] = None, - ignore_case: Optional[bool] = False, - remove_trailing_stop_words: Optional[bool] = True, - **kwargs - ): - super(StopwordsTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.StopwordsTokenFilter' # type: str - self.stopwords = stopwords - self.stopwords_list = stopwords_list - self.ignore_case = ignore_case - self.remove_trailing_stop_words = remove_trailing_stop_words - - -class Suggester(msrest.serialization.Model): - """Defines how the Suggest API should apply to a group of fields in the index. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the suggester. - :type name: str - :ivar search_mode: Required. A value indicating the capabilities of the suggester. Default - value: "analyzingInfixMatching". - :vartype search_mode: str - :param source_fields: Required. The list of field names to which the suggester applies. Each - field must be searchable. - :type source_fields: list[str] - """ - - _validation = { - 'name': {'required': True}, - 'search_mode': {'required': True, 'constant': True}, - 'source_fields': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'search_mode': {'key': 'searchMode', 'type': 'str'}, - 'source_fields': {'key': 'sourceFields', 'type': '[str]'}, - } - - search_mode = "analyzingInfixMatching" - - def __init__( - self, - *, - name: str, - source_fields: List[str], - **kwargs - ): - super(Suggester, self).__init__(**kwargs) - self.name = name - self.source_fields = source_fields - - -class SynonymMap(msrest.serialization.Model): - """Represents a synonym map definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the synonym map. - :type name: str - :ivar format: Required. The format of the synonym map. Only the 'solr' format is currently - supported. Default value: "solr". - :vartype format: str - :param synonyms: Required. A series of synonym rules in the specified synonym map format. The - rules must be separated by newlines. - :type synonyms: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. - This key is used to provide an additional level of encryption-at-rest for your data when you - want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive - Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive - Search will ignore attempts to set this property to null. You can change this property as - needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with - customer-managed keys is not available for free search services, and is only available for paid - services created on or after January 1, 2019. - :type encryption_key: - ~azure.search.documents.indexes.v2020_06.models.SearchResourceEncryptionKey - :param e_tag: The ETag of the synonym map. - :type e_tag: str - """ - - _validation = { - 'name': {'required': True}, - 'format': {'required': True, 'constant': True}, - 'synonyms': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'format': {'key': 'format', 'type': 'str'}, - 'synonyms': {'key': 'synonyms', 'type': 'str'}, - 'encryption_key': {'key': 'encryptionKey', 'type': 'SearchResourceEncryptionKey'}, - 'e_tag': {'key': '@odata\\.etag', 'type': 'str'}, - } - - format = "solr" - - def __init__( - self, - *, - name: str, - synonyms: str, - encryption_key: Optional["SearchResourceEncryptionKey"] = None, - e_tag: Optional[str] = None, - **kwargs - ): - super(SynonymMap, self).__init__(**kwargs) - self.name = name - self.synonyms = synonyms - self.encryption_key = encryption_key - self.e_tag = e_tag - - -class SynonymTokenFilter(TokenFilter): - """Matches single or multi-word synonyms in a token stream. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param synonyms: Required. A list of synonyms in following one of two formats: 1. incredible, - unbelievable, fabulous => amazing - all terms on the left side of => symbol will be replaced - with all terms on its right side; 2. incredible, unbelievable, fabulous, amazing - comma - separated list of equivalent words. Set the expand option to change how this list is - interpreted. - :type synonyms: list[str] - :param ignore_case: A value indicating whether to case-fold input for matching. Default is - false. - :type ignore_case: bool - :param expand: A value indicating whether all words in the list of synonyms (if => notation is - not used) will map to one another. If true, all words in the list of synonyms (if => notation - is not used) will map to one another. The following list: incredible, unbelievable, fabulous, - amazing is equivalent to: incredible, unbelievable, fabulous, amazing => incredible, - unbelievable, fabulous, amazing. If false, the following list: incredible, unbelievable, - fabulous, amazing will be equivalent to: incredible, unbelievable, fabulous, amazing => - incredible. Default is true. - :type expand: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'synonyms': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'synonyms': {'key': 'synonyms', 'type': '[str]'}, - 'ignore_case': {'key': 'ignoreCase', 'type': 'bool'}, - 'expand': {'key': 'expand', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - synonyms: List[str], - ignore_case: Optional[bool] = False, - expand: Optional[bool] = True, - **kwargs - ): - super(SynonymTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.SynonymTokenFilter' # type: str - self.synonyms = synonyms - self.ignore_case = ignore_case - self.expand = expand - - -class TagScoringFunction(ScoringFunction): - """Defines a function that boosts scores of documents with string values matching a given list of tags. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Indicates the type of function to use. Valid values include magnitude, - freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document - scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", - "logarithmic". - :type interpolation: str or - ~azure.search.documents.indexes.v2020_06.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the tag scoring function. - :type parameters: ~azure.search.documents.indexes.v2020_06.models.TagScoringParameters - """ - - _validation = { - 'type': {'required': True}, - 'field_name': {'required': True}, - 'boost': {'required': True}, - 'parameters': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'field_name': {'key': 'fieldName', 'type': 'str'}, - 'boost': {'key': 'boost', 'type': 'float'}, - 'interpolation': {'key': 'interpolation', 'type': 'str'}, - 'parameters': {'key': 'tag', 'type': 'TagScoringParameters'}, - } - - def __init__( - self, - *, - field_name: str, - boost: float, - parameters: "TagScoringParameters", - interpolation: Optional[Union[str, "ScoringFunctionInterpolation"]] = None, - **kwargs - ): - super(TagScoringFunction, self).__init__(field_name=field_name, boost=boost, interpolation=interpolation, **kwargs) - self.type = 'tag' # type: str - self.parameters = parameters - - -class TagScoringParameters(msrest.serialization.Model): - """Provides parameter values to a tag scoring function. - - All required parameters must be populated in order to send to Azure. - - :param tags_parameter: Required. The name of the parameter passed in search queries to specify - the list of tags to compare against the target field. - :type tags_parameter: str - """ - - _validation = { - 'tags_parameter': {'required': True}, - } - - _attribute_map = { - 'tags_parameter': {'key': 'tagsParameter', 'type': 'str'}, - } - - def __init__( - self, - *, - tags_parameter: str, - **kwargs - ): - super(TagScoringParameters, self).__init__(**kwargs) - self.tags_parameter = tags_parameter - - -class TextTranslationSkill(SearchIndexerSkill): - """A skill to translate text from one language to another. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param default_to_language_code: Required. The language code to translate documents into for - documents that don't specify the to language explicitly. Possible values include: "af", "ar", - "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", - "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", - "tlh", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "otq", "ro", "ru", "sm", - "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", - "vi", "cy", "yua". - :type default_to_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.TextTranslationSkillLanguage - :param default_from_language_code: The language code to translate documents from for documents - that don't specify the from language explicitly. Possible values include: "af", "ar", "bn", - "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", - "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", - "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "otq", "ro", "ru", "sm", "sr-Cyrl", - "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", - "yua". - :type default_from_language_code: str or - ~azure.search.documents.indexes.v2020_06.models.TextTranslationSkillLanguage - :param suggested_from: The language code to translate documents from when neither the - fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the - automatic language detection is unsuccessful. Default is en. Possible values include: "af", - "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", - "fj", "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", - "sw", "tlh", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "otq", "ro", "ru", - "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", - "ur", "vi", "cy", "yua". - :type suggested_from: str or - ~azure.search.documents.indexes.v2020_06.models.TextTranslationSkillLanguage - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - 'default_to_language_code': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'default_to_language_code': {'key': 'defaultToLanguageCode', 'type': 'str'}, - 'default_from_language_code': {'key': 'defaultFromLanguageCode', 'type': 'str'}, - 'suggested_from': {'key': 'suggestedFrom', 'type': 'str'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - default_to_language_code: Union[str, "TextTranslationSkillLanguage"], - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - default_from_language_code: Optional[Union[str, "TextTranslationSkillLanguage"]] = None, - suggested_from: Optional[Union[str, "TextTranslationSkillLanguage"]] = None, - **kwargs - ): - super(TextTranslationSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Text.TranslationSkill' # type: str - self.default_to_language_code = default_to_language_code - self.default_from_language_code = default_from_language_code - self.suggested_from = suggested_from - - -class TextWeights(msrest.serialization.Model): - """Defines weights on index fields for which matches should boost scoring in search queries. - - All required parameters must be populated in order to send to Azure. - - :param weights: Required. The dictionary of per-field weights to boost document scoring. The - keys are field names and the values are the weights for each field. - :type weights: dict[str, float] - """ - - _validation = { - 'weights': {'required': True}, - } - - _attribute_map = { - 'weights': {'key': 'weights', 'type': '{float}'}, - } - - def __init__( - self, - *, - weights: Dict[str, float], - **kwargs - ): - super(TextWeights, self).__init__(**kwargs) - self.weights = weights - - -class TruncateTokenFilter(TokenFilter): - """Truncates the terms to a specific length. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param length: The length at which terms will be truncated. Default and maximum is 300. - :type length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'length': {'key': 'length', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - length: Optional[int] = 300, - **kwargs - ): - super(TruncateTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.TruncateTokenFilter' # type: str - self.length = length - - -class UaxUrlEmailTokenizer(LexicalTokenizer): - """Tokenizes urls and emails as one token. This tokenizer is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the - maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - 'max_token_length': {'maximum': 300}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'max_token_length': {'key': 'maxTokenLength', 'type': 'int'}, - } - - def __init__( - self, - *, - name: str, - max_token_length: Optional[int] = 255, - **kwargs - ): - super(UaxUrlEmailTokenizer, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.UaxUrlEmailTokenizer' # type: str - self.max_token_length = max_token_length - - -class UniqueTokenFilter(TokenFilter): - """Filters out tokens with same text as the previous token. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param only_on_same_position: A value indicating whether to remove duplicates only at the same - position. Default is false. - :type only_on_same_position: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'only_on_same_position': {'key': 'onlyOnSamePosition', 'type': 'bool'}, - } - - def __init__( - self, - *, - name: str, - only_on_same_position: Optional[bool] = False, - **kwargs - ): - super(UniqueTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.UniqueTokenFilter' # type: str - self.only_on_same_position = only_on_same_position - - -class WebApiSkill(SearchIndexerSkill): - """A skill that can call a Web API endpoint, allowing you to extend a skillset by having it call your custom code. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by - server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill - with no name defined will be given a default name of its 1-based index in the skills array, - prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.v2020_06.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.v2020_06.models.OutputFieldMappingEntry] - :param uri: Required. The url for the Web API. - :type uri: str - :param http_headers: The headers required to make the http request. - :type http_headers: dict[str, str] - :param http_method: The method for the http request. - :type http_method: str - :param timeout: The desired timeout for the request. Default is 30 seconds. - :type timeout: ~datetime.timedelta - :param batch_size: The desired batch size which indicates number of documents. - :type batch_size: int - :param degree_of_parallelism: If set, the number of parallel calls that can be made to the Web - API. - :type degree_of_parallelism: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'inputs': {'required': True}, - 'outputs': {'required': True}, - 'uri': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'context': {'key': 'context', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[InputFieldMappingEntry]'}, - 'outputs': {'key': 'outputs', 'type': '[OutputFieldMappingEntry]'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'http_headers': {'key': 'httpHeaders', 'type': '{str}'}, - 'http_method': {'key': 'httpMethod', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'duration'}, - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'degree_of_parallelism': {'key': 'degreeOfParallelism', 'type': 'int'}, - } - - def __init__( - self, - *, - inputs: List["InputFieldMappingEntry"], - outputs: List["OutputFieldMappingEntry"], - uri: str, - name: Optional[str] = None, - description: Optional[str] = None, - context: Optional[str] = None, - http_headers: Optional[Dict[str, str]] = None, - http_method: Optional[str] = None, - timeout: Optional[datetime.timedelta] = None, - batch_size: Optional[int] = None, - degree_of_parallelism: Optional[int] = None, - **kwargs - ): - super(WebApiSkill, self).__init__(name=name, description=description, context=context, inputs=inputs, outputs=outputs, **kwargs) - self.odata_type = '#Microsoft.Skills.Custom.WebApiSkill' # type: str - self.uri = uri - self.http_headers = http_headers - self.http_method = http_method - self.timeout = timeout - self.batch_size = batch_size - self.degree_of_parallelism = degree_of_parallelism - - -class WordDelimiterTokenFilter(TokenFilter): - """Splits words into subwords and performs optional transformations on subword groups. This token filter is implemented using Apache Lucene. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled - by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, - spaces, dashes or underscores, can only start and end with alphanumeric characters, and is - limited to 128 characters. - :type name: str - :param generate_word_parts: A value indicating whether to generate part words. If set, causes - parts of words to be generated; for example "AzureSearch" becomes "Azure" "Search". Default is - true. - :type generate_word_parts: bool - :param generate_number_parts: A value indicating whether to generate number subwords. Default - is true. - :type generate_number_parts: bool - :param catenate_words: A value indicating whether maximum runs of word parts will be catenated. - For example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default is false. - :type catenate_words: bool - :param catenate_numbers: A value indicating whether maximum runs of number parts will be - catenated. For example, if this is set to true, "1-2" becomes "12". Default is false. - :type catenate_numbers: bool - :param catenate_all: A value indicating whether all subword parts will be catenated. For - example, if this is set to true, "Azure-Search-1" becomes "AzureSearch1". Default is false. - :type catenate_all: bool - :param split_on_case_change: A value indicating whether to split words on caseChange. For - example, if this is set to true, "AzureSearch" becomes "Azure" "Search". Default is true. - :type split_on_case_change: bool - :param preserve_original: A value indicating whether original words will be preserved and added - to the subword list. Default is false. - :type preserve_original: bool - :param split_on_numerics: A value indicating whether to split on numbers. For example, if this - is set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. - :type split_on_numerics: bool - :param stem_english_possessive: A value indicating whether to remove trailing "'s" for each - subword. Default is true. - :type stem_english_possessive: bool - :param protected_words: A list of tokens to protect from being delimited. - :type protected_words: list[str] - """ - - _validation = { - 'odata_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'generate_word_parts': {'key': 'generateWordParts', 'type': 'bool'}, - 'generate_number_parts': {'key': 'generateNumberParts', 'type': 'bool'}, - 'catenate_words': {'key': 'catenateWords', 'type': 'bool'}, - 'catenate_numbers': {'key': 'catenateNumbers', 'type': 'bool'}, - 'catenate_all': {'key': 'catenateAll', 'type': 'bool'}, - 'split_on_case_change': {'key': 'splitOnCaseChange', 'type': 'bool'}, - 'preserve_original': {'key': 'preserveOriginal', 'type': 'bool'}, - 'split_on_numerics': {'key': 'splitOnNumerics', 'type': 'bool'}, - 'stem_english_possessive': {'key': 'stemEnglishPossessive', 'type': 'bool'}, - 'protected_words': {'key': 'protectedWords', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: str, - generate_word_parts: Optional[bool] = True, - generate_number_parts: Optional[bool] = True, - catenate_words: Optional[bool] = False, - catenate_numbers: Optional[bool] = False, - catenate_all: Optional[bool] = False, - split_on_case_change: Optional[bool] = True, - preserve_original: Optional[bool] = False, - split_on_numerics: Optional[bool] = True, - stem_english_possessive: Optional[bool] = True, - protected_words: Optional[List[str]] = None, - **kwargs - ): - super(WordDelimiterTokenFilter, self).__init__(name=name, **kwargs) - self.odata_type = '#Microsoft.Azure.Search.WordDelimiterTokenFilter' # type: str - self.generate_word_parts = generate_word_parts - self.generate_number_parts = generate_number_parts - self.catenate_words = catenate_words - self.catenate_numbers = catenate_numbers - self.catenate_all = catenate_all - self.split_on_case_change = split_on_case_change - self.preserve_original = preserve_original - self.split_on_numerics = split_on_numerics - self.stem_english_possessive = stem_english_possessive - self.protected_words = protected_words diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_search_client_enums.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_search_client_enums.py deleted file mode 100644 index 15003212746d..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/models/_search_client_enums.py +++ /dev/null @@ -1,1526 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class BlobIndexerDataToExtract(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the data to extract from Azure blob storage and tells the indexer which data to - extract from image content when "imageAction" is set to a value other than "none". This - applies to embedded image content in a .PDF or other application, or image files such as .jpg - and .png, in Azure blobs. - """ - - #: Indexes just the standard blob properties and user-specified metadata. - STORAGE_METADATA = "storageMetadata" - #: Extracts metadata provided by the Azure blob storage subsystem and the content-type specific - #: metadata (for example, metadata unique to just .png files are indexed). - ALL_METADATA = "allMetadata" - #: Extracts all metadata and textual content from each blob. - CONTENT_AND_METADATA = "contentAndMetadata" - -class BlobIndexerImageAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Determines how to process embedded images and image files in Azure blob storage. Setting the - "imageAction" configuration to any value other than "none" requires that a skillset also be - attached to that indexer. - """ - - #: Ignores embedded images or image files in the data set. This is the default. - NONE = "none" - #: Extracts text from images (for example, the word "STOP" from a traffic stop sign), and embeds - #: it into the content field. This action requires that "dataToExtract" is set to - #: "contentAndMetadata". A normalized image refers to additional processing resulting in uniform - #: image output, sized and rotated to promote consistent rendering when you include images in - #: visual search results. This information is generated for each image when you use this option. - GENERATE_NORMALIZED_IMAGES = "generateNormalizedImages" - #: Extracts text from images (for example, the word "STOP" from a traffic stop sign), and embeds - #: it into the content field, but treats PDF files differently in that each page will be rendered - #: as an image and normalized accordingly, instead of extracting embedded images. Non-PDF file - #: types will be treated the same as if "generateNormalizedImages" was set. - GENERATE_NORMALIZED_IMAGE_PER_PAGE = "generateNormalizedImagePerPage" - -class BlobIndexerParsingMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents the parsing mode for indexing from an Azure blob data source. - """ - - #: Set to default for normal file processing. - DEFAULT = "default" - #: Set to text to improve indexing performance on plain text files in blob storage. - TEXT = "text" - #: Set to delimitedText when blobs are plain CSV files. - DELIMITED_TEXT = "delimitedText" - #: Set to json to extract structured content from JSON files. - JSON = "json" - #: Set to jsonArray to extract individual elements of a JSON array as separate documents in Azure - #: Cognitive Search. - JSON_ARRAY = "jsonArray" - #: Set to jsonLines to extract individual JSON entities, separated by a new line, as separate - #: documents in Azure Cognitive Search. - JSON_LINES = "jsonLines" - -class BlobIndexerPDFTextRotationAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Determines algorithm for text extraction from PDF files in Azure blob storage. - """ - - #: Leverages normal text extraction. This is the default. - NONE = "none" - #: May produce better and more readable text extraction from PDF files that have rotated text - #: within them. Note that there may be a small performance speed impact when this parameter is - #: used. This parameter only applies to PDF files, and only to PDFs with embedded text. If the - #: rotated text appears within an embedded image in the PDF, this parameter does not apply. - DETECT_ANGLES = "detectAngles" - -class CharFilterName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines the names of all character filters supported by Azure Cognitive Search. - """ - - #: A character filter that attempts to strip out HTML constructs. See - #: https://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.html. - HTML_STRIP = "html_strip" - -class CjkBigramTokenFilterScripts(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Scripts that can be ignored by CjkBigramTokenFilter. - """ - - #: Ignore Han script when forming bigrams of CJK terms. - HAN = "han" - #: Ignore Hiragana script when forming bigrams of CJK terms. - HIRAGANA = "hiragana" - #: Ignore Katakana script when forming bigrams of CJK terms. - KATAKANA = "katakana" - #: Ignore Hangul script when forming bigrams of CJK terms. - HANGUL = "hangul" - -class CustomEntityLookupSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language codes supported for input text by CustomEntityLookupSkill. - """ - - #: Danish. - DA = "da" - #: German. - DE = "de" - #: English. - EN = "en" - #: Spanish. - ES = "es" - #: Finnish. - FI = "fi" - #: French. - FR = "fr" - #: Italian. - IT = "it" - #: Korean. - KO = "ko" - #: Portuguese. - PT = "pt" - -class EdgeNGramTokenFilterSide(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies which side of the input an n-gram should be generated from. - """ - - #: Specifies that the n-gram should be generated from the front of the input. - FRONT = "front" - #: Specifies that the n-gram should be generated from the back of the input. - BACK = "back" - -class EntityCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """A string indicating what entity categories to return. - """ - - #: Entities describing a physical location. - LOCATION = "location" - #: Entities describing an organization. - ORGANIZATION = "organization" - #: Entities describing a person. - PERSON = "person" - #: Entities describing a quantity. - QUANTITY = "quantity" - #: Entities describing a date and time. - DATETIME = "datetime" - #: Entities describing a URL. - URL = "url" - #: Entities describing an email address. - EMAIL = "email" - -class EntityRecognitionSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language codes supported for input text by EntityRecognitionSkill. - """ - - #: Arabic. - AR = "ar" - #: Czech. - CS = "cs" - #: Chinese-Simplified. - ZH_HANS = "zh-Hans" - #: Chinese-Traditional. - ZH_HANT = "zh-Hant" - #: Danish. - DA = "da" - #: Dutch. - NL = "nl" - #: English. - EN = "en" - #: Finnish. - FI = "fi" - #: French. - FR = "fr" - #: German. - DE = "de" - #: Greek. - EL = "el" - #: Hungarian. - HU = "hu" - #: Italian. - IT = "it" - #: Japanese. - JA = "ja" - #: Korean. - KO = "ko" - #: Norwegian (Bokmaal). - NO = "no" - #: Polish. - PL = "pl" - #: Portuguese (Portugal). - PT_PT = "pt-PT" - #: Portuguese (Brazil). - PT_BR = "pt-BR" - #: Russian. - RU = "ru" - #: Spanish. - ES = "es" - #: Swedish. - SV = "sv" - #: Turkish. - TR = "tr" - -class ImageAnalysisSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language codes supported for input by ImageAnalysisSkill. - """ - - #: English. - EN = "en" - #: Spanish. - ES = "es" - #: Japanese. - JA = "ja" - #: Portuguese. - PT = "pt" - #: Chinese. - ZH = "zh" - -class ImageDetail(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """A string indicating which domain-specific details to return. - """ - - #: Details recognized as celebrities. - CELEBRITIES = "celebrities" - #: Details recognized as landmarks. - LANDMARKS = "landmarks" - -class IndexerExecutionEnvironment(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the environment in which the indexer should execute. - """ - - #: Indicates that Azure Cognitive Search can determine where the indexer should execute. This is - #: the default environment when nothing is specified and is the recommended value. - STANDARD = "standard" - #: Indicates that the indexer should run with the environment provisioned specifically for the - #: search service. This should only be specified as the execution environment if the indexer needs - #: to access resources securely over shared private link resources. - PRIVATE = "private" - -class IndexerExecutionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents the status of an individual indexer execution. - """ - - #: An indexer invocation has failed, but the failure may be transient. Indexer invocations will - #: continue per schedule. - TRANSIENT_FAILURE = "transientFailure" - #: Indexer execution completed successfully. - SUCCESS = "success" - #: Indexer execution is in progress. - IN_PROGRESS = "inProgress" - #: Indexer has been reset. - RESET = "reset" - -class IndexerStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents the overall indexer status. - """ - - #: Indicates that the indexer is in an unknown state. - UNKNOWN = "unknown" - #: Indicates that the indexer experienced an error that cannot be corrected without human - #: intervention. - ERROR = "error" - #: Indicates that the indexer is running normally. - RUNNING = "running" - -class KeyPhraseExtractionSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language codes supported for input text by KeyPhraseExtractionSkill. - """ - - #: Danish. - DA = "da" - #: Dutch. - NL = "nl" - #: English. - EN = "en" - #: Finnish. - FI = "fi" - #: French. - FR = "fr" - #: German. - DE = "de" - #: Italian. - IT = "it" - #: Japanese. - JA = "ja" - #: Korean. - KO = "ko" - #: Norwegian (Bokmaal). - NO = "no" - #: Polish. - PL = "pl" - #: Portuguese (Portugal). - PT_PT = "pt-PT" - #: Portuguese (Brazil). - PT_BR = "pt-BR" - #: Russian. - RU = "ru" - #: Spanish. - ES = "es" - #: Swedish. - SV = "sv" - -class LexicalAnalyzerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines the names of all text analyzers supported by Azure Cognitive Search. - """ - - #: Microsoft analyzer for Arabic. - AR_MICROSOFT = "ar.microsoft" - #: Lucene analyzer for Arabic. - AR_LUCENE = "ar.lucene" - #: Lucene analyzer for Armenian. - HY_LUCENE = "hy.lucene" - #: Microsoft analyzer for Bangla. - BN_MICROSOFT = "bn.microsoft" - #: Lucene analyzer for Basque. - EU_LUCENE = "eu.lucene" - #: Microsoft analyzer for Bulgarian. - BG_MICROSOFT = "bg.microsoft" - #: Lucene analyzer for Bulgarian. - BG_LUCENE = "bg.lucene" - #: Microsoft analyzer for Catalan. - CA_MICROSOFT = "ca.microsoft" - #: Lucene analyzer for Catalan. - CA_LUCENE = "ca.lucene" - #: Microsoft analyzer for Chinese (Simplified). - ZH_HANS_MICROSOFT = "zh-Hans.microsoft" - #: Lucene analyzer for Chinese (Simplified). - ZH_HANS_LUCENE = "zh-Hans.lucene" - #: Microsoft analyzer for Chinese (Traditional). - ZH_HANT_MICROSOFT = "zh-Hant.microsoft" - #: Lucene analyzer for Chinese (Traditional). - ZH_HANT_LUCENE = "zh-Hant.lucene" - #: Microsoft analyzer for Croatian. - HR_MICROSOFT = "hr.microsoft" - #: Microsoft analyzer for Czech. - CS_MICROSOFT = "cs.microsoft" - #: Lucene analyzer for Czech. - CS_LUCENE = "cs.lucene" - #: Microsoft analyzer for Danish. - DA_MICROSOFT = "da.microsoft" - #: Lucene analyzer for Danish. - DA_LUCENE = "da.lucene" - #: Microsoft analyzer for Dutch. - NL_MICROSOFT = "nl.microsoft" - #: Lucene analyzer for Dutch. - NL_LUCENE = "nl.lucene" - #: Microsoft analyzer for English. - EN_MICROSOFT = "en.microsoft" - #: Lucene analyzer for English. - EN_LUCENE = "en.lucene" - #: Microsoft analyzer for Estonian. - ET_MICROSOFT = "et.microsoft" - #: Microsoft analyzer for Finnish. - FI_MICROSOFT = "fi.microsoft" - #: Lucene analyzer for Finnish. - FI_LUCENE = "fi.lucene" - #: Microsoft analyzer for French. - FR_MICROSOFT = "fr.microsoft" - #: Lucene analyzer for French. - FR_LUCENE = "fr.lucene" - #: Lucene analyzer for Galician. - GL_LUCENE = "gl.lucene" - #: Microsoft analyzer for German. - DE_MICROSOFT = "de.microsoft" - #: Lucene analyzer for German. - DE_LUCENE = "de.lucene" - #: Microsoft analyzer for Greek. - EL_MICROSOFT = "el.microsoft" - #: Lucene analyzer for Greek. - EL_LUCENE = "el.lucene" - #: Microsoft analyzer for Gujarati. - GU_MICROSOFT = "gu.microsoft" - #: Microsoft analyzer for Hebrew. - HE_MICROSOFT = "he.microsoft" - #: Microsoft analyzer for Hindi. - HI_MICROSOFT = "hi.microsoft" - #: Lucene analyzer for Hindi. - HI_LUCENE = "hi.lucene" - #: Microsoft analyzer for Hungarian. - HU_MICROSOFT = "hu.microsoft" - #: Lucene analyzer for Hungarian. - HU_LUCENE = "hu.lucene" - #: Microsoft analyzer for Icelandic. - IS_MICROSOFT = "is.microsoft" - #: Microsoft analyzer for Indonesian (Bahasa). - ID_MICROSOFT = "id.microsoft" - #: Lucene analyzer for Indonesian. - ID_LUCENE = "id.lucene" - #: Lucene analyzer for Irish. - GA_LUCENE = "ga.lucene" - #: Microsoft analyzer for Italian. - IT_MICROSOFT = "it.microsoft" - #: Lucene analyzer for Italian. - IT_LUCENE = "it.lucene" - #: Microsoft analyzer for Japanese. - JA_MICROSOFT = "ja.microsoft" - #: Lucene analyzer for Japanese. - JA_LUCENE = "ja.lucene" - #: Microsoft analyzer for Kannada. - KN_MICROSOFT = "kn.microsoft" - #: Microsoft analyzer for Korean. - KO_MICROSOFT = "ko.microsoft" - #: Lucene analyzer for Korean. - KO_LUCENE = "ko.lucene" - #: Microsoft analyzer for Latvian. - LV_MICROSOFT = "lv.microsoft" - #: Lucene analyzer for Latvian. - LV_LUCENE = "lv.lucene" - #: Microsoft analyzer for Lithuanian. - LT_MICROSOFT = "lt.microsoft" - #: Microsoft analyzer for Malayalam. - ML_MICROSOFT = "ml.microsoft" - #: Microsoft analyzer for Malay (Latin). - MS_MICROSOFT = "ms.microsoft" - #: Microsoft analyzer for Marathi. - MR_MICROSOFT = "mr.microsoft" - #: Microsoft analyzer for Norwegian (Bokmål). - NB_MICROSOFT = "nb.microsoft" - #: Lucene analyzer for Norwegian. - NO_LUCENE = "no.lucene" - #: Lucene analyzer for Persian. - FA_LUCENE = "fa.lucene" - #: Microsoft analyzer for Polish. - PL_MICROSOFT = "pl.microsoft" - #: Lucene analyzer for Polish. - PL_LUCENE = "pl.lucene" - #: Microsoft analyzer for Portuguese (Brazil). - PT_BR_MICROSOFT = "pt-BR.microsoft" - #: Lucene analyzer for Portuguese (Brazil). - PT_BR_LUCENE = "pt-BR.lucene" - #: Microsoft analyzer for Portuguese (Portugal). - PT_PT_MICROSOFT = "pt-PT.microsoft" - #: Lucene analyzer for Portuguese (Portugal). - PT_PT_LUCENE = "pt-PT.lucene" - #: Microsoft analyzer for Punjabi. - PA_MICROSOFT = "pa.microsoft" - #: Microsoft analyzer for Romanian. - RO_MICROSOFT = "ro.microsoft" - #: Lucene analyzer for Romanian. - RO_LUCENE = "ro.lucene" - #: Microsoft analyzer for Russian. - RU_MICROSOFT = "ru.microsoft" - #: Lucene analyzer for Russian. - RU_LUCENE = "ru.lucene" - #: Microsoft analyzer for Serbian (Cyrillic). - SR_CYRILLIC_MICROSOFT = "sr-cyrillic.microsoft" - #: Microsoft analyzer for Serbian (Latin). - SR_LATIN_MICROSOFT = "sr-latin.microsoft" - #: Microsoft analyzer for Slovak. - SK_MICROSOFT = "sk.microsoft" - #: Microsoft analyzer for Slovenian. - SL_MICROSOFT = "sl.microsoft" - #: Microsoft analyzer for Spanish. - ES_MICROSOFT = "es.microsoft" - #: Lucene analyzer for Spanish. - ES_LUCENE = "es.lucene" - #: Microsoft analyzer for Swedish. - SV_MICROSOFT = "sv.microsoft" - #: Lucene analyzer for Swedish. - SV_LUCENE = "sv.lucene" - #: Microsoft analyzer for Tamil. - TA_MICROSOFT = "ta.microsoft" - #: Microsoft analyzer for Telugu. - TE_MICROSOFT = "te.microsoft" - #: Microsoft analyzer for Thai. - TH_MICROSOFT = "th.microsoft" - #: Lucene analyzer for Thai. - TH_LUCENE = "th.lucene" - #: Microsoft analyzer for Turkish. - TR_MICROSOFT = "tr.microsoft" - #: Lucene analyzer for Turkish. - TR_LUCENE = "tr.lucene" - #: Microsoft analyzer for Ukrainian. - UK_MICROSOFT = "uk.microsoft" - #: Microsoft analyzer for Urdu. - UR_MICROSOFT = "ur.microsoft" - #: Microsoft analyzer for Vietnamese. - VI_MICROSOFT = "vi.microsoft" - #: Standard Lucene analyzer. - STANDARD_LUCENE = "standard.lucene" - #: Standard ASCII Folding Lucene analyzer. See - #: https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure-Search#Analyzers. - STANDARD_ASCII_FOLDING_LUCENE = "standardasciifolding.lucene" - #: Treats the entire content of a field as a single token. This is useful for data like zip codes, - #: ids, and some product names. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/KeywordAnalyzer.html. - KEYWORD = "keyword" - #: Flexibly separates text into terms via a regular expression pattern. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/PatternAnalyzer.html. - PATTERN = "pattern" - #: Divides text at non-letters and converts them to lower case. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/SimpleAnalyzer.html. - SIMPLE = "simple" - #: Divides text at non-letters; Applies the lowercase and stopword token filters. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/StopAnalyzer.html. - STOP = "stop" - #: An analyzer that uses the whitespace tokenizer. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/WhitespaceAnalyzer.html. - WHITESPACE = "whitespace" - -class LexicalTokenizerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines the names of all tokenizers supported by Azure Cognitive Search. - """ - - #: Grammar-based tokenizer that is suitable for processing most European-language documents. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/standard/ClassicTokenizer.html. - CLASSIC = "classic" - #: Tokenizes the input from an edge into n-grams of the given size(s). See - #: https://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ngram/EdgeNGramTokenizer.html. - EDGE_N_GRAM = "edgeNGram" - #: Emits the entire input as a single token. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/KeywordTokenizer.html. - KEYWORD = "keyword_v2" - #: Divides text at non-letters. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/LetterTokenizer.html. - LETTER = "letter" - #: Divides text at non-letters and converts them to lower case. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/LowerCaseTokenizer.html. - LOWERCASE = "lowercase" - #: Divides text using language-specific rules. - MICROSOFT_LANGUAGE_TOKENIZER = "microsoft_language_tokenizer" - #: Divides text using language-specific rules and reduces words to their base forms. - MICROSOFT_LANGUAGE_STEMMING_TOKENIZER = "microsoft_language_stemming_tokenizer" - #: Tokenizes the input into n-grams of the given size(s). See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ngram/NGramTokenizer.html. - N_GRAM = "nGram" - #: Tokenizer for path-like hierarchies. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/path/PathHierarchyTokenizer.html. - PATH_HIERARCHY = "path_hierarchy_v2" - #: Tokenizer that uses regex pattern matching to construct distinct tokens. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/pattern/PatternTokenizer.html. - PATTERN = "pattern" - #: Standard Lucene analyzer; Composed of the standard tokenizer, lowercase filter and stop filter. - #: See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/standard/StandardTokenizer.html. - STANDARD = "standard_v2" - #: Tokenizes urls and emails as one token. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.html. - UAX_URL_EMAIL = "uax_url_email" - #: Divides text at whitespace. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/WhitespaceTokenizer.html. - WHITESPACE = "whitespace" - -class MicrosoftStemmingTokenizerLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Lists the languages supported by the Microsoft language stemming tokenizer. - """ - - #: Selects the Microsoft stemming tokenizer for Arabic. - ARABIC = "arabic" - #: Selects the Microsoft stemming tokenizer for Bangla. - BANGLA = "bangla" - #: Selects the Microsoft stemming tokenizer for Bulgarian. - BULGARIAN = "bulgarian" - #: Selects the Microsoft stemming tokenizer for Catalan. - CATALAN = "catalan" - #: Selects the Microsoft stemming tokenizer for Croatian. - CROATIAN = "croatian" - #: Selects the Microsoft stemming tokenizer for Czech. - CZECH = "czech" - #: Selects the Microsoft stemming tokenizer for Danish. - DANISH = "danish" - #: Selects the Microsoft stemming tokenizer for Dutch. - DUTCH = "dutch" - #: Selects the Microsoft stemming tokenizer for English. - ENGLISH = "english" - #: Selects the Microsoft stemming tokenizer for Estonian. - ESTONIAN = "estonian" - #: Selects the Microsoft stemming tokenizer for Finnish. - FINNISH = "finnish" - #: Selects the Microsoft stemming tokenizer for French. - FRENCH = "french" - #: Selects the Microsoft stemming tokenizer for German. - GERMAN = "german" - #: Selects the Microsoft stemming tokenizer for Greek. - GREEK = "greek" - #: Selects the Microsoft stemming tokenizer for Gujarati. - GUJARATI = "gujarati" - #: Selects the Microsoft stemming tokenizer for Hebrew. - HEBREW = "hebrew" - #: Selects the Microsoft stemming tokenizer for Hindi. - HINDI = "hindi" - #: Selects the Microsoft stemming tokenizer for Hungarian. - HUNGARIAN = "hungarian" - #: Selects the Microsoft stemming tokenizer for Icelandic. - ICELANDIC = "icelandic" - #: Selects the Microsoft stemming tokenizer for Indonesian. - INDONESIAN = "indonesian" - #: Selects the Microsoft stemming tokenizer for Italian. - ITALIAN = "italian" - #: Selects the Microsoft stemming tokenizer for Kannada. - KANNADA = "kannada" - #: Selects the Microsoft stemming tokenizer for Latvian. - LATVIAN = "latvian" - #: Selects the Microsoft stemming tokenizer for Lithuanian. - LITHUANIAN = "lithuanian" - #: Selects the Microsoft stemming tokenizer for Malay. - MALAY = "malay" - #: Selects the Microsoft stemming tokenizer for Malayalam. - MALAYALAM = "malayalam" - #: Selects the Microsoft stemming tokenizer for Marathi. - MARATHI = "marathi" - #: Selects the Microsoft stemming tokenizer for Norwegian (Bokmål). - NORWEGIAN_BOKMAAL = "norwegianBokmaal" - #: Selects the Microsoft stemming tokenizer for Polish. - POLISH = "polish" - #: Selects the Microsoft stemming tokenizer for Portuguese. - PORTUGUESE = "portuguese" - #: Selects the Microsoft stemming tokenizer for Portuguese (Brazil). - PORTUGUESE_BRAZILIAN = "portugueseBrazilian" - #: Selects the Microsoft stemming tokenizer for Punjabi. - PUNJABI = "punjabi" - #: Selects the Microsoft stemming tokenizer for Romanian. - ROMANIAN = "romanian" - #: Selects the Microsoft stemming tokenizer for Russian. - RUSSIAN = "russian" - #: Selects the Microsoft stemming tokenizer for Serbian (Cyrillic). - SERBIAN_CYRILLIC = "serbianCyrillic" - #: Selects the Microsoft stemming tokenizer for Serbian (Latin). - SERBIAN_LATIN = "serbianLatin" - #: Selects the Microsoft stemming tokenizer for Slovak. - SLOVAK = "slovak" - #: Selects the Microsoft stemming tokenizer for Slovenian. - SLOVENIAN = "slovenian" - #: Selects the Microsoft stemming tokenizer for Spanish. - SPANISH = "spanish" - #: Selects the Microsoft stemming tokenizer for Swedish. - SWEDISH = "swedish" - #: Selects the Microsoft stemming tokenizer for Tamil. - TAMIL = "tamil" - #: Selects the Microsoft stemming tokenizer for Telugu. - TELUGU = "telugu" - #: Selects the Microsoft stemming tokenizer for Turkish. - TURKISH = "turkish" - #: Selects the Microsoft stemming tokenizer for Ukrainian. - UKRAINIAN = "ukrainian" - #: Selects the Microsoft stemming tokenizer for Urdu. - URDU = "urdu" - -class MicrosoftTokenizerLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Lists the languages supported by the Microsoft language tokenizer. - """ - - #: Selects the Microsoft tokenizer for Bangla. - BANGLA = "bangla" - #: Selects the Microsoft tokenizer for Bulgarian. - BULGARIAN = "bulgarian" - #: Selects the Microsoft tokenizer for Catalan. - CATALAN = "catalan" - #: Selects the Microsoft tokenizer for Chinese (Simplified). - CHINESE_SIMPLIFIED = "chineseSimplified" - #: Selects the Microsoft tokenizer for Chinese (Traditional). - CHINESE_TRADITIONAL = "chineseTraditional" - #: Selects the Microsoft tokenizer for Croatian. - CROATIAN = "croatian" - #: Selects the Microsoft tokenizer for Czech. - CZECH = "czech" - #: Selects the Microsoft tokenizer for Danish. - DANISH = "danish" - #: Selects the Microsoft tokenizer for Dutch. - DUTCH = "dutch" - #: Selects the Microsoft tokenizer for English. - ENGLISH = "english" - #: Selects the Microsoft tokenizer for French. - FRENCH = "french" - #: Selects the Microsoft tokenizer for German. - GERMAN = "german" - #: Selects the Microsoft tokenizer for Greek. - GREEK = "greek" - #: Selects the Microsoft tokenizer for Gujarati. - GUJARATI = "gujarati" - #: Selects the Microsoft tokenizer for Hindi. - HINDI = "hindi" - #: Selects the Microsoft tokenizer for Icelandic. - ICELANDIC = "icelandic" - #: Selects the Microsoft tokenizer for Indonesian. - INDONESIAN = "indonesian" - #: Selects the Microsoft tokenizer for Italian. - ITALIAN = "italian" - #: Selects the Microsoft tokenizer for Japanese. - JAPANESE = "japanese" - #: Selects the Microsoft tokenizer for Kannada. - KANNADA = "kannada" - #: Selects the Microsoft tokenizer for Korean. - KOREAN = "korean" - #: Selects the Microsoft tokenizer for Malay. - MALAY = "malay" - #: Selects the Microsoft tokenizer for Malayalam. - MALAYALAM = "malayalam" - #: Selects the Microsoft tokenizer for Marathi. - MARATHI = "marathi" - #: Selects the Microsoft tokenizer for Norwegian (Bokmål). - NORWEGIAN_BOKMAAL = "norwegianBokmaal" - #: Selects the Microsoft tokenizer for Polish. - POLISH = "polish" - #: Selects the Microsoft tokenizer for Portuguese. - PORTUGUESE = "portuguese" - #: Selects the Microsoft tokenizer for Portuguese (Brazil). - PORTUGUESE_BRAZILIAN = "portugueseBrazilian" - #: Selects the Microsoft tokenizer for Punjabi. - PUNJABI = "punjabi" - #: Selects the Microsoft tokenizer for Romanian. - ROMANIAN = "romanian" - #: Selects the Microsoft tokenizer for Russian. - RUSSIAN = "russian" - #: Selects the Microsoft tokenizer for Serbian (Cyrillic). - SERBIAN_CYRILLIC = "serbianCyrillic" - #: Selects the Microsoft tokenizer for Serbian (Latin). - SERBIAN_LATIN = "serbianLatin" - #: Selects the Microsoft tokenizer for Slovenian. - SLOVENIAN = "slovenian" - #: Selects the Microsoft tokenizer for Spanish. - SPANISH = "spanish" - #: Selects the Microsoft tokenizer for Swedish. - SWEDISH = "swedish" - #: Selects the Microsoft tokenizer for Tamil. - TAMIL = "tamil" - #: Selects the Microsoft tokenizer for Telugu. - TELUGU = "telugu" - #: Selects the Microsoft tokenizer for Thai. - THAI = "thai" - #: Selects the Microsoft tokenizer for Ukrainian. - UKRAINIAN = "ukrainian" - #: Selects the Microsoft tokenizer for Urdu. - URDU = "urdu" - #: Selects the Microsoft tokenizer for Vietnamese. - VIETNAMESE = "vietnamese" - -class OcrSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language codes supported for input by OcrSkill. - """ - - #: Chinese-Simplified. - ZH_HANS = "zh-Hans" - #: Chinese-Traditional. - ZH_HANT = "zh-Hant" - #: Czech. - CS = "cs" - #: Danish. - DA = "da" - #: Dutch. - NL = "nl" - #: English. - EN = "en" - #: Finnish. - FI = "fi" - #: French. - FR = "fr" - #: German. - DE = "de" - #: Greek. - EL = "el" - #: Hungarian. - HU = "hu" - #: Italian. - IT = "it" - #: Japanese. - JA = "ja" - #: Korean. - KO = "ko" - #: Norwegian (Bokmaal). - NB = "nb" - #: Polish. - PL = "pl" - #: Portuguese. - PT = "pt" - #: Russian. - RU = "ru" - #: Spanish. - ES = "es" - #: Swedish. - SV = "sv" - #: Turkish. - TR = "tr" - #: Arabic. - AR = "ar" - #: Romanian. - RO = "ro" - #: Serbian (Cyrillic, Serbia). - SR_CYRL = "sr-Cyrl" - #: Serbian (Latin, Serbia). - SR_LATN = "sr-Latn" - #: Slovak. - SK = "sk" - -class PhoneticEncoder(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Identifies the type of phonetic encoder to use with a PhoneticTokenFilter. - """ - - #: Encodes a token into a Metaphone value. - METAPHONE = "metaphone" - #: Encodes a token into a double metaphone value. - DOUBLE_METAPHONE = "doubleMetaphone" - #: Encodes a token into a Soundex value. - SOUNDEX = "soundex" - #: Encodes a token into a Refined Soundex value. - REFINED_SOUNDEX = "refinedSoundex" - #: Encodes a token into a Caverphone 1.0 value. - CAVERPHONE1 = "caverphone1" - #: Encodes a token into a Caverphone 2.0 value. - CAVERPHONE2 = "caverphone2" - #: Encodes a token into a Cologne Phonetic value. - COLOGNE = "cologne" - #: Encodes a token into a NYSIIS value. - NYSIIS = "nysiis" - #: Encodes a token using the Kölner Phonetik algorithm. - KOELNER_PHONETIK = "koelnerPhonetik" - #: Encodes a token using the Haase refinement of the Kölner Phonetik algorithm. - HAASE_PHONETIK = "haasePhonetik" - #: Encodes a token into a Beider-Morse value. - BEIDER_MORSE = "beiderMorse" - -class RegexFlags(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines flags that can be combined to control how regular expressions are used in the pattern - analyzer and pattern tokenizer. - """ - - #: Enables canonical equivalence. - CANON_EQ = "CANON_EQ" - #: Enables case-insensitive matching. - CASE_INSENSITIVE = "CASE_INSENSITIVE" - #: Permits whitespace and comments in the pattern. - COMMENTS = "COMMENTS" - #: Enables dotall mode. - DOT_ALL = "DOTALL" - #: Enables literal parsing of the pattern. - LITERAL = "LITERAL" - #: Enables multiline mode. - MULTILINE = "MULTILINE" - #: Enables Unicode-aware case folding. - UNICODE_CASE = "UNICODE_CASE" - #: Enables Unix lines mode. - UNIX_LINES = "UNIX_LINES" - -class ScoringFunctionAggregation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines the aggregation function used to combine the results of all the scoring functions in a - scoring profile. - """ - - #: Boost scores by the sum of all scoring function results. - SUM = "sum" - #: Boost scores by the average of all scoring function results. - AVERAGE = "average" - #: Boost scores by the minimum of all scoring function results. - MINIMUM = "minimum" - #: Boost scores by the maximum of all scoring function results. - MAXIMUM = "maximum" - #: Boost scores using the first applicable scoring function in the scoring profile. - FIRST_MATCHING = "firstMatching" - -class ScoringFunctionInterpolation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines the function used to interpolate score boosting across a range of documents. - """ - - #: Boosts scores by a linearly decreasing amount. This is the default interpolation for scoring - #: functions. - LINEAR = "linear" - #: Boosts scores by a constant factor. - CONSTANT = "constant" - #: Boosts scores by an amount that decreases quadratically. Boosts decrease slowly for higher - #: scores, and more quickly as the scores decrease. This interpolation option is not allowed in - #: tag scoring functions. - QUADRATIC = "quadratic" - #: Boosts scores by an amount that decreases logarithmically. Boosts decrease quickly for higher - #: scores, and more slowly as the scores decrease. This interpolation option is not allowed in tag - #: scoring functions. - LOGARITHMIC = "logarithmic" - -class SearchFieldDataType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines the data type of a field in a search index. - """ - - #: Indicates that a field contains a string. - STRING = "Edm.String" - #: Indicates that a field contains a 32-bit signed integer. - INT32 = "Edm.Int32" - #: Indicates that a field contains a 64-bit signed integer. - INT64 = "Edm.Int64" - #: Indicates that a field contains an IEEE double-precision floating point number. - DOUBLE = "Edm.Double" - #: Indicates that a field contains a Boolean value (true or false). - BOOLEAN = "Edm.Boolean" - #: Indicates that a field contains a date/time value, including timezone information. - DATE_TIME_OFFSET = "Edm.DateTimeOffset" - #: Indicates that a field contains a geo-location in terms of longitude and latitude. - GEOGRAPHY_POINT = "Edm.GeographyPoint" - #: Indicates that a field contains one or more complex objects that in turn have sub-fields of - #: other types. - COMPLEX = "Edm.ComplexType" - -class SearchIndexerDataSourceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines the type of a datasource. - """ - - #: Indicates an Azure SQL datasource. - AZURE_SQL = "azuresql" - #: Indicates a CosmosDB datasource. - COSMOS_DB = "cosmosdb" - #: Indicates an Azure Blob datasource. - AZURE_BLOB = "azureblob" - #: Indicates an Azure Table datasource. - AZURE_TABLE = "azuretable" - #: Indicates a MySql datasource. - MY_SQL = "mysql" - #: Indicates an ADLS Gen2 datasource. - ADLS_GEN2 = "adlsgen2" - -class SentimentSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language codes supported for input text by SentimentSkill. - """ - - #: Danish. - DA = "da" - #: Dutch. - NL = "nl" - #: English. - EN = "en" - #: Finnish. - FI = "fi" - #: French. - FR = "fr" - #: German. - DE = "de" - #: Greek. - EL = "el" - #: Italian. - IT = "it" - #: Norwegian (Bokmaal). - NO = "no" - #: Polish. - PL = "pl" - #: Portuguese (Portugal). - PT_PT = "pt-PT" - #: Russian. - RU = "ru" - #: Spanish. - ES = "es" - #: Swedish. - SV = "sv" - #: Turkish. - TR = "tr" - -class SnowballTokenFilterLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language to use for a Snowball token filter. - """ - - #: Selects the Lucene Snowball stemming tokenizer for Armenian. - ARMENIAN = "armenian" - #: Selects the Lucene Snowball stemming tokenizer for Basque. - BASQUE = "basque" - #: Selects the Lucene Snowball stemming tokenizer for Catalan. - CATALAN = "catalan" - #: Selects the Lucene Snowball stemming tokenizer for Danish. - DANISH = "danish" - #: Selects the Lucene Snowball stemming tokenizer for Dutch. - DUTCH = "dutch" - #: Selects the Lucene Snowball stemming tokenizer for English. - ENGLISH = "english" - #: Selects the Lucene Snowball stemming tokenizer for Finnish. - FINNISH = "finnish" - #: Selects the Lucene Snowball stemming tokenizer for French. - FRENCH = "french" - #: Selects the Lucene Snowball stemming tokenizer for German. - GERMAN = "german" - #: Selects the Lucene Snowball stemming tokenizer that uses the German variant algorithm. - GERMAN2 = "german2" - #: Selects the Lucene Snowball stemming tokenizer for Hungarian. - HUNGARIAN = "hungarian" - #: Selects the Lucene Snowball stemming tokenizer for Italian. - ITALIAN = "italian" - #: Selects the Lucene Snowball stemming tokenizer for Dutch that uses the Kraaij-Pohlmann stemming - #: algorithm. - KP = "kp" - #: Selects the Lucene Snowball stemming tokenizer for English that uses the Lovins stemming - #: algorithm. - LOVINS = "lovins" - #: Selects the Lucene Snowball stemming tokenizer for Norwegian. - NORWEGIAN = "norwegian" - #: Selects the Lucene Snowball stemming tokenizer for English that uses the Porter stemming - #: algorithm. - PORTER = "porter" - #: Selects the Lucene Snowball stemming tokenizer for Portuguese. - PORTUGUESE = "portuguese" - #: Selects the Lucene Snowball stemming tokenizer for Romanian. - ROMANIAN = "romanian" - #: Selects the Lucene Snowball stemming tokenizer for Russian. - RUSSIAN = "russian" - #: Selects the Lucene Snowball stemming tokenizer for Spanish. - SPANISH = "spanish" - #: Selects the Lucene Snowball stemming tokenizer for Swedish. - SWEDISH = "swedish" - #: Selects the Lucene Snowball stemming tokenizer for Turkish. - TURKISH = "turkish" - -class SplitSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language codes supported for input text by SplitSkill. - """ - - #: Danish. - DA = "da" - #: German. - DE = "de" - #: English. - EN = "en" - #: Spanish. - ES = "es" - #: Finnish. - FI = "fi" - #: French. - FR = "fr" - #: Italian. - IT = "it" - #: Korean. - KO = "ko" - #: Portuguese. - PT = "pt" - -class StemmerTokenFilterLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language to use for a stemmer token filter. - """ - - #: Selects the Lucene stemming tokenizer for Arabic. - ARABIC = "arabic" - #: Selects the Lucene stemming tokenizer for Armenian. - ARMENIAN = "armenian" - #: Selects the Lucene stemming tokenizer for Basque. - BASQUE = "basque" - #: Selects the Lucene stemming tokenizer for Portuguese (Brazil). - BRAZILIAN = "brazilian" - #: Selects the Lucene stemming tokenizer for Bulgarian. - BULGARIAN = "bulgarian" - #: Selects the Lucene stemming tokenizer for Catalan. - CATALAN = "catalan" - #: Selects the Lucene stemming tokenizer for Czech. - CZECH = "czech" - #: Selects the Lucene stemming tokenizer for Danish. - DANISH = "danish" - #: Selects the Lucene stemming tokenizer for Dutch. - DUTCH = "dutch" - #: Selects the Lucene stemming tokenizer for Dutch that uses the Kraaij-Pohlmann stemming - #: algorithm. - DUTCH_KP = "dutchKp" - #: Selects the Lucene stemming tokenizer for English. - ENGLISH = "english" - #: Selects the Lucene stemming tokenizer for English that does light stemming. - LIGHT_ENGLISH = "lightEnglish" - #: Selects the Lucene stemming tokenizer for English that does minimal stemming. - MINIMAL_ENGLISH = "minimalEnglish" - #: Selects the Lucene stemming tokenizer for English that removes trailing possessives from words. - POSSESSIVE_ENGLISH = "possessiveEnglish" - #: Selects the Lucene stemming tokenizer for English that uses the Porter2 stemming algorithm. - PORTER2 = "porter2" - #: Selects the Lucene stemming tokenizer for English that uses the Lovins stemming algorithm. - LOVINS = "lovins" - #: Selects the Lucene stemming tokenizer for Finnish. - FINNISH = "finnish" - #: Selects the Lucene stemming tokenizer for Finnish that does light stemming. - LIGHT_FINNISH = "lightFinnish" - #: Selects the Lucene stemming tokenizer for French. - FRENCH = "french" - #: Selects the Lucene stemming tokenizer for French that does light stemming. - LIGHT_FRENCH = "lightFrench" - #: Selects the Lucene stemming tokenizer for French that does minimal stemming. - MINIMAL_FRENCH = "minimalFrench" - #: Selects the Lucene stemming tokenizer for Galician. - GALICIAN = "galician" - #: Selects the Lucene stemming tokenizer for Galician that does minimal stemming. - MINIMAL_GALICIAN = "minimalGalician" - #: Selects the Lucene stemming tokenizer for German. - GERMAN = "german" - #: Selects the Lucene stemming tokenizer that uses the German variant algorithm. - GERMAN2 = "german2" - #: Selects the Lucene stemming tokenizer for German that does light stemming. - LIGHT_GERMAN = "lightGerman" - #: Selects the Lucene stemming tokenizer for German that does minimal stemming. - MINIMAL_GERMAN = "minimalGerman" - #: Selects the Lucene stemming tokenizer for Greek. - GREEK = "greek" - #: Selects the Lucene stemming tokenizer for Hindi. - HINDI = "hindi" - #: Selects the Lucene stemming tokenizer for Hungarian. - HUNGARIAN = "hungarian" - #: Selects the Lucene stemming tokenizer for Hungarian that does light stemming. - LIGHT_HUNGARIAN = "lightHungarian" - #: Selects the Lucene stemming tokenizer for Indonesian. - INDONESIAN = "indonesian" - #: Selects the Lucene stemming tokenizer for Irish. - IRISH = "irish" - #: Selects the Lucene stemming tokenizer for Italian. - ITALIAN = "italian" - #: Selects the Lucene stemming tokenizer for Italian that does light stemming. - LIGHT_ITALIAN = "lightItalian" - #: Selects the Lucene stemming tokenizer for Sorani. - SORANI = "sorani" - #: Selects the Lucene stemming tokenizer for Latvian. - LATVIAN = "latvian" - #: Selects the Lucene stemming tokenizer for Norwegian (Bokmål). - NORWEGIAN = "norwegian" - #: Selects the Lucene stemming tokenizer for Norwegian (Bokmål) that does light stemming. - LIGHT_NORWEGIAN = "lightNorwegian" - #: Selects the Lucene stemming tokenizer for Norwegian (Bokmål) that does minimal stemming. - MINIMAL_NORWEGIAN = "minimalNorwegian" - #: Selects the Lucene stemming tokenizer for Norwegian (Nynorsk) that does light stemming. - LIGHT_NYNORSK = "lightNynorsk" - #: Selects the Lucene stemming tokenizer for Norwegian (Nynorsk) that does minimal stemming. - MINIMAL_NYNORSK = "minimalNynorsk" - #: Selects the Lucene stemming tokenizer for Portuguese. - PORTUGUESE = "portuguese" - #: Selects the Lucene stemming tokenizer for Portuguese that does light stemming. - LIGHT_PORTUGUESE = "lightPortuguese" - #: Selects the Lucene stemming tokenizer for Portuguese that does minimal stemming. - MINIMAL_PORTUGUESE = "minimalPortuguese" - #: Selects the Lucene stemming tokenizer for Portuguese that uses the RSLP stemming algorithm. - PORTUGUESE_RSLP = "portugueseRslp" - #: Selects the Lucene stemming tokenizer for Romanian. - ROMANIAN = "romanian" - #: Selects the Lucene stemming tokenizer for Russian. - RUSSIAN = "russian" - #: Selects the Lucene stemming tokenizer for Russian that does light stemming. - LIGHT_RUSSIAN = "lightRussian" - #: Selects the Lucene stemming tokenizer for Spanish. - SPANISH = "spanish" - #: Selects the Lucene stemming tokenizer for Spanish that does light stemming. - LIGHT_SPANISH = "lightSpanish" - #: Selects the Lucene stemming tokenizer for Swedish. - SWEDISH = "swedish" - #: Selects the Lucene stemming tokenizer for Swedish that does light stemming. - LIGHT_SWEDISH = "lightSwedish" - #: Selects the Lucene stemming tokenizer for Turkish. - TURKISH = "turkish" - -class StopwordsList(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Identifies a predefined list of language-specific stopwords. - """ - - #: Selects the stopword list for Arabic. - ARABIC = "arabic" - #: Selects the stopword list for Armenian. - ARMENIAN = "armenian" - #: Selects the stopword list for Basque. - BASQUE = "basque" - #: Selects the stopword list for Portuguese (Brazil). - BRAZILIAN = "brazilian" - #: Selects the stopword list for Bulgarian. - BULGARIAN = "bulgarian" - #: Selects the stopword list for Catalan. - CATALAN = "catalan" - #: Selects the stopword list for Czech. - CZECH = "czech" - #: Selects the stopword list for Danish. - DANISH = "danish" - #: Selects the stopword list for Dutch. - DUTCH = "dutch" - #: Selects the stopword list for English. - ENGLISH = "english" - #: Selects the stopword list for Finnish. - FINNISH = "finnish" - #: Selects the stopword list for French. - FRENCH = "french" - #: Selects the stopword list for Galician. - GALICIAN = "galician" - #: Selects the stopword list for German. - GERMAN = "german" - #: Selects the stopword list for Greek. - GREEK = "greek" - #: Selects the stopword list for Hindi. - HINDI = "hindi" - #: Selects the stopword list for Hungarian. - HUNGARIAN = "hungarian" - #: Selects the stopword list for Indonesian. - INDONESIAN = "indonesian" - #: Selects the stopword list for Irish. - IRISH = "irish" - #: Selects the stopword list for Italian. - ITALIAN = "italian" - #: Selects the stopword list for Latvian. - LATVIAN = "latvian" - #: Selects the stopword list for Norwegian. - NORWEGIAN = "norwegian" - #: Selects the stopword list for Persian. - PERSIAN = "persian" - #: Selects the stopword list for Portuguese. - PORTUGUESE = "portuguese" - #: Selects the stopword list for Romanian. - ROMANIAN = "romanian" - #: Selects the stopword list for Russian. - RUSSIAN = "russian" - #: Selects the stopword list for Sorani. - SORANI = "sorani" - #: Selects the stopword list for Spanish. - SPANISH = "spanish" - #: Selects the stopword list for Swedish. - SWEDISH = "swedish" - #: Selects the stopword list for Thai. - THAI = "thai" - #: Selects the stopword list for Turkish. - TURKISH = "turkish" - -class TextSplitMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """A value indicating which split mode to perform. - """ - - #: Split the text into individual pages. - PAGES = "pages" - #: Split the text into individual sentences. - SENTENCES = "sentences" - -class TextTranslationSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The language codes supported for input text by TextTranslationSkill. - """ - - #: Afrikaans. - AF = "af" - #: Arabic. - AR = "ar" - #: Bangla. - BN = "bn" - #: Bosnian (Latin). - BS = "bs" - #: Bulgarian. - BG = "bg" - #: Cantonese (Traditional). - YUE = "yue" - #: Catalan. - CA = "ca" - #: Chinese Simplified. - ZH_HANS = "zh-Hans" - #: Chinese Traditional. - ZH_HANT = "zh-Hant" - #: Croatian. - HR = "hr" - #: Czech. - CS = "cs" - #: Danish. - DA = "da" - #: Dutch. - NL = "nl" - #: English. - EN = "en" - #: Estonian. - ET = "et" - #: Fijian. - FJ = "fj" - #: Filipino. - FIL = "fil" - #: Finnish. - FI = "fi" - #: French. - FR = "fr" - #: German. - DE = "de" - #: Greek. - EL = "el" - #: Haitian Creole. - HT = "ht" - #: Hebrew. - HE = "he" - #: Hindi. - HI = "hi" - #: Hmong Daw. - MWW = "mww" - #: Hungarian. - HU = "hu" - #: Icelandic. - IS_ENUM = "is" - #: Indonesian. - ID = "id" - #: Italian. - IT = "it" - #: Japanese. - JA = "ja" - #: Kiswahili. - SW = "sw" - #: Klingon. - TLH = "tlh" - #: Korean. - KO = "ko" - #: Latvian. - LV = "lv" - #: Lithuanian. - LT = "lt" - #: Malagasy. - MG = "mg" - #: Malay. - MS = "ms" - #: Maltese. - MT = "mt" - #: Norwegian. - NB = "nb" - #: Persian. - FA = "fa" - #: Polish. - PL = "pl" - #: Portuguese. - PT = "pt" - #: Queretaro Otomi. - OTQ = "otq" - #: Romanian. - RO = "ro" - #: Russian. - RU = "ru" - #: Samoan. - SM = "sm" - #: Serbian (Cyrillic). - SR_CYRL = "sr-Cyrl" - #: Serbian (Latin). - SR_LATN = "sr-Latn" - #: Slovak. - SK = "sk" - #: Slovenian. - SL = "sl" - #: Spanish. - ES = "es" - #: Swedish. - SV = "sv" - #: Tahitian. - TY = "ty" - #: Tamil. - TA = "ta" - #: Telugu. - TE = "te" - #: Thai. - TH = "th" - #: Tongan. - TO = "to" - #: Turkish. - TR = "tr" - #: Ukrainian. - UK = "uk" - #: Urdu. - UR = "ur" - #: Vietnamese. - VI = "vi" - #: Welsh. - CY = "cy" - #: Yucatec Maya. - YUA = "yua" - -class TokenCharacterKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents classes of characters on which a token filter can operate. - """ - - #: Keeps letters in tokens. - LETTER = "letter" - #: Keeps digits in tokens. - DIGIT = "digit" - #: Keeps whitespace in tokens. - WHITESPACE = "whitespace" - #: Keeps punctuation in tokens. - PUNCTUATION = "punctuation" - #: Keeps symbols in tokens. - SYMBOL = "symbol" - -class TokenFilterName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines the names of all token filters supported by Azure Cognitive Search. - """ - - #: A token filter that applies the Arabic normalizer to normalize the orthography. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ar/ArabicNormalizationFilter.html. - ARABIC_NORMALIZATION = "arabic_normalization" - #: Strips all characters after an apostrophe (including the apostrophe itself). See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/tr/ApostropheFilter.html. - APOSTROPHE = "apostrophe" - #: Converts alphabetic, numeric, and symbolic Unicode characters which are not in the first 127 - #: ASCII characters (the "Basic Latin" Unicode block) into their ASCII equivalents, if such - #: equivalents exist. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html. - ASCII_FOLDING = "asciifolding" - #: Forms bigrams of CJK terms that are generated from the standard tokenizer. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/cjk/CJKBigramFilter.html. - CJK_BIGRAM = "cjk_bigram" - #: Normalizes CJK width differences. Folds fullwidth ASCII variants into the equivalent basic - #: Latin, and half-width Katakana variants into the equivalent Kana. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/cjk/CJKWidthFilter.html. - CJK_WIDTH = "cjk_width" - #: Removes English possessives, and dots from acronyms. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/standard/ClassicFilter.html. - CLASSIC = "classic" - #: Construct bigrams for frequently occurring terms while indexing. Single terms are still indexed - #: too, with bigrams overlaid. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/commongrams/CommonGramsFilter.html. - COMMON_GRAM = "common_grams" - #: Generates n-grams of the given size(s) starting from the front or the back of an input token. - #: See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ngram/EdgeNGramTokenFilter.html. - EDGE_N_GRAM = "edgeNGram_v2" - #: Removes elisions. For example, "l'avion" (the plane) will be converted to "avion" (plane). See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/util/ElisionFilter.html. - ELISION = "elision" - #: Normalizes German characters according to the heuristics of the German2 snowball algorithm. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/de/GermanNormalizationFilter.html. - GERMAN_NORMALIZATION = "german_normalization" - #: Normalizes text in Hindi to remove some differences in spelling variations. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/hi/HindiNormalizationFilter.html. - HINDI_NORMALIZATION = "hindi_normalization" - #: Normalizes the Unicode representation of text in Indian languages. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/in/IndicNormalizationFilter.html. - INDIC_NORMALIZATION = "indic_normalization" - #: Emits each incoming token twice, once as keyword and once as non-keyword. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/KeywordRepeatFilter.html. - KEYWORD_REPEAT = "keyword_repeat" - #: A high-performance kstem filter for English. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/en/KStemFilter.html. - K_STEM = "kstem" - #: Removes words that are too long or too short. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/LengthFilter.html. - LENGTH = "length" - #: Limits the number of tokens while indexing. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/LimitTokenCountFilter.html. - LIMIT = "limit" - #: Normalizes token text to lower case. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/LowerCaseFilter.htm. - LOWERCASE = "lowercase" - #: Generates n-grams of the given size(s). See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ngram/NGramTokenFilter.html. - N_GRAM = "nGram_v2" - #: Applies normalization for Persian. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/fa/PersianNormalizationFilter.html. - PERSIAN_NORMALIZATION = "persian_normalization" - #: Create tokens for phonetic matches. See https://lucene.apache.org/core/4_10_3/analyzers- - #: phonetic/org/apache/lucene/analysis/phonetic/package-tree.html. - PHONETIC = "phonetic" - #: Uses the Porter stemming algorithm to transform the token stream. See - #: http://tartarus.org/~martin/PorterStemmer. - PORTER_STEM = "porter_stem" - #: Reverses the token string. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html. - REVERSE = "reverse" - #: Normalizes use of the interchangeable Scandinavian characters. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/ScandinavianNormalizationFilter.html. - SCANDINAVIAN_NORMALIZATION = "scandinavian_normalization" - #: Folds Scandinavian characters åÅäæÄÆ->a and öÖøØ->o. It also discriminates against use of - #: double vowels aa, ae, ao, oe and oo, leaving just the first one. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/ScandinavianFoldingFilter.html. - SCANDINAVIAN_FOLDING_NORMALIZATION = "scandinavian_folding" - #: Creates combinations of tokens as a single token. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/shingle/ShingleFilter.html. - SHINGLE = "shingle" - #: A filter that stems words using a Snowball-generated stemmer. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/snowball/SnowballFilter.html. - SNOWBALL = "snowball" - #: Normalizes the Unicode representation of Sorani text. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/ckb/SoraniNormalizationFilter.html. - SORANI_NORMALIZATION = "sorani_normalization" - #: Language specific stemming filter. See - #: https://docs.microsoft.com/rest/api/searchservice/Custom-analyzers-in-Azure- - #: Search#TokenFilters. - STEMMER = "stemmer" - #: Removes stop words from a token stream. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/StopFilter.html. - STOPWORDS = "stopwords" - #: Trims leading and trailing whitespace from tokens. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/TrimFilter.html. - TRIM = "trim" - #: Truncates the terms to a specific length. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.html. - TRUNCATE = "truncate" - #: Filters out tokens with same text as the previous token. See - #: http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/miscellaneous/RemoveDuplicatesTokenFilter.html. - UNIQUE = "unique" - #: Normalizes token text to upper case. See http://lucene.apache.org/core/4_10_3/analyzers- - #: common/org/apache/lucene/analysis/core/UpperCaseFilter.html. - UPPERCASE = "uppercase" - #: Splits words into subwords and performs optional transformations on subword groups. - WORD_DELIMITER = "word_delimiter" - -class VisualFeature(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The strings indicating what visual feature types to return. - """ - - #: Visual features recognized as adult persons. - ADULT = "adult" - #: Visual features recognized as commercial brands. - BRANDS = "brands" - #: Categories. - CATEGORIES = "categories" - #: Description. - DESCRIPTION = "description" - #: Visual features recognized as people faces. - FACES = "faces" - #: Visual features recognized as objects. - OBJECTS = "objects" - #: Tags. - TAGS = "tags" diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_data_sources_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_data_sources_operations.py deleted file mode 100644 index f3ee57ff495b..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_data_sources_operations.py +++ /dev/null @@ -1,411 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class DataSourcesOperations(object): - """DataSourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def create_or_update( - self, - data_source_name, # type: str - data_source, # type: "_models.SearchIndexerDataSource" - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexerDataSource" - """Creates a new datasource or updates a datasource if it already exists. - - :param data_source_name: The name of the datasource to create or update. - :type data_source_name: str - :param data_source: The definition of the datasource to create or update. - :type data_source: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(data_source, 'SearchIndexerDataSource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SearchIndexerDataSource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SearchIndexerDataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore - - def delete( - self, - data_source_name, # type: str - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes a datasource. - - :param data_source_name: The name of the datasource to delete. - :type data_source_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore - - def get( - self, - data_source_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexerDataSource" - """Retrieves a datasource definition. - - :param data_source_name: The name of the datasource to retrieve. - :type data_source_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerDataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore - - def list( - self, - select=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.ListDataSourcesResult" - """Lists all datasources available for a search service. - - :param select: Selects which top-level properties of the data sources to retrieve. Specified as - a comma-separated list of JSON property names, or '*' for all properties. The default is all - properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListDataSourcesResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ListDataSourcesResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListDataSourcesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ListDataSourcesResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/datasources'} # type: ignore - - def create( - self, - data_source, # type: "_models.SearchIndexerDataSource" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexerDataSource" - """Creates a new datasource. - - :param data_source: The definition of the datasource to create. - :type data_source: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerDataSource, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerDataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerDataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(data_source, 'SearchIndexerDataSource') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerDataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/datasources'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_documents_operations.py deleted file mode 100644 index ed84d22812c9..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_documents_operations.py +++ /dev/null @@ -1,827 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class DocumentsOperations(object): - """DocumentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def count( - self, - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> int - """Queries the number of documents in the index. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: long, or the result of cls(response) - :rtype: long - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[int] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.count.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('long', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - count.metadata = {'url': '/docs/$count'} # type: ignore - - def search_get( - self, - search_text=None, # type: Optional[str] - search_options=None, # type: Optional["_models.SearchOptions"] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchDocumentsResult" - """Searches for documents in the index. - - :param search_text: A full-text search query expression; Use "*" or omit this parameter to - match all documents. - :type search_text: str - :param search_options: Parameter group. - :type search_options: ~azure.search.documents.v2020_06.models.SearchOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _include_total_result_count = None - _facets = None - _filter = None - _highlight_fields = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _query_type = None - _scoring_parameters = None - _scoring_profile = None - _search_fields = None - _search_mode = None - _scoring_statistics = None - _session_id = None - _select = None - _skip = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if search_options is not None: - _include_total_result_count = search_options.include_total_result_count - _facets = search_options.facets - _filter = search_options.filter - _highlight_fields = search_options.highlight_fields - _highlight_post_tag = search_options.highlight_post_tag - _highlight_pre_tag = search_options.highlight_pre_tag - _minimum_coverage = search_options.minimum_coverage - _order_by = search_options.order_by - _query_type = search_options.query_type - _scoring_parameters = search_options.scoring_parameters - _scoring_profile = search_options.scoring_profile - _search_fields = search_options.search_fields - _search_mode = search_options.search_mode - _scoring_statistics = search_options.scoring_statistics - _session_id = search_options.session_id - _select = search_options.select - _skip = search_options.skip - _top = search_options.top - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.search_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if search_text is not None: - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - if _include_total_result_count is not None: - query_parameters['$count'] = self._serialize.query("include_total_result_count", _include_total_result_count, 'bool') - if _facets is not None: - query_parameters['facet'] = [self._serialize.query("facets", q, 'str') if q is not None else '' for q in _facets] - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _highlight_fields is not None: - query_parameters['highlight'] = self._serialize.query("highlight_fields", _highlight_fields, '[str]', div=',') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _query_type is not None: - query_parameters['queryType'] = self._serialize.query("query_type", _query_type, 'str') - if _scoring_parameters is not None: - query_parameters['scoringParameter'] = [self._serialize.query("scoring_parameters", q, 'str') if q is not None else '' for q in _scoring_parameters] - if _scoring_profile is not None: - query_parameters['scoringProfile'] = self._serialize.query("scoring_profile", _scoring_profile, 'str') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _search_mode is not None: - query_parameters['searchMode'] = self._serialize.query("search_mode", _search_mode, 'str') - if _scoring_statistics is not None: - query_parameters['scoringStatistics'] = self._serialize.query("scoring_statistics", _scoring_statistics, 'str') - if _session_id is not None: - query_parameters['sessionId'] = self._serialize.query("session_id", _session_id, 'str') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", _skip, 'int') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_get.metadata = {'url': '/docs'} # type: ignore - - def search_post( - self, - search_request, # type: "_models.SearchRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchDocumentsResult" - """Searches for documents in the index. - - :param search_request: The definition of the Search request. - :type search_request: ~azure.search.documents.v2020_06.models.SearchRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.search_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(search_request, 'SearchRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_post.metadata = {'url': '/docs/search.post.search'} # type: ignore - - def get( - self, - key, # type: str - selected_fields=None, # type: Optional[List[str]] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> object - """Retrieves a document from the index. - - :param key: The key of the document to retrieve. - :type key: str - :param selected_fields: List of field names to retrieve for the document; Any field not - retrieved will be missing from the returned document. - :type selected_fields: list[str] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: object, or the result of cls(response) - :rtype: object - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[object] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'key': self._serialize.url("key", key, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if selected_fields is not None: - query_parameters['$select'] = self._serialize.query("selected_fields", selected_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('object', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/docs(\'{key}\')'} # type: ignore - - def suggest_get( - self, - search_text, # type: str - suggester_name, # type: str - suggest_options=None, # type: Optional["_models.SuggestOptions"] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SuggestDocumentsResult" - """Suggests documents in the index that match the given partial query text. - - :param search_text: The search text to use to suggest documents. Must be at least 1 character, - and no more than 100 characters. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param suggest_options: Parameter group. - :type suggest_options: ~azure.search.documents.v2020_06.models.SuggestOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _search_fields = None - _select = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if suggest_options is not None: - _filter = suggest_options.filter - _use_fuzzy_matching = suggest_options.use_fuzzy_matching - _highlight_post_tag = suggest_options.highlight_post_tag - _highlight_pre_tag = suggest_options.highlight_pre_tag - _minimum_coverage = suggest_options.minimum_coverage - _order_by = suggest_options.order_by - _search_fields = suggest_options.search_fields - _select = suggest_options.select - _top = suggest_options.top - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.suggest_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_get.metadata = {'url': '/docs/search.suggest'} # type: ignore - - def suggest_post( - self, - suggest_request, # type: "_models.SuggestRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SuggestDocumentsResult" - """Suggests documents in the index that match the given partial query text. - - :param suggest_request: The Suggest request. - :type suggest_request: ~azure.search.documents.v2020_06.models.SuggestRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.suggest_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(suggest_request, 'SuggestRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_post.metadata = {'url': '/docs/search.post.suggest'} # type: ignore - - def index( - self, - actions, # type: List["_models.IndexAction"] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.IndexDocumentsResult" - """Sends a batch of document write actions to the index. - - :param actions: The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06.models.IndexAction] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IndexDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.IndexDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IndexDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - - _batch = _models.IndexBatch(actions=actions) - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.index.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_batch, 'IndexBatch') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if response.status_code == 207: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - index.metadata = {'url': '/docs/search.index'} # type: ignore - - def autocomplete_get( - self, - search_text, # type: str - suggester_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - autocomplete_options=None, # type: Optional["_models.AutocompleteOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.AutocompleteResult" - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param search_text: The incomplete term which should be auto-completed. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :param autocomplete_options: Parameter group. - :type autocomplete_options: ~azure.search.documents.v2020_06.models.AutocompleteOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - _autocomplete_mode = None - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _search_fields = None - _top = None - if autocomplete_options is not None: - _autocomplete_mode = autocomplete_options.autocomplete_mode - _filter = autocomplete_options.filter - _use_fuzzy_matching = autocomplete_options.use_fuzzy_matching - _highlight_post_tag = autocomplete_options.highlight_post_tag - _highlight_pre_tag = autocomplete_options.highlight_pre_tag - _minimum_coverage = autocomplete_options.minimum_coverage - _search_fields = autocomplete_options.search_fields - _top = autocomplete_options.top - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.autocomplete_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _autocomplete_mode is not None: - query_parameters['autocompleteMode'] = self._serialize.query("autocomplete_mode", _autocomplete_mode, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_get.metadata = {'url': '/docs/search.autocomplete'} # type: ignore - - def autocomplete_post( - self, - autocomplete_request, # type: "_models.AutocompleteRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.AutocompleteResult" - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param autocomplete_request: The definition of the Autocomplete request. - :type autocomplete_request: ~azure.search.documents.v2020_06.models.AutocompleteRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.autocomplete_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(autocomplete_request, 'AutocompleteRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_post.metadata = {'url': '/docs/search.post.autocomplete'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_indexers_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_indexers_operations.py deleted file mode 100644 index 523329bac801..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_indexers_operations.py +++ /dev/null @@ -1,600 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class IndexersOperations(object): - """IndexersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def reset( - self, - indexer_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> None - """Resets the change tracking state associated with an indexer. - - :param indexer_name: The name of the indexer to reset. - :type indexer_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.reset.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - reset.metadata = {'url': '/indexers(\'{indexerName}\')/search.reset'} # type: ignore - - def run( - self, - indexer_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> None - """Runs an indexer on-demand. - - :param indexer_name: The name of the indexer to run. - :type indexer_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.run.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - run.metadata = {'url': '/indexers(\'{indexerName}\')/search.run'} # type: ignore - - def create_or_update( - self, - indexer_name, # type: str - indexer, # type: "_models.SearchIndexer" - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexer" - """Creates a new indexer or updates an indexer if it already exists. - - :param indexer_name: The name of the indexer to create or update. - :type indexer_name: str - :param indexer: The definition of the indexer to create or update. - :type indexer: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(indexer, 'SearchIndexer') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SearchIndexer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SearchIndexer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore - - def delete( - self, - indexer_name, # type: str - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes an indexer. - - :param indexer_name: The name of the indexer to delete. - :type indexer_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore - - def get( - self, - indexer_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexer" - """Retrieves an indexer definition. - - :param indexer_name: The name of the indexer to retrieve. - :type indexer_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore - - def list( - self, - select=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.ListIndexersResult" - """Lists all indexers available for a search service. - - :param select: Selects which top-level properties of the indexers to retrieve. Specified as a - comma-separated list of JSON property names, or '*' for all properties. The default is all - properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListIndexersResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ListIndexersResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexersResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ListIndexersResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/indexers'} # type: ignore - - def create( - self, - indexer, # type: "_models.SearchIndexer" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexer" - """Creates a new indexer. - - :param indexer: The definition of the indexer to create. - :type indexer: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexer, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(indexer, 'SearchIndexer') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/indexers'} # type: ignore - - def get_status( - self, - indexer_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexerStatus" - """Returns the current status and execution history of an indexer. - - :param indexer_name: The name of the indexer for which to retrieve status. - :type indexer_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerStatus, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get_status.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_status.metadata = {'url': '/indexers(\'{indexerName}\')/search.status'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_indexes_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_indexes_operations.py deleted file mode 100644 index df7a1ce57148..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_indexes_operations.py +++ /dev/null @@ -1,581 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class IndexesOperations(object): - """IndexesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def create( - self, - index, # type: "_models.SearchIndex" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndex" - """Creates a new search index. - - :param index: The definition of the index to create. - :type index: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(index, 'SearchIndex') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndex', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/indexes'} # type: ignore - - def list( - self, - select=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ListIndexesResult"] - """Lists all indexes available for a search service. - - :param select: Selects which top-level properties of the index definitions to retrieve. - Specified as a comma-separated list of JSON property names, or '*' for all properties. The - default is all properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ListIndexesResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.search.documents.indexes.v2020_06.models.ListIndexesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ListIndexesResult', pipeline_response) - list_of_elem = deserialized.indexes - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/indexes'} # type: ignore - - def create_or_update( - self, - index_name, # type: str - index, # type: "_models.SearchIndex" - allow_index_downtime=None, # type: Optional[bool] - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndex" - """Creates a new search index or updates an index if it already exists. - - :param index_name: The definition of the index to create or update. - :type index_name: str - :param index: The definition of the index to create or update. - :type index: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :param allow_index_downtime: Allows new analyzers, tokenizers, token filters, or char filters - to be added to an index by taking the index offline for at least a few seconds. This - temporarily causes indexing and query requests to fail. Performance and write availability of - the index can be impaired for several minutes after the index is updated, or longer for very - large indexes. - :type allow_index_downtime: bool - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if allow_index_downtime is not None: - query_parameters['allowIndexDowntime'] = self._serialize.query("allow_index_downtime", allow_index_downtime, 'bool') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(index, 'SearchIndex') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SearchIndex', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SearchIndex', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore - - def delete( - self, - index_name, # type: str - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes a search index and all the documents it contains. This operation is permanent, with no - recovery option. Make sure you have a master copy of your index definition, data ingestion - code, and a backup of the primary data source in case you need to re-build the index. - - :param index_name: The name of the index to delete. - :type index_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore - - def get( - self, - index_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndex" - """Retrieves an index definition. - - :param index_name: The name of the index to retrieve. - :type index_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndex, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndex - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndex"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndex', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore - - def get_statistics( - self, - index_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.GetIndexStatisticsResult" - """Returns statistics for the given index, including a document count and storage usage. - - :param index_name: The name of the index for which to retrieve statistics. - :type index_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: GetIndexStatisticsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.GetIndexStatisticsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.GetIndexStatisticsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get_statistics.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('GetIndexStatisticsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_statistics.metadata = {'url': '/indexes(\'{indexName}\')/search.stats'} # type: ignore - - def analyze( - self, - index_name, # type: str - request, # type: "_models.AnalyzeRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.AnalyzeResult" - """Shows how an analyzer breaks text into tokens. - - :param index_name: The name of the index for which to test an analyzer. - :type index_name: str - :param request: The text and analyzer or analysis components to test. - :type request: ~azure.search.documents.indexes.v2020_06.models.AnalyzeRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AnalyzeResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.AnalyzeResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalyzeResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.analyze.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request, 'AnalyzeRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AnalyzeResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - analyze.metadata = {'url': '/indexes(\'{indexName}\')/search.analyze'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_search_client_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_search_client_operations.py deleted file mode 100644 index 57f1e99ca526..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_search_client_operations.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class SearchClientOperationsMixin(object): - - def get_service_statistics( - self, - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.ServiceStatistics" - """Gets service level statistics for a search service. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServiceStatistics, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ServiceStatistics - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceStatistics"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get_service_statistics.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ServiceStatistics', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_service_statistics.metadata = {'url': '/servicestats'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_skillsets_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_skillsets_operations.py deleted file mode 100644 index c4ee82438cca..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_skillsets_operations.py +++ /dev/null @@ -1,412 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class SkillsetsOperations(object): - """SkillsetsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def create_or_update( - self, - skillset_name, # type: str - skillset, # type: "_models.SearchIndexerSkillset" - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexerSkillset" - """Creates a new skillset in a search service or updates the skillset if it already exists. - - :param skillset_name: The name of the skillset to create or update. - :type skillset_name: str - :param skillset: The skillset containing one or more skills to create or update in a search - service. - :type skillset: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(skillset, 'SearchIndexerSkillset') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SearchIndexerSkillset', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SearchIndexerSkillset', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore - - def delete( - self, - skillset_name, # type: str - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes a skillset in a search service. - - :param skillset_name: The name of the skillset to delete. - :type skillset_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore - - def get( - self, - skillset_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexerSkillset" - """Retrieves a skillset in a search service. - - :param skillset_name: The name of the skillset to retrieve. - :type skillset_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerSkillset', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore - - def list( - self, - select=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.ListSkillsetsResult" - """List all skillsets in a search service. - - :param select: Selects which top-level properties of the skillsets to retrieve. Specified as a - comma-separated list of JSON property names, or '*' for all properties. The default is all - properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListSkillsetsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ListSkillsetsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListSkillsetsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ListSkillsetsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/skillsets'} # type: ignore - - def create( - self, - skillset, # type: "_models.SearchIndexerSkillset" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchIndexerSkillset" - """Creates a new skillset in a search service. - - :param skillset: The skillset containing one or more skills to create in a search service. - :type skillset: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchIndexerSkillset, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SearchIndexerSkillset - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchIndexerSkillset"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(skillset, 'SearchIndexerSkillset') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchIndexerSkillset', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/skillsets'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_synonym_maps_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_synonym_maps_operations.py deleted file mode 100644 index f6a55dc3f63d..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/operations/_synonym_maps_operations.py +++ /dev/null @@ -1,411 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class SynonymMapsOperations(object): - """SynonymMapsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.indexes.v2020_06.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def create_or_update( - self, - synonym_map_name, # type: str - synonym_map, # type: "_models.SynonymMap" - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SynonymMap" - """Creates a new synonym map or updates a synonym map if it already exists. - - :param synonym_map_name: The name of the synonym map to create or update. - :type synonym_map_name: str - :param synonym_map: The definition of the synonym map to create or update. - :type synonym_map: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(synonym_map, 'SynonymMap') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('SynonymMap', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SynonymMap', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore - - def delete( - self, - synonym_map_name, # type: str - if_match=None, # type: Optional[str] - if_none_match=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes a synonym map. - - :param synonym_map_name: The name of the synonym map to delete. - :type synonym_map_name: str - :param if_match: Defines the If-Match condition. The operation will be performed only if the - ETag on the server matches this value. - :type if_match: str - :param if_none_match: Defines the If-None-Match condition. The operation will be performed only - if the ETag on the server does not match this value. - :type if_none_match: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore - - def get( - self, - synonym_map_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SynonymMap" - """Retrieves a synonym map definition. - - :param synonym_map_name: The name of the synonym map to retrieve. - :type synonym_map_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SynonymMap', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore - - def list( - self, - select=None, # type: Optional[str] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.ListSynonymMapsResult" - """Lists all synonym maps available for a search service. - - :param select: Selects which top-level properties of the synonym maps to retrieve. Specified as - a comma-separated list of JSON property names, or '*' for all properties. The default is all - properties. - :type select: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ListSynonymMapsResult, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.ListSynonymMapsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ListSynonymMapsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ListSynonymMapsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/synonymmaps'} # type: ignore - - def create( - self, - synonym_map, # type: "_models.SynonymMap" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SynonymMap" - """Creates a new synonym map. - - :param synonym_map: The definition of the synonym map to create. - :type synonym_map: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.indexes.v2020_06.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SynonymMap, or the result of cls(response) - :rtype: ~azure.search.documents.indexes.v2020_06.models.SynonymMap - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SynonymMap"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(synonym_map, 'SynonymMap') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SynonymMap', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/synonymmaps'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/py.typed b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/__init__.py deleted file mode 100644 index d58f5fc3b7f8..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._search_client import SearchClient -__all__ = ['SearchClient'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_configuration.py deleted file mode 100644 index ceafaf49bb0d..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_configuration.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -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 - -VERSION = "unknown" - -class SearchClientConfiguration(Configuration): - """Configuration for SearchClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - """ - - def __init__( - self, - endpoint, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - super(SearchClientConfiguration, self).__init__(**kwargs) - - self.endpoint = endpoint - self.api_version = "2020-06-30-Preview" - kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - 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') diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_metadata.json b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_metadata.json deleted file mode 100644 index b184114005d7..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_metadata.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "chosen_version": "2020-06-30-Preview", - "total_api_version_list": ["2020-06-30-Preview"], - "client": { - "name": "SearchClient", - "filename": "_search_client", - "description": "Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service.", - "base_url": null, - "custom_base_url": "\u0027{endpoint}\u0027", - "azure_arm": false, - "has_lro_operations": false, - "client_side_validation": false, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"PipelineClient\"]}, \"local\": {\"._configuration\": [\"SearchClientConfiguration\"], \"._operations_mixin\": [\"SearchClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.core\": [\"AsyncPipelineClient\"]}, \"local\": {\"._configuration\": [\"SearchClientConfiguration\"], \"._operations_mixin\": [\"SearchClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "global_parameters": { - "sync": { - "endpoint": { - "signature": "endpoint, # type: str", - "description": "The endpoint URL of the search service.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "endpoint": { - "signature": "endpoint: str,", - "description": "The endpoint URL of the search service.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "endpoint", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": false, - "credential_scopes": null, - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}" - }, - "operation_groups": { - "data_sources": "DataSourcesOperations", - "indexers": "IndexersOperations", - "skillsets": "SkillsetsOperations", - "synonym_maps": "SynonymMapsOperations", - "indexes": "IndexesOperations" - }, - "operation_mixins": { - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", - "operations": { - "get_service_statistics" : { - "sync": { - "signature": "def get_service_statistics(\n self,\n request_options=None, # type: Optional[\"_models.RequestOptions\"]\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Gets service level statistics for a search service.\n\n:param request_options: Parameter group.\n:type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ServiceStatistics, or the result of cls(response)\n:rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceStatistics\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def get_service_statistics(\n self,\n request_options: Optional[\"_models.RequestOptions\"] = None,\n **kwargs\n) -\u003e \"_models.ServiceStatistics\":\n", - "doc": "\"\"\"Gets service level statistics for a search service.\n\n:param request_options: Parameter group.\n:type request_options: ~azure.search.documents.indexes.v2020_06_preview.models.RequestOptions\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ServiceStatistics, or the result of cls(response)\n:rtype: ~azure.search.documents.indexes.v2020_06_preview.models.ServiceStatistics\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "request_options" - } - } - } -} \ No newline at end of file diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_search_client.py deleted file mode 100644 index d0f4594a107e..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/_search_client.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core import PipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import SearchClientConfiguration -from .operations import DataSourcesOperations -from .operations import IndexersOperations -from .operations import SkillsetsOperations -from .operations import SynonymMapsOperations -from .operations import IndexesOperations -from .operations import SearchClientOperationsMixin -from . import models - - -class SearchClient(SearchClientOperationsMixin): - """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. - - :ivar data_sources: DataSourcesOperations operations - :vartype data_sources: azure.search.documents.indexes.v2020_06_preview.operations.DataSourcesOperations - :ivar indexers: IndexersOperations operations - :vartype indexers: azure.search.documents.indexes.v2020_06_preview.operations.IndexersOperations - :ivar skillsets: SkillsetsOperations operations - :vartype skillsets: azure.search.documents.indexes.v2020_06_preview.operations.SkillsetsOperations - :ivar synonym_maps: SynonymMapsOperations operations - :vartype synonym_maps: azure.search.documents.indexes.v2020_06_preview.operations.SynonymMapsOperations - :ivar indexes: IndexesOperations operations - :vartype indexes: azure.search.documents.indexes.v2020_06_preview.operations.IndexesOperations - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - """ - - def __init__( - self, - endpoint, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - base_url = '{endpoint}' - self._config = SearchClientConfiguration(endpoint, **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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.data_sources = DataSourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexers = IndexersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.skillsets = SkillsetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.synonym_maps = SynonymMapsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexes = IndexesOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse - """Runs the network request through the client's chained policies. - - :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.pipeline.transport.HttpResponse - """ - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - 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 - self._client.close() - - def __enter__(self): - # type: () -> SearchClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/__init__.py deleted file mode 100644 index ec41d54fc046..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._search_client import SearchClient -__all__ = ['SearchClient'] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/_configuration.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/_configuration.py deleted file mode 100644 index b82610021e5f..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/_configuration.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies - -VERSION = "unknown" - -class SearchClientConfiguration(Configuration): - """Configuration for SearchClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - """ - - def __init__( - self, - endpoint: str, - **kwargs: Any - ) -> None: - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - super(SearchClientConfiguration, self).__init__(**kwargs) - - self.endpoint = endpoint - self.api_version = "2020-06-30-Preview" - kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> 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.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/_search_client.py deleted file mode 100644 index a298554ba94b..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/_search_client.py +++ /dev/null @@ -1,92 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any - -from azure.core import AsyncPipelineClient -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from msrest import Deserializer, Serializer - -from ._configuration import SearchClientConfiguration -from .operations import DataSourcesOperations -from .operations import IndexersOperations -from .operations import SkillsetsOperations -from .operations import SynonymMapsOperations -from .operations import IndexesOperations -from .operations import SearchClientOperationsMixin -from .. import models - - -class SearchClient(SearchClientOperationsMixin): - """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. - - :ivar data_sources: DataSourcesOperations operations - :vartype data_sources: azure.search.documents.indexes.v2020_06_preview.aio.operations.DataSourcesOperations - :ivar indexers: IndexersOperations operations - :vartype indexers: azure.search.documents.indexes.v2020_06_preview.aio.operations.IndexersOperations - :ivar skillsets: SkillsetsOperations operations - :vartype skillsets: azure.search.documents.indexes.v2020_06_preview.aio.operations.SkillsetsOperations - :ivar synonym_maps: SynonymMapsOperations operations - :vartype synonym_maps: azure.search.documents.indexes.v2020_06_preview.aio.operations.SynonymMapsOperations - :ivar indexes: IndexesOperations operations - :vartype indexes: azure.search.documents.indexes.v2020_06_preview.aio.operations.IndexesOperations - :param endpoint: The endpoint URL of the search service. - :type endpoint: str - """ - - def __init__( - self, - endpoint: str, - **kwargs: Any - ) -> None: - base_url = '{endpoint}' - self._config = SearchClientConfiguration(endpoint, **kwargs) - self._client = AsyncPipelineClient(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._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.data_sources = DataSourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexers = IndexersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.skillsets = SkillsetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.synonym_maps = SynonymMapsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexes = IndexesOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: - """Runs the network request through the client's chained policies. - - :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.pipeline.transport.AsyncHttpResponse - """ - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "SearchClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/__init__.py deleted file mode 100644 index 4ab9e775b13d..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._data_sources_operations import DataSourcesOperations -from ._indexers_operations import IndexersOperations -from ._skillsets_operations import SkillsetsOperations -from ._synonym_maps_operations import SynonymMapsOperations -from ._indexes_operations import IndexesOperations -from ._search_client_operations import SearchClientOperationsMixin - -__all__ = [ - 'DataSourcesOperations', - 'IndexersOperations', - 'SkillsetsOperations', - 'SynonymMapsOperations', - 'IndexesOperations', - 'SearchClientOperationsMixin', -] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_documents_operations.py deleted file mode 100644 index cb77618f7ec2..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/aio/operations/_documents_operations.py +++ /dev/null @@ -1,814 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DocumentsOperations: - """DocumentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.v2020_06_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def count( - self, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> int: - """Queries the number of documents in the index. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: long, or the result of cls(response) - :rtype: long - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[int] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.count.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('long', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - count.metadata = {'url': '/docs/$count'} # type: ignore - - async def search_get( - self, - search_text: Optional[str] = None, - search_options: Optional["_models.SearchOptions"] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchDocumentsResult": - """Searches for documents in the index. - - :param search_text: A full-text search query expression; Use "*" or omit this parameter to - match all documents. - :type search_text: str - :param search_options: Parameter group. - :type search_options: ~azure.search.documents.v2020_06_preview.models.SearchOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _include_total_result_count = None - _facets = None - _filter = None - _highlight_fields = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _query_type = None - _scoring_parameters = None - _scoring_profile = None - _search_fields = None - _search_mode = None - _scoring_statistics = None - _session_id = None - _select = None - _skip = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if search_options is not None: - _include_total_result_count = search_options.include_total_result_count - _facets = search_options.facets - _filter = search_options.filter - _highlight_fields = search_options.highlight_fields - _highlight_post_tag = search_options.highlight_post_tag - _highlight_pre_tag = search_options.highlight_pre_tag - _minimum_coverage = search_options.minimum_coverage - _order_by = search_options.order_by - _query_type = search_options.query_type - _scoring_parameters = search_options.scoring_parameters - _scoring_profile = search_options.scoring_profile - _search_fields = search_options.search_fields - _search_mode = search_options.search_mode - _scoring_statistics = search_options.scoring_statistics - _session_id = search_options.session_id - _select = search_options.select - _skip = search_options.skip - _top = search_options.top - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.search_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if search_text is not None: - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - if _include_total_result_count is not None: - query_parameters['$count'] = self._serialize.query("include_total_result_count", _include_total_result_count, 'bool') - if _facets is not None: - query_parameters['facet'] = [self._serialize.query("facets", q, 'str') if q is not None else '' for q in _facets] - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _highlight_fields is not None: - query_parameters['highlight'] = self._serialize.query("highlight_fields", _highlight_fields, '[str]', div=',') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _query_type is not None: - query_parameters['queryType'] = self._serialize.query("query_type", _query_type, 'str') - if _scoring_parameters is not None: - query_parameters['scoringParameter'] = [self._serialize.query("scoring_parameters", q, 'str') if q is not None else '' for q in _scoring_parameters] - if _scoring_profile is not None: - query_parameters['scoringProfile'] = self._serialize.query("scoring_profile", _scoring_profile, 'str') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _search_mode is not None: - query_parameters['searchMode'] = self._serialize.query("search_mode", _search_mode, 'str') - if _scoring_statistics is not None: - query_parameters['scoringStatistics'] = self._serialize.query("scoring_statistics", _scoring_statistics, 'str') - if _session_id is not None: - query_parameters['sessionId'] = self._serialize.query("session_id", _session_id, 'str') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", _skip, 'int') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_get.metadata = {'url': '/docs'} # type: ignore - - async def search_post( - self, - search_request: "_models.SearchRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SearchDocumentsResult": - """Searches for documents in the index. - - :param search_request: The definition of the Search request. - :type search_request: ~azure.search.documents.v2020_06_preview.models.SearchRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.search_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(search_request, 'SearchRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_post.metadata = {'url': '/docs/search.post.search'} # type: ignore - - async def get( - self, - key: str, - selected_fields: Optional[List[str]] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> object: - """Retrieves a document from the index. - - :param key: The key of the document to retrieve. - :type key: str - :param selected_fields: List of field names to retrieve for the document; Any field not - retrieved will be missing from the returned document. - :type selected_fields: list[str] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: object, or the result of cls(response) - :rtype: object - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[object] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'key': self._serialize.url("key", key, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if selected_fields is not None: - query_parameters['$select'] = self._serialize.query("selected_fields", selected_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('object', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/docs(\'{key}\')'} # type: ignore - - async def suggest_get( - self, - search_text: str, - suggester_name: str, - suggest_options: Optional["_models.SuggestOptions"] = None, - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SuggestDocumentsResult": - """Suggests documents in the index that match the given partial query text. - - :param search_text: The search text to use to suggest documents. Must be at least 1 character, - and no more than 100 characters. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param suggest_options: Parameter group. - :type suggest_options: ~azure.search.documents.v2020_06_preview.models.SuggestOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _search_fields = None - _select = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if suggest_options is not None: - _filter = suggest_options.filter - _use_fuzzy_matching = suggest_options.use_fuzzy_matching - _highlight_post_tag = suggest_options.highlight_post_tag - _highlight_pre_tag = suggest_options.highlight_pre_tag - _minimum_coverage = suggest_options.minimum_coverage - _order_by = suggest_options.order_by - _search_fields = suggest_options.search_fields - _select = suggest_options.select - _top = suggest_options.top - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.suggest_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_get.metadata = {'url': '/docs/search.suggest'} # type: ignore - - async def suggest_post( - self, - suggest_request: "_models.SuggestRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.SuggestDocumentsResult": - """Suggests documents in the index that match the given partial query text. - - :param suggest_request: The Suggest request. - :type suggest_request: ~azure.search.documents.v2020_06_preview.models.SuggestRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.suggest_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(suggest_request, 'SuggestRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_post.metadata = {'url': '/docs/search.post.suggest'} # type: ignore - - async def index( - self, - actions: List["_models.IndexAction"], - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.IndexDocumentsResult": - """Sends a batch of document write actions to the index. - - :param actions: The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06_preview.models.IndexAction] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IndexDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.IndexDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IndexDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - - _batch = _models.IndexBatch(actions=actions) - api_version = "2020-06-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.index.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_batch, 'IndexBatch') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if response.status_code == 207: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - index.metadata = {'url': '/docs/search.index'} # type: ignore - - async def autocomplete_get( - self, - search_text: str, - suggester_name: str, - request_options: Optional["_models.RequestOptions"] = None, - autocomplete_options: Optional["_models.AutocompleteOptions"] = None, - **kwargs - ) -> "_models.AutocompleteResult": - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param search_text: The incomplete term which should be auto-completed. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :param autocomplete_options: Parameter group. - :type autocomplete_options: ~azure.search.documents.v2020_06_preview.models.AutocompleteOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - _autocomplete_mode = None - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _search_fields = None - _top = None - if autocomplete_options is not None: - _autocomplete_mode = autocomplete_options.autocomplete_mode - _filter = autocomplete_options.filter - _use_fuzzy_matching = autocomplete_options.use_fuzzy_matching - _highlight_post_tag = autocomplete_options.highlight_post_tag - _highlight_pre_tag = autocomplete_options.highlight_pre_tag - _minimum_coverage = autocomplete_options.minimum_coverage - _search_fields = autocomplete_options.search_fields - _top = autocomplete_options.top - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.autocomplete_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _autocomplete_mode is not None: - query_parameters['autocompleteMode'] = self._serialize.query("autocomplete_mode", _autocomplete_mode, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_get.metadata = {'url': '/docs/search.autocomplete'} # type: ignore - - async def autocomplete_post( - self, - autocomplete_request: "_models.AutocompleteRequest", - request_options: Optional["_models.RequestOptions"] = None, - **kwargs - ) -> "_models.AutocompleteResult": - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param autocomplete_request: The definition of the Autocomplete request. - :type autocomplete_request: ~azure.search.documents.v2020_06_preview.models.AutocompleteRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.autocomplete_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(autocomplete_request, 'AutocompleteRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_post.metadata = {'url': '/docs/search.post.autocomplete'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/__init__.py deleted file mode 100644 index 4ab9e775b13d..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._data_sources_operations import DataSourcesOperations -from ._indexers_operations import IndexersOperations -from ._skillsets_operations import SkillsetsOperations -from ._synonym_maps_operations import SynonymMapsOperations -from ._indexes_operations import IndexesOperations -from ._search_client_operations import SearchClientOperationsMixin - -__all__ = [ - 'DataSourcesOperations', - 'IndexersOperations', - 'SkillsetsOperations', - 'SynonymMapsOperations', - 'IndexesOperations', - 'SearchClientOperationsMixin', -] diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_documents_operations.py deleted file mode 100644 index d1f737f530bd..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/operations/_documents_operations.py +++ /dev/null @@ -1,827 +0,0 @@ -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class DocumentsOperations(object): - """DocumentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.search.documents.v2020_06_preview.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def count( - self, - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> int - """Queries the number of documents in the index. - - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: long, or the result of cls(response) - :rtype: long - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[int] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.count.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('long', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - count.metadata = {'url': '/docs/$count'} # type: ignore - - def search_get( - self, - search_text=None, # type: Optional[str] - search_options=None, # type: Optional["_models.SearchOptions"] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchDocumentsResult" - """Searches for documents in the index. - - :param search_text: A full-text search query expression; Use "*" or omit this parameter to - match all documents. - :type search_text: str - :param search_options: Parameter group. - :type search_options: ~azure.search.documents.v2020_06_preview.models.SearchOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _include_total_result_count = None - _facets = None - _filter = None - _highlight_fields = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _query_type = None - _scoring_parameters = None - _scoring_profile = None - _search_fields = None - _search_mode = None - _scoring_statistics = None - _session_id = None - _select = None - _skip = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if search_options is not None: - _include_total_result_count = search_options.include_total_result_count - _facets = search_options.facets - _filter = search_options.filter - _highlight_fields = search_options.highlight_fields - _highlight_post_tag = search_options.highlight_post_tag - _highlight_pre_tag = search_options.highlight_pre_tag - _minimum_coverage = search_options.minimum_coverage - _order_by = search_options.order_by - _query_type = search_options.query_type - _scoring_parameters = search_options.scoring_parameters - _scoring_profile = search_options.scoring_profile - _search_fields = search_options.search_fields - _search_mode = search_options.search_mode - _scoring_statistics = search_options.scoring_statistics - _session_id = search_options.session_id - _select = search_options.select - _skip = search_options.skip - _top = search_options.top - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.search_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if search_text is not None: - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - if _include_total_result_count is not None: - query_parameters['$count'] = self._serialize.query("include_total_result_count", _include_total_result_count, 'bool') - if _facets is not None: - query_parameters['facet'] = [self._serialize.query("facets", q, 'str') if q is not None else '' for q in _facets] - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _highlight_fields is not None: - query_parameters['highlight'] = self._serialize.query("highlight_fields", _highlight_fields, '[str]', div=',') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _query_type is not None: - query_parameters['queryType'] = self._serialize.query("query_type", _query_type, 'str') - if _scoring_parameters is not None: - query_parameters['scoringParameter'] = [self._serialize.query("scoring_parameters", q, 'str') if q is not None else '' for q in _scoring_parameters] - if _scoring_profile is not None: - query_parameters['scoringProfile'] = self._serialize.query("scoring_profile", _scoring_profile, 'str') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _search_mode is not None: - query_parameters['searchMode'] = self._serialize.query("search_mode", _search_mode, 'str') - if _scoring_statistics is not None: - query_parameters['scoringStatistics'] = self._serialize.query("scoring_statistics", _scoring_statistics, 'str') - if _session_id is not None: - query_parameters['sessionId'] = self._serialize.query("session_id", _session_id, 'str') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", _skip, 'int') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_get.metadata = {'url': '/docs'} # type: ignore - - def search_post( - self, - search_request, # type: "_models.SearchRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SearchDocumentsResult" - """Searches for documents in the index. - - :param search_request: The definition of the Search request. - :type search_request: ~azure.search.documents.v2020_06_preview.models.SearchRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SearchDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.search_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(search_request, 'SearchRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SearchDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - search_post.metadata = {'url': '/docs/search.post.search'} # type: ignore - - def get( - self, - key, # type: str - selected_fields=None, # type: Optional[List[str]] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> object - """Retrieves a document from the index. - - :param key: The key of the document to retrieve. - :type key: str - :param selected_fields: List of field names to retrieve for the document; Any field not - retrieved will be missing from the returned document. - :type selected_fields: list[str] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: object, or the result of cls(response) - :rtype: object - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[object] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - 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'), - 'key': self._serialize.url("key", key, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if selected_fields is not None: - query_parameters['$select'] = self._serialize.query("selected_fields", selected_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('object', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/docs(\'{key}\')'} # type: ignore - - def suggest_get( - self, - search_text, # type: str - suggester_name, # type: str - suggest_options=None, # type: Optional["_models.SuggestOptions"] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SuggestDocumentsResult" - """Suggests documents in the index that match the given partial query text. - - :param search_text: The search text to use to suggest documents. Must be at least 1 character, - and no more than 100 characters. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param suggest_options: Parameter group. - :type suggest_options: ~azure.search.documents.v2020_06_preview.models.SuggestOptions - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _order_by = None - _search_fields = None - _select = None - _top = None - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - if suggest_options is not None: - _filter = suggest_options.filter - _use_fuzzy_matching = suggest_options.use_fuzzy_matching - _highlight_post_tag = suggest_options.highlight_post_tag - _highlight_pre_tag = suggest_options.highlight_pre_tag - _minimum_coverage = suggest_options.minimum_coverage - _order_by = suggest_options.order_by - _search_fields = suggest_options.search_fields - _select = suggest_options.select - _top = suggest_options.top - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.suggest_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_get.metadata = {'url': '/docs/search.suggest'} # type: ignore - - def suggest_post( - self, - suggest_request, # type: "_models.SuggestRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.SuggestDocumentsResult" - """Suggests documents in the index that match the given partial query text. - - :param suggest_request: The Suggest request. - :type suggest_request: ~azure.search.documents.v2020_06_preview.models.SuggestRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SuggestDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.SuggestDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SuggestDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.suggest_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(suggest_request, 'SuggestRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('SuggestDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - suggest_post.metadata = {'url': '/docs/search.post.suggest'} # type: ignore - - def index( - self, - actions, # type: List["_models.IndexAction"] - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.IndexDocumentsResult" - """Sends a batch of document write actions to the index. - - :param actions: The actions in the batch. - :type actions: list[~azure.search.documents.v2020_06_preview.models.IndexAction] - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IndexDocumentsResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.IndexDocumentsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IndexDocumentsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - - _batch = _models.IndexBatch(actions=actions) - api_version = "2020-06-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.index.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_batch, 'IndexBatch') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - if response.status_code == 200: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if response.status_code == 207: - deserialized = self._deserialize('IndexDocumentsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - index.metadata = {'url': '/docs/search.index'} # type: ignore - - def autocomplete_get( - self, - search_text, # type: str - suggester_name, # type: str - request_options=None, # type: Optional["_models.RequestOptions"] - autocomplete_options=None, # type: Optional["_models.AutocompleteOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.AutocompleteResult" - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param search_text: The incomplete term which should be auto-completed. - :type search_text: str - :param suggester_name: The name of the suggester as specified in the suggesters collection - that's part of the index definition. - :type suggester_name: str - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :param autocomplete_options: Parameter group. - :type autocomplete_options: ~azure.search.documents.v2020_06_preview.models.AutocompleteOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - _autocomplete_mode = None - _filter = None - _use_fuzzy_matching = None - _highlight_post_tag = None - _highlight_pre_tag = None - _minimum_coverage = None - _search_fields = None - _top = None - if autocomplete_options is not None: - _autocomplete_mode = autocomplete_options.autocomplete_mode - _filter = autocomplete_options.filter - _use_fuzzy_matching = autocomplete_options.use_fuzzy_matching - _highlight_post_tag = autocomplete_options.highlight_post_tag - _highlight_pre_tag = autocomplete_options.highlight_pre_tag - _minimum_coverage = autocomplete_options.minimum_coverage - _search_fields = autocomplete_options.search_fields - _top = autocomplete_options.top - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - accept = "application/json" - - # Construct URL - url = self.autocomplete_get.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _autocomplete_mode is not None: - query_parameters['autocompleteMode'] = self._serialize.query("autocomplete_mode", _autocomplete_mode, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_get.metadata = {'url': '/docs/search.autocomplete'} # type: ignore - - def autocomplete_post( - self, - autocomplete_request, # type: "_models.AutocompleteRequest" - request_options=None, # type: Optional["_models.RequestOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.AutocompleteResult" - """Autocompletes incomplete query terms based on input text and matching terms in the index. - - :param autocomplete_request: The definition of the Autocomplete request. - :type autocomplete_request: ~azure.search.documents.v2020_06_preview.models.AutocompleteRequest - :param request_options: Parameter group. - :type request_options: ~azure.search.documents.v2020_06_preview.models.RequestOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AutocompleteResult, or the result of cls(response) - :rtype: ~azure.search.documents.v2020_06_preview.models.AutocompleteResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AutocompleteResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2020-06-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.autocomplete_post.metadata['url'] # type: ignore - 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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(autocomplete_request, 'AutocompleteRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AutocompleteResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - autocomplete_post.metadata = {'url': '/docs/search.post.autocomplete'} # type: ignore diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/py.typed b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/v2020_06_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file From 62565fbe14dac3eecae22f82124d1beb30578184 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 14 Apr 2021 17:08:19 -0700 Subject: [PATCH 2/2] update --- .../tests/test_search_client.py | 22 +++++++++---------- .../tests/test_search_index_client.py | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sdk/search/azure-search-documents/tests/test_search_client.py b/sdk/search/azure-search-documents/tests/test_search_client.py index cd103e247e0f..d1cb060e6891 100644 --- a/sdk/search/azure-search-documents/tests/test_search_client.py +++ b/sdk/search/azure-search-documents/tests/test_search_client.py @@ -104,7 +104,7 @@ def test_repr(self): ) @mock.patch( - "azure.search.documents._generated.v2020_06_preview.operations._documents_operations.DocumentsOperations.count" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.count" ) def test_get_document_count(self, mock_count): client = SearchClient("endpoint", "index name", CREDENTIAL) @@ -116,7 +116,7 @@ def test_get_document_count(self, mock_count): @mock.patch( - "azure.search.documents._generated.v2020_06_preview.operations._documents_operations.DocumentsOperations.get" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.get" ) def test_get_document(self, mock_get): client = SearchClient("endpoint", "index name", CREDENTIAL) @@ -139,7 +139,7 @@ def test_get_document(self, mock_get): assert mock_get.call_args[1]["selected_fields"] == "foo" @mock.patch( - "azure.search.documents._generated.v2020_06_preview.operations._documents_operations.DocumentsOperations.search_post" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.search_post" ) def test_search_query_argument(self, mock_search_post): client = SearchClient("endpoint", "index name", CREDENTIAL) @@ -158,7 +158,7 @@ def test_search_query_argument(self, mock_search_post): ) @mock.patch( - "azure.search.documents._generated.v2020_06_preview.operations._documents_operations.DocumentsOperations.suggest_post" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.suggest_post" ) def test_suggest_query_argument(self, mock_suggest_post): client = SearchClient("endpoint", "index name", CREDENTIAL) @@ -182,7 +182,7 @@ def test_suggest_bad_argument(self): ) @mock.patch( - "azure.search.documents._generated.v2020_06_preview.operations._documents_operations.DocumentsOperations.autocomplete_post" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.autocomplete_post" ) def test_autocomplete_query_argument(self, mock_autocomplete_post): client = SearchClient("endpoint", "index name", CREDENTIAL) @@ -198,7 +198,7 @@ def test_autocomplete_query_argument(self, mock_autocomplete_post): ) @mock.patch( - "azure.search.documents._generated.v2020_06.operations._documents_operations.DocumentsOperations.count" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.count" ) def test_get_document_count_v2020_06_30(self, mock_count): client = SearchClient("endpoint", "index name", CREDENTIAL, api_version=ApiVersion.V2020_06_30) @@ -209,7 +209,7 @@ def test_get_document_count_v2020_06_30(self, mock_count): assert mock_count.call_args[1]["headers"] == client._headers @mock.patch( - "azure.search.documents._generated.v2020_06.operations._documents_operations.DocumentsOperations.get" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.get" ) def test_get_document_v2020_06_30(self, mock_get): client = SearchClient("endpoint", "index name", CREDENTIAL, api_version=ApiVersion.V2020_06_30) @@ -232,7 +232,7 @@ def test_get_document_v2020_06_30(self, mock_get): assert mock_get.call_args[1]["selected_fields"] == "foo" @mock.patch( - "azure.search.documents._generated.v2020_06.operations._documents_operations.DocumentsOperations.search_post" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.search_post" ) def test_search_query_argument_v2020_06_30(self, mock_search_post): client = SearchClient("endpoint", "index name", CREDENTIAL, api_version=ApiVersion.V2020_06_30) @@ -251,7 +251,7 @@ def test_search_query_argument_v2020_06_30(self, mock_search_post): ) @mock.patch( - "azure.search.documents._generated.v2020_06.operations._documents_operations.DocumentsOperations.suggest_post" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.suggest_post" ) def test_suggest_query_argument_v2020_06_30(self, mock_suggest_post): client = SearchClient("endpoint", "index name", CREDENTIAL, api_version=ApiVersion.V2020_06_30) @@ -267,7 +267,7 @@ def test_suggest_query_argument_v2020_06_30(self, mock_suggest_post): ) @mock.patch( - "azure.search.documents._generated.v2020_06.operations._documents_operations.DocumentsOperations.autocomplete_post" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.autocomplete_post" ) def test_autocomplete_query_argument_v2020_06_30(self, mock_autocomplete_post): client = SearchClient("endpoint", "index name", CREDENTIAL, api_version=ApiVersion.V2020_06_30) @@ -318,7 +318,7 @@ def test_add_method(self, arg, method_name): assert mock_index_documents.call_args[1]["extra"] == "foo" @mock.patch( - "azure.search.documents._generated.v2020_06_preview.operations._documents_operations.DocumentsOperations.index" + "azure.search.documents._generated.operations._documents_operations.DocumentsOperations.index" ) def test_index_documents(self, mock_index): client = SearchClient("endpoint", "index name", CREDENTIAL) diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client.py b/sdk/search/azure-search-documents/tests/test_search_index_client.py index f7122795949a..5c89870afb47 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client.py @@ -46,7 +46,7 @@ def test_get_search_client(self): assert isinstance(search_client, SearchClient) @mock.patch( - "azure.search.documents.indexes._generated._operations_mixin.SearchClientOperationsMixin.get_service_statistics" + "azure.search.documents.indexes._generated.operations.SearchClientOperationsMixin.get_service_statistics" ) def test_get_service_statistics(self, mock_get_stats): client = SearchIndexClient("endpoint", CREDENTIAL) @@ -56,7 +56,7 @@ def test_get_service_statistics(self, mock_get_stats): assert mock_get_stats.call_args[1] == {"headers": client._headers} @mock.patch( - "azure.search.documents.indexes._generated._operations_mixin.SearchClientOperationsMixin.get_service_statistics" + "azure.search.documents.indexes._generated.operations.SearchClientOperationsMixin.get_service_statistics" ) def test_get_service_statistics_v2020_06_30(self, mock_get_stats): client = SearchIndexClient("endpoint", CREDENTIAL, api_version=ApiVersion.V2020_06_30)