Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import json
from typing import (
Any,
Iterable,
Dict,
Union,
TYPE_CHECKING,
Expand Down Expand Up @@ -39,6 +38,7 @@
from azure.core.credentials import AzureKeyCredential, TokenCredential
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.paging import ItemPaged
PipelineResponseType = HttpResponse


Expand Down Expand Up @@ -182,7 +182,7 @@ def delete_model(self, model_id, **kwargs):

@distributed_trace
def list_custom_models(self, **kwargs):
# type: (Any) -> Iterable[CustomFormModelInfo]
# type: (Any) -> ItemPaged[CustomFormModelInfo]
"""List information for each model, including model id,
model status, and when it was created and last modified.

Expand All @@ -199,7 +199,7 @@ def list_custom_models(self, **kwargs):
:dedent: 8
:caption: List model information for each model on the account.
"""
return self._client.list_custom_models(
return self._client.list_custom_models( # type: ignore
cls=kwargs.pop("cls", lambda objs: [CustomFormModelInfo._from_generated(x) for x in objs]),
error_map=error_map,
**kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import json
from typing import (
Any,
AsyncIterable,
Dict,
Union,
TYPE_CHECKING,
Expand All @@ -18,6 +17,7 @@
from azure.core.polling.async_base_polling import AsyncLROBasePolling
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.async_paging import AsyncItemPaged
from ._form_recognizer_client_async import FormRecognizerClient
from .._generated.aio._form_recognizer_client_async import FormRecognizerClient as FormRecognizer
from .._generated.models import (
Expand Down Expand Up @@ -188,7 +188,7 @@ async def delete_model(self, model_id: str, **kwargs: Any) -> None:
)

@distributed_trace
def list_custom_models(self, **kwargs: Any) -> AsyncIterable[CustomFormModelInfo]:
def list_custom_models(self, **kwargs: Any) -> AsyncItemPaged[CustomFormModelInfo]:
"""List information for each model, including model id,
model status, and when it was created and last modified.

Expand All @@ -205,7 +205,7 @@ def list_custom_models(self, **kwargs: Any) -> AsyncIterable[CustomFormModelInfo
:dedent: 12
:caption: List model information for each model on the account.
"""
return self._client.list_custom_models(
return self._client.list_custom_models( # type: ignore
cls=kwargs.pop("cls", lambda objs: [CustomFormModelInfo._from_generated(x) for x in objs]),
error_map=error_map,
**kwargs
Expand Down