|
9 | 9 | from io import IOBase
|
10 | 10 | import json
|
11 | 11 | import sys
|
12 |
| -from typing import Any, Callable, Dict, IO, Iterable, List, Optional, TypeVar, Union, cast, overload |
| 12 | +from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Type, TypeVar, Union, cast, overload |
13 | 13 | import urllib.parse
|
14 | 14 |
|
15 | 15 | from azure.core.exceptions import (
|
@@ -460,7 +460,7 @@ def _analyze_document_initial( # pylint: disable=inconsistent-return-statements
|
460 | 460 | output_content_format: Optional[Union[str, _models.ContentFormat]] = None,
|
461 | 461 | **kwargs: Any,
|
462 | 462 | ) -> None:
|
463 |
| - error_map = { |
| 463 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
464 | 464 | 401: ClientAuthenticationError,
|
465 | 465 | 404: ResourceNotFoundError,
|
466 | 466 | 409: ResourceExistsError,
|
@@ -3686,7 +3686,7 @@ def _classify_document_initial( # pylint: disable=inconsistent-return-statement
|
3686 | 3686 | split: Optional[Union[str, _models.SplitMode]] = None,
|
3687 | 3687 | **kwargs: Any,
|
3688 | 3688 | ) -> None:
|
3689 |
| - error_map = { |
| 3689 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
3690 | 3690 | 401: ClientAuthenticationError,
|
3691 | 3691 | 404: ResourceNotFoundError,
|
3692 | 3692 | 409: ResourceExistsError,
|
@@ -6831,7 +6831,7 @@ class DocumentIntelligenceAdministrationClientOperationsMixin( # pylint: disabl
|
6831 | 6831 | def _build_document_model_initial( # pylint: disable=inconsistent-return-statements
|
6832 | 6832 | self, build_request: Union[_models.BuildDocumentModelRequest, JSON, IO[bytes]], **kwargs: Any
|
6833 | 6833 | ) -> None:
|
6834 |
| - error_map = { |
| 6834 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
6835 | 6835 | 401: ClientAuthenticationError,
|
6836 | 6836 | 404: ResourceNotFoundError,
|
6837 | 6837 | 409: ResourceExistsError,
|
@@ -7331,7 +7331,7 @@ def get_long_running_output(pipeline_response):
|
7331 | 7331 | def _compose_model_initial( # pylint: disable=inconsistent-return-statements
|
7332 | 7332 | self, compose_request: Union[_models.ComposeDocumentModelRequest, JSON, IO[bytes]], **kwargs: Any
|
7333 | 7333 | ) -> None:
|
7334 |
| - error_map = { |
| 7334 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
7335 | 7335 | 401: ClientAuthenticationError,
|
7336 | 7336 | 404: ResourceNotFoundError,
|
7337 | 7337 | 409: ResourceExistsError,
|
@@ -7982,7 +7982,7 @@ def authorize_model_copy(
|
7982 | 7982 | the document model should be copied to. Required.
|
7983 | 7983 | }
|
7984 | 7984 | """
|
7985 |
| - error_map = { |
| 7985 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
7986 | 7986 | 401: ClientAuthenticationError,
|
7987 | 7987 | 404: ResourceNotFoundError,
|
7988 | 7988 | 409: ResourceExistsError,
|
@@ -8042,7 +8042,7 @@ def authorize_model_copy(
|
8042 | 8042 | def _copy_model_to_initial( # pylint: disable=inconsistent-return-statements
|
8043 | 8043 | self, model_id: str, copy_to_request: Union[_models.CopyAuthorization, JSON, IO[bytes]], **kwargs: Any
|
8044 | 8044 | ) -> None:
|
8045 |
| - error_map = { |
| 8045 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
8046 | 8046 | 401: ClientAuthenticationError,
|
8047 | 8047 | 404: ResourceNotFoundError,
|
8048 | 8048 | 409: ResourceExistsError,
|
@@ -8619,7 +8619,7 @@ def get_model(self, model_id: str, **kwargs: Any) -> _models.DocumentModelDetail
|
8619 | 8619 | ]
|
8620 | 8620 | }
|
8621 | 8621 | """
|
8622 |
| - error_map = { |
| 8622 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
8623 | 8623 | 401: ClientAuthenticationError,
|
8624 | 8624 | 404: ResourceNotFoundError,
|
8625 | 8625 | 409: ResourceExistsError,
|
@@ -8755,7 +8755,7 @@ def list_models(self, **kwargs: Any) -> Iterable["_models.DocumentModelDetails"]
|
8755 | 8755 |
|
8756 | 8756 | cls: ClsType[List[_models.DocumentModelDetails]] = kwargs.pop("cls", None)
|
8757 | 8757 |
|
8758 |
| - error_map = { |
| 8758 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
8759 | 8759 | 401: ClientAuthenticationError,
|
8760 | 8760 | 404: ResourceNotFoundError,
|
8761 | 8761 | 409: ResourceExistsError,
|
@@ -8837,7 +8837,7 @@ def delete_model(self, model_id: str, **kwargs: Any) -> None: # pylint: disable
|
8837 | 8837 | :rtype: None
|
8838 | 8838 | :raises ~azure.core.exceptions.HttpResponseError:
|
8839 | 8839 | """
|
8840 |
| - error_map = { |
| 8840 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
8841 | 8841 | 401: ClientAuthenticationError,
|
8842 | 8842 | 404: ResourceNotFoundError,
|
8843 | 8843 | 409: ResourceExistsError,
|
@@ -8911,7 +8911,7 @@ def get_resource_info(self, **kwargs: Any) -> _models.ResourceDetails:
|
8911 | 8911 | }
|
8912 | 8912 | }
|
8913 | 8913 | """
|
8914 |
| - error_map = { |
| 8914 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
8915 | 8915 | 401: ClientAuthenticationError,
|
8916 | 8916 | 404: ResourceNotFoundError,
|
8917 | 8917 | 409: ResourceExistsError,
|
@@ -8971,6 +8971,7 @@ def get_operation(self, operation_id: str, **kwargs: Any) -> _models.OperationDe
|
8971 | 8971 |
|
8972 | 8972 | Example:
|
8973 | 8973 | .. code-block:: python
|
| 8974 | + |
8974 | 8975 | # The response is polymorphic. The following are possible polymorphic responses based
|
8975 | 8976 | off discriminator "kind":
|
8976 | 8977 |
|
@@ -9263,7 +9264,7 @@ def get_operation(self, operation_id: str, **kwargs: Any) -> _models.OperationDe
|
9263 | 9264 | # response body for status code(s): 200
|
9264 | 9265 | response == operation_details
|
9265 | 9266 | """
|
9266 |
| - error_map = { |
| 9267 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
9267 | 9268 | 401: ClientAuthenticationError,
|
9268 | 9269 | 404: ResourceNotFoundError,
|
9269 | 9270 | 409: ResourceExistsError,
|
@@ -9327,6 +9328,7 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.OperationDetails"]
|
9327 | 9328 |
|
9328 | 9329 | Example:
|
9329 | 9330 | .. code-block:: python
|
| 9331 | + |
9330 | 9332 | # The response is polymorphic. The following are possible polymorphic responses based
|
9331 | 9333 | off discriminator "kind":
|
9332 | 9334 |
|
@@ -9624,7 +9626,7 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.OperationDetails"]
|
9624 | 9626 |
|
9625 | 9627 | cls: ClsType[List[_models.OperationDetails]] = kwargs.pop("cls", None)
|
9626 | 9628 |
|
9627 |
| - error_map = { |
| 9629 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
9628 | 9630 | 401: ClientAuthenticationError,
|
9629 | 9631 | 404: ResourceNotFoundError,
|
9630 | 9632 | 409: ResourceExistsError,
|
@@ -9699,7 +9701,7 @@ def get_next(next_link=None):
|
9699 | 9701 | def _build_classifier_initial( # pylint: disable=inconsistent-return-statements
|
9700 | 9702 | self, build_request: Union[_models.BuildDocumentClassifierRequest, JSON, IO[bytes]], **kwargs: Any
|
9701 | 9703 | ) -> None:
|
9702 |
| - error_map = { |
| 9704 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
9703 | 9705 | 401: ClientAuthenticationError,
|
9704 | 9706 | 404: ResourceNotFoundError,
|
9705 | 9707 | 409: ResourceExistsError,
|
@@ -10170,7 +10172,7 @@ def get_classifier(self, classifier_id: str, **kwargs: Any) -> _models.DocumentC
|
10170 | 10172 | ]
|
10171 | 10173 | }
|
10172 | 10174 | """
|
10173 |
| - error_map = { |
| 10175 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
10174 | 10176 | 401: ClientAuthenticationError,
|
10175 | 10177 | 404: ResourceNotFoundError,
|
10176 | 10178 | 409: ResourceExistsError,
|
@@ -10282,7 +10284,7 @@ def list_classifiers(self, **kwargs: Any) -> Iterable["_models.DocumentClassifie
|
10282 | 10284 |
|
10283 | 10285 | cls: ClsType[List[_models.DocumentClassifierDetails]] = kwargs.pop("cls", None)
|
10284 | 10286 |
|
10285 |
| - error_map = { |
| 10287 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
10286 | 10288 | 401: ClientAuthenticationError,
|
10287 | 10289 | 404: ResourceNotFoundError,
|
10288 | 10290 | 409: ResourceExistsError,
|
@@ -10366,7 +10368,7 @@ def delete_classifier( # pylint: disable=inconsistent-return-statements
|
10366 | 10368 | :rtype: None
|
10367 | 10369 | :raises ~azure.core.exceptions.HttpResponseError:
|
10368 | 10370 | """
|
10369 |
| - error_map = { |
| 10371 | + error_map: MutableMapping[int, Type[HttpResponseError]] = { |
10370 | 10372 | 401: ClientAuthenticationError,
|
10371 | 10373 | 404: ResourceNotFoundError,
|
10372 | 10374 | 409: ResourceExistsError,
|
|
0 commit comments