Skip to content

Commit

Permalink
Use latest swagger (#27288)
Browse files Browse the repository at this point in the history
* Use swagger #904899a23a417768ce1ec1d5f89f33817f8ef8ad

* update

* updates

* update changelog
  • Loading branch information
xiangyan99 authored Nov 4, 2022
1 parent d08c4f4 commit 5a79ca8
Show file tree
Hide file tree
Showing 71 changed files with 17,437 additions and 21,052 deletions.
4 changes: 4 additions & 0 deletions sdk/identity/azure-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
Issue [#25713](https://github.com/Azure/azure-sdk-for-python/issues/25713) tracks this. In the meantime
Visual Studio Code users can authenticate their development environment using the [Azure CLI](https://learn.microsoft.com/cli/azure/).

### Other Changes

- Added Python 3.11 support and stopped supporting Python 3.6.

## 1.12.0b2 (2022-10-11)

1.12.0 release candidate
Expand Down
14 changes: 10 additions & 4 deletions sdk/search/azure-search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Release History

## 11.4.0b2 (Unreleased)
## 11.4.0b2 (2022-11-08)

### Features Added

### Breaking Changes

### Bugs Fixed
- Enabled `OcrSkill` and `ImageAnalysisSkill`

### Other Changes

- Added Python 3.11 support.

## 11.4.0b1 (2022-09-08)

### Features Added

- Added support to create, update and delete aliases via the `SearchIndexClient`.

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

### Features Added

- Added support for other national clouds.
- Added support for TokenCredential

### Bugs Fixed

- Fixed issue where async `search` call would fail with a 403 error when retrieving large number of documents.

### Other Changes

- Python 3.6 is no longer supported. Please use Python version 3.7 or later.

## 11.2.2 (2022-04-14)

### Bugs Fixed

- Fixes a bug allowing users to set keys for cognitive service skills using the API. Exposes `DefaultCognitiveServicesAccount` and `CognitiveServicesAccountKey`

## 11.3.0b8 (2022-03-08)

### Features Added

- Added support to create, update and delete aliases via the `SearchIndexClient`.

## 11.3.0b7 (2022-02-08)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.3, generator: @autorest/[email protected])
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

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

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"SearchIndexClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
@@ -1,46 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.3, generator: @autorest/[email protected])
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
import sys
from typing import Any

from azure.core.configuration import Configuration
from azure.core.pipeline import policies

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

VERSION = "unknown"

class SearchClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for SearchClient.

class SearchIndexClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for SearchIndexClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param endpoint: The endpoint URL of the search service.
:param endpoint: The endpoint URL of the search service. Required.
:type endpoint: str
:param index_name: The name of the index.
:param index_name: The name of the index. Required.
:type index_name: str
:keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that
overriding this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2021-04-30-Preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
self,
endpoint, # type: str
index_name, # type: str
**kwargs # type: Any
):
# type: (...) -> None
super(SearchClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2021-04-30-Preview") # type: str
def __init__(self, endpoint: str, index_name: str, **kwargs: Any) -> None:
super(SearchIndexClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2021-04-30-Preview") # type: Literal["2021-04-30-Preview"]

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand All @@ -50,20 +45,19 @@ def __init__(
self.endpoint = endpoint
self.index_name = index_name
self.api_version = api_version
kwargs.setdefault('sdk_moniker', 'search-documents/{}'.format(VERSION))
kwargs.setdefault("sdk_moniker", "searchindexclient/{}".format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs # type: Any
self, **kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List

__all__: List[str] = [] # Add all objects you want publicly available to users at this package level


# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
Original file line number Diff line number Diff line change
@@ -1,66 +1,49 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.3, generator: @autorest/[email protected])
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import TYPE_CHECKING

from msrest import Deserializer, Serializer
from typing import Any

from azure.core import PipelineClient
from azure.core.rest import HttpRequest, HttpResponse

from . import models
from ._configuration import SearchClientConfiguration
from ._configuration import SearchIndexClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import DocumentsOperations

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

from azure.core.rest import HttpRequest, HttpResponse

class SearchClient(object):
class SearchIndexClient: # pylint: disable=client-accepts-api-version-keyword
"""Client that can be used to query an index and upload, merge, or delete documents.
:ivar documents: DocumentsOperations operations
:vartype documents: azure.search.documents.operations.DocumentsOperations
:param endpoint: The endpoint URL of the search service.
:vartype documents: search_index_client.operations.DocumentsOperations
:param endpoint: The endpoint URL of the search service. Required.
:type endpoint: str
:param index_name: The name of the index.
:param index_name: The name of the index. Required.
:type index_name: str
:keyword api_version: Api Version. The default value is "2021-04-30-Preview". Note that
overriding this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2021-04-30-Preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
self,
endpoint, # type: str
index_name, # type: str
**kwargs # type: Any
):
# type: (...) -> None
_base_url = '{endpoint}/indexes(\'{indexName}\')'
self._config = SearchClientConfiguration(endpoint=endpoint, index_name=index_name, **kwargs)
self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs)
def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self, endpoint: str, index_name: str, **kwargs: Any
) -> None:
_endpoint = "{endpoint}/indexes('{indexName}')"
self._config = SearchIndexClientConfiguration(endpoint=endpoint, index_name=index_name, **kwargs)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)

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


def _send_request(
self,
request, # type: HttpRequest
**kwargs # type: Any
):
# type: (...) -> HttpResponse
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
Expand All @@ -69,7 +52,7 @@ def _send_request(
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
Expand All @@ -80,8 +63,8 @@ def _send_request(

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

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

def __enter__(self):
# type: () -> SearchClient
# type: () -> SearchIndexClient
self._client.__enter__()
return self

Expand Down
Loading

0 comments on commit 5a79ca8

Please sign in to comment.