|
5 | 5 | # Code generated by Microsoft (R) Python Code Generator.
|
6 | 6 | # Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
7 | 7 | # --------------------------------------------------------------------------
|
8 |
| -import json # pylint: disable=unused-import |
9 |
| -import sys |
| 8 | +from collections.abc import MutableMapping |
10 | 9 | from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, TypeVar
|
11 | 10 | import urllib.parse
|
12 | 11 |
|
| 12 | +from azure.core import PipelineClient |
13 | 13 | from azure.core.exceptions import (
|
14 | 14 | ClientAuthenticationError,
|
15 | 15 | HttpResponseError,
|
|
26 | 26 | from azure.core.tracing.decorator import distributed_trace
|
27 | 27 | from azure.core.utils import case_insensitive_dict
|
28 | 28 |
|
29 |
| -from .._model_base import SdkJSONEncoder, _deserialize # pylint: disable=unused-import |
30 |
| -from .._serialization import Serializer |
31 |
| -from .._vendor import SchemaRegistryClientMixinABC |
| 29 | +from .._configuration import SchemaRegistryClientConfiguration |
| 30 | +from .._utils.model_base import _deserialize |
| 31 | +from .._utils.serialization import Serializer |
| 32 | +from .._utils.utils import ClientMixinABC |
32 | 33 |
|
33 |
| -if sys.version_info >= (3, 9): |
34 |
| - from collections.abc import MutableMapping |
35 |
| -else: |
36 |
| - from typing import MutableMapping # type: ignore |
37 | 34 | T = TypeVar("T")
|
38 | 35 | ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
39 | 36 |
|
@@ -201,7 +198,7 @@ def build_schema_registry_register_schema_request( # pylint: disable=name-too-l
|
201 | 198 | return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
|
202 | 199 |
|
203 | 200 |
|
204 |
| -class SchemaRegistryClientOperationsMixin(SchemaRegistryClientMixinABC): |
| 201 | +class SchemaRegistryClientOperationsMixin(ClientMixinABC[PipelineClient, SchemaRegistryClientConfiguration]): |
205 | 202 |
|
206 | 203 | @distributed_trace
|
207 | 204 | def _list_schema_groups(self, **kwargs: Any) -> Iterable[str]:
|
@@ -271,7 +268,7 @@ def prepare_request(next_link=None):
|
271 | 268 |
|
272 | 269 | def extract_data(pipeline_response):
|
273 | 270 | deserialized = pipeline_response.http_response.json()
|
274 |
| - list_of_elem = _deserialize(List[str], deserialized["Value"]) |
| 271 | + list_of_elem = _deserialize(List[str], deserialized.get("Value", [])) |
275 | 272 | if cls:
|
276 | 273 | list_of_elem = cls(list_of_elem) # type: ignore
|
277 | 274 | return deserialized.get("NextLink") or None, iter(list_of_elem)
|
@@ -367,7 +364,7 @@ def prepare_request(next_link=None):
|
367 | 364 |
|
368 | 365 | def extract_data(pipeline_response):
|
369 | 366 | deserialized = pipeline_response.http_response.json()
|
370 |
| - list_of_elem = _deserialize(List[int], deserialized["Value"]) |
| 367 | + list_of_elem = _deserialize(List[int], deserialized.get("Value", [])) |
371 | 368 | if cls:
|
372 | 369 | list_of_elem = cls(list_of_elem) # type: ignore
|
373 | 370 | return deserialized.get("NextLink") or None, iter(list_of_elem)
|
|
0 commit comments