From 7454feb29902c2cda63720d722243dc8ced8ff39 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Fri, 16 May 2025 01:39:13 +0000 Subject: [PATCH 1/6] Update dependencies (2025-05-16 01:39:13) --- packages/autorest.python/package.json | 4 ++-- packages/typespec-python/package.json | 4 ++-- pnpm-lock.yaml | 15 ++++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 5ef8cb31c9..367c599873 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "~0.11.3", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" @@ -47,4 +47,4 @@ "requirements.txt", "generator/" ] -} +} \ No newline at end of file diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index c213b88076..71e87d001b 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -64,7 +64,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "~0.11.3", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -99,4 +99,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2cacf3c8d..9a9abb4390 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: ~0.11.3 - version: 0.11.3(3wtk2dpxeawdlyhxiqauzpqcq4) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz(3wtk2dpxeawdlyhxiqauzpqcq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: ~0.11.3 - version: 0.11.3(3wtk2dpxeawdlyhxiqauzpqcq4) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz(3wtk2dpxeawdlyhxiqauzpqcq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1539,8 +1539,9 @@ packages: peerDependencies: '@typespec/compiler': ^1.0.0 - '@typespec/http-client-python@0.11.3': - resolution: {integrity: sha512-ikNjmIadoLmBf26/+3njMWs0jeqEvNalPvxGIYv4q9L08TQIUYFUMDLWzwZQr9RA8U7B++5PtSG06MGbfK8vOw==} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz} + version: 0.11.3 engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.56.0 <1.0.0' @@ -5955,7 +5956,7 @@ snapshots: dependencies: '@typespec/compiler': 1.0.0(@types/node@22.13.17) - '@typespec/http-client-python@0.11.3(3wtk2dpxeawdlyhxiqauzpqcq4)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz(3wtk2dpxeawdlyhxiqauzpqcq4)': dependencies: '@azure-tools/typespec-autorest': 0.56.0(rnyagkipe6ane6slysupm3neby) '@azure-tools/typespec-azure-core': 0.56.0(@typespec/compiler@1.0.0(@types/node@22.13.17))(@typespec/http@1.0.0(@typespec/compiler@1.0.0(@types/node@22.13.17))(@typespec/streams@0.70.0(@typespec/compiler@1.0.0(@types/node@22.13.17))))(@typespec/rest@0.70.0(@typespec/compiler@1.0.0(@types/node@22.13.17))(@typespec/http@1.0.0(@typespec/compiler@1.0.0(@types/node@22.13.17))(@typespec/streams@0.70.0(@typespec/compiler@1.0.0(@types/node@22.13.17))))) From 04fb7897330c3b18f6cff8f5f5097ee2c1e06b1d Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Fri, 16 May 2025 01:43:58 +0000 Subject: [PATCH 2/6] Regenerate for typespec-python (2025-05-16 01:43:58) --- .../generated/azure-core-basic/_metadata.json | 3 +++ .../core/basic/_operations/_operations.py | 4 ++-- .../core/basic/aio/_operations/_operations.py | 4 ++-- .../azure-core-lro-rpc/_metadata.json | 3 +++ .../azure-core-lro-standard/_metadata.json | 3 +++ .../generated/azure-core-model/_metadata.json | 3 +++ .../generated/azure-core-page/_metadata.json | 3 +++ .../core/page/aio/operations/_operations.py | 20 +++++++++---------- .../azure/core/page/operations/_operations.py | 20 +++++++++---------- .../azure-core-scalar/_metadata.json | 3 +++ .../azure-core-traits/_metadata.json | 3 +++ .../azure-example-basic/_metadata.json | 3 +++ .../pageable/_operations/_operations.py | 4 ++-- .../pageable/aio/_operations/_operations.py | 4 ++-- .../_metadata.json | 3 +++ .../_metadata.json | 3 +++ .../_metadata.json | 3 +++ .../aio/operations/_operations.py | 4 ++-- .../operations/_operations.py | 4 ++-- .../_metadata.json | 3 +++ .../resources/aio/operations/_operations.py | 14 ++++++------- .../resources/operations/_operations.py | 14 ++++++------- .../aio/operations/_operations.py | 4 ++-- .../aio/operations/_operations.py | 10 +++++----- .../operations/_operations.py | 10 +++++----- .../operations/_operations.py | 4 ++-- .../resiliency-srv-driven1/_metadata.json | 3 +++ .../resiliency-srv-driven2/_metadata.json | 3 +++ .../server-path-multiple/_metadata.json | 3 +++ .../server-versions-versioned/_metadata.json | 3 +++ .../generated/versioning-added/_metadata.json | 3 +++ .../versioning-madeoptional/_metadata.json | 3 +++ .../versioning-removed/_metadata.json | 3 +++ .../versioning-renamedfrom/_metadata.json | 3 +++ .../_metadata.json | 3 +++ .../versioning-typechangedfrom/_metadata.json | 3 +++ .../aio/operations/_operations.py | 4 ++-- .../aio/operations/_operations.py | 10 +++++----- .../operations/_operations.py | 10 +++++----- .../operations/_operations.py | 4 ++-- 40 files changed, 140 insertions(+), 74 deletions(-) create mode 100644 packages/typespec-python/test/azure/generated/azure-core-basic/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-core-lro-rpc/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-core-lro-standard/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-core-model/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-core-page/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-core-scalar/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-core-traits/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-example-basic/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-resources/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/server-path-multiple/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/server-versions-versioned/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/versioning-added/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/versioning-madeoptional/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/versioning-removed/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/versioning-renamedfrom/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/_metadata.json create mode 100644 packages/typespec-python/test/azure/generated/versioning-typechangedfrom/_metadata.json diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/_metadata.json b/packages/typespec-python/test/azure/generated/azure-core-basic/_metadata.json new file mode 100644 index 0000000000..d1a7203fa7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py index acbd1edd5c..2d49261e41 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py @@ -8,7 +8,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, Dict, IO, Iterable, List, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -577,7 +577,7 @@ def list( select: Optional[List[str]] = None, expand: Optional[List[str]] = None, **kwargs: Any - ) -> Iterable["_models.User"]: + ) -> ItemPaged["_models.User"]: """Lists all users. Lists all Users. diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py index 897284c806..f8e7cc4911 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -400,7 +400,7 @@ def list( select: Optional[List[str]] = None, expand: Optional[List[str]] = None, **kwargs: Any - ) -> AsyncIterable["_models.User"]: + ) -> AsyncItemPaged["_models.User"]: """Lists all users. Lists all Users. diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/_metadata.json b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/_metadata.json new file mode 100644 index 0000000000..d1a7203fa7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-standard/_metadata.json b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/_metadata.json new file mode 100644 index 0000000000..d1a7203fa7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-standard/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-core-model/_metadata.json b/packages/typespec-python/test/azure/generated/azure-core-model/_metadata.json new file mode 100644 index 0000000000..d1a7203fa7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-model/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/_metadata.json b/packages/typespec-python/test/azure/generated/azure-core-page/_metadata.json new file mode 100644 index 0000000000..d1a7203fa7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-page/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/aio/operations/_operations.py index 1913340940..67e987e821 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/aio/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -64,7 +64,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_first_item(self, **kwargs: Any) -> AsyncIterable["_models.FirstItem"]: + def list_first_item(self, **kwargs: Any) -> AsyncItemPaged["_models.FirstItem"]: """Two operations with two different page item types should be successfully generated. Should generate model for FirstItem. @@ -147,7 +147,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_second_item(self, **kwargs: Any) -> AsyncIterable["_models.SecondItem"]: + def list_second_item(self, **kwargs: Any) -> AsyncItemPaged["_models.SecondItem"]: """Two operations with two different page item types should be successfully generated. Should generate model for SecondItem. @@ -235,7 +235,7 @@ class PageClientOperationsMixin( ): @distributed_trace - def list_with_page(self, **kwargs: Any) -> AsyncIterable["_models.User"]: + def list_with_page(self, **kwargs: Any) -> AsyncItemPaged["_models.User"]: """List with Azure.Core.Page<>. :return: An iterator like instance of User @@ -324,7 +324,7 @@ def list_with_parameters( another: Optional[Union[str, _models.ListItemInputExtensibleEnum]] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable["_models.User"]: + ) -> AsyncItemPaged["_models.User"]: """List with extensible enum parameter Azure.Core.Page<>. :param body_input: The body of the input. Required. @@ -348,7 +348,7 @@ def list_with_parameters( another: Optional[Union[str, _models.ListItemInputExtensibleEnum]] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable["_models.User"]: + ) -> AsyncItemPaged["_models.User"]: """List with extensible enum parameter Azure.Core.Page<>. :param body_input: The body of the input. Required. @@ -372,7 +372,7 @@ def list_with_parameters( another: Optional[Union[str, _models.ListItemInputExtensibleEnum]] = None, content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable["_models.User"]: + ) -> AsyncItemPaged["_models.User"]: """List with extensible enum parameter Azure.Core.Page<>. :param body_input: The body of the input. Required. @@ -395,7 +395,7 @@ def list_with_parameters( *, another: Optional[Union[str, _models.ListItemInputExtensibleEnum]] = None, **kwargs: Any - ) -> AsyncIterable["_models.User"]: + ) -> AsyncItemPaged["_models.User"]: """List with extensible enum parameter Azure.Core.Page<>. :param body_input: The body of the input. Is one of the following types: ListItemInputBody, @@ -493,7 +493,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_with_custom_page_model(self, **kwargs: Any) -> AsyncIterable["_models.User"]: + def list_with_custom_page_model(self, **kwargs: Any) -> AsyncItemPaged["_models.User"]: """List with custom page model. :return: An iterator like instance of User @@ -577,7 +577,7 @@ async def get_next(next_link=None): @distributed_trace def with_parameterized_next_link( self, *, select: str, include_pending: Optional[bool] = None, **kwargs: Any - ) -> AsyncIterable["_models.User"]: + ) -> AsyncItemPaged["_models.User"]: """List with parameterized next link that re-injects parameters. :keyword select: Required. diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py index f4f532a3ae..d43e02f6b0 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py @@ -8,7 +8,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, Dict, IO, Iterable, List, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -186,7 +186,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_first_item(self, **kwargs: Any) -> Iterable["_models.FirstItem"]: + def list_first_item(self, **kwargs: Any) -> ItemPaged["_models.FirstItem"]: """Two operations with two different page item types should be successfully generated. Should generate model for FirstItem. @@ -269,7 +269,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_second_item(self, **kwargs: Any) -> Iterable["_models.SecondItem"]: + def list_second_item(self, **kwargs: Any) -> ItemPaged["_models.SecondItem"]: """Two operations with two different page item types should be successfully generated. Should generate model for SecondItem. @@ -355,7 +355,7 @@ def get_next(next_link=None): class PageClientOperationsMixin(ClientMixinABC[PipelineClient[HttpRequest, HttpResponse], PageClientConfiguration]): @distributed_trace - def list_with_page(self, **kwargs: Any) -> Iterable["_models.User"]: + def list_with_page(self, **kwargs: Any) -> ItemPaged["_models.User"]: """List with Azure.Core.Page<>. :return: An iterator like instance of User @@ -444,7 +444,7 @@ def list_with_parameters( another: Optional[Union[str, _models.ListItemInputExtensibleEnum]] = None, content_type: str = "application/json", **kwargs: Any, - ) -> Iterable["_models.User"]: + ) -> ItemPaged["_models.User"]: """List with extensible enum parameter Azure.Core.Page<>. :param body_input: The body of the input. Required. @@ -468,7 +468,7 @@ def list_with_parameters( another: Optional[Union[str, _models.ListItemInputExtensibleEnum]] = None, content_type: str = "application/json", **kwargs: Any, - ) -> Iterable["_models.User"]: + ) -> ItemPaged["_models.User"]: """List with extensible enum parameter Azure.Core.Page<>. :param body_input: The body of the input. Required. @@ -492,7 +492,7 @@ def list_with_parameters( another: Optional[Union[str, _models.ListItemInputExtensibleEnum]] = None, content_type: str = "application/json", **kwargs: Any, - ) -> Iterable["_models.User"]: + ) -> ItemPaged["_models.User"]: """List with extensible enum parameter Azure.Core.Page<>. :param body_input: The body of the input. Required. @@ -515,7 +515,7 @@ def list_with_parameters( *, another: Optional[Union[str, _models.ListItemInputExtensibleEnum]] = None, **kwargs: Any, - ) -> Iterable["_models.User"]: + ) -> ItemPaged["_models.User"]: """List with extensible enum parameter Azure.Core.Page<>. :param body_input: The body of the input. Is one of the following types: ListItemInputBody, @@ -613,7 +613,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_with_custom_page_model(self, **kwargs: Any) -> Iterable["_models.User"]: + def list_with_custom_page_model(self, **kwargs: Any) -> ItemPaged["_models.User"]: """List with custom page model. :return: An iterator like instance of User @@ -697,7 +697,7 @@ def get_next(next_link=None): @distributed_trace def with_parameterized_next_link( self, *, select: str, include_pending: Optional[bool] = None, **kwargs: Any - ) -> Iterable["_models.User"]: + ) -> ItemPaged["_models.User"]: """List with parameterized next link that re-injects parameters. :keyword select: Required. diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/_metadata.json b/packages/typespec-python/test/azure/generated/azure-core-scalar/_metadata.json new file mode 100644 index 0000000000..d1a7203fa7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-core-traits/_metadata.json b/packages/typespec-python/test/azure/generated/azure-core-traits/_metadata.json new file mode 100644 index 0000000000..d1a7203fa7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-traits/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-example-basic/_metadata.json b/packages/typespec-python/test/azure/generated/azure-example-basic/_metadata.json new file mode 100644 index 0000000000..d1a7203fa7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-example-basic/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/_operations/_operations.py index 9b3196f249..1e8fa735eb 100644 --- a/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/_operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core import PipelineClient from azure.core.exceptions import ( @@ -64,7 +64,7 @@ class PageableClientOperationsMixin( @api_version_validation( params_added_on={"1.0-preview.1": ["maxpagesize"]}, ) - def list(self, **kwargs: Any) -> Iterable["_models.User"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.User"]: """List users. :return: An iterator like instance of User diff --git a/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/aio/_operations/_operations.py index 33c370aec3..b8bb19d7a6 100644 --- a/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-payload-pageable/specs/azure/payload/pageable/aio/_operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,7 +42,7 @@ class PageableClientOperationsMixin( @api_version_validation( params_added_on={"1.0-preview.1": ["maxpagesize"]}, ) - def list(self, **kwargs: Any) -> AsyncIterable["_models.User"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.User"]: """List users. :return: An iterator like instance of User diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/_metadata.json b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/_metadata.json new file mode 100644 index 0000000000..d557cc647f --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-common-properties/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2023-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/_metadata.json b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/_metadata.json new file mode 100644 index 0000000000..d557cc647f --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2023-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/_metadata.json b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/_metadata.json new file mode 100644 index 0000000000..d557cc647f --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2023-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/aio/operations/_operations.py index dc0965765d..e8570cb670 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/aio/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -69,7 +69,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/operations/_operations.py index 415fff1d34..145723dc91 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-operation-templates/azure/resourcemanager/operationtemplates/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -231,7 +231,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/_metadata.json b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/_metadata.json new file mode 100644 index 0000000000..d557cc647f --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2023-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/aio/operations/_operations.py index 9cee1ab4ac..db3f9165a9 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/aio/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -747,7 +747,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.TopLevelTrackedResource"]: + ) -> AsyncItemPaged["_models.TopLevelTrackedResource"]: """List TopLevelTrackedResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -836,7 +836,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.TopLevelTrackedResource"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.TopLevelTrackedResource"]: """List TopLevelTrackedResource resources by subscription ID. :return: An iterator like instance of TopLevelTrackedResource @@ -1800,7 +1800,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_top_level_tracked_resource( self, resource_group_name: str, top_level_tracked_resource_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NestedProxyResource"]: + ) -> AsyncItemPaged["_models.NestedProxyResource"]: """List NestedProxyResource resources by TopLevelTrackedResource. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -2336,7 +2336,7 @@ async def update( @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SingletonTrackedResource"]: + ) -> AsyncItemPaged["_models.SingletonTrackedResource"]: """List SingletonTrackedResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -2962,7 +2962,7 @@ async def delete(self, resource_uri: str, extensions_resource_name: str, **kwarg return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list_by_scope(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.ExtensionsResource"]: + def list_by_scope(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.ExtensionsResource"]: """List ExtensionsResource resources by parent. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -3510,7 +3510,7 @@ async def delete(self, location: str, location_resource_name: str, **kwargs: Any return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.LocationResource"]: + def list_by_location(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.LocationResource"]: """List LocationResource resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/operations/_operations.py index ce9bf86789..869561404a 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-resources/azure/resourcemanager/resources/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -1506,7 +1506,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.TopLevelTrackedResource"]: + ) -> ItemPaged["_models.TopLevelTrackedResource"]: """List TopLevelTrackedResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1595,7 +1595,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.TopLevelTrackedResource"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.TopLevelTrackedResource"]: """List TopLevelTrackedResource resources by subscription ID. :return: An iterator like instance of TopLevelTrackedResource @@ -2559,7 +2559,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_top_level_tracked_resource( self, resource_group_name: str, top_level_tracked_resource_name: str, **kwargs: Any - ) -> Iterable["_models.NestedProxyResource"]: + ) -> ItemPaged["_models.NestedProxyResource"]: """List NestedProxyResource resources by TopLevelTrackedResource. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3095,7 +3095,7 @@ def update( @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.SingletonTrackedResource"]: + ) -> ItemPaged["_models.SingletonTrackedResource"]: """List SingletonTrackedResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3723,7 +3723,7 @@ def delete( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list_by_scope(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.ExtensionsResource"]: + def list_by_scope(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.ExtensionsResource"]: """List ExtensionsResource resources by parent. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -4273,7 +4273,7 @@ def delete( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.LocationResource"]: + def list_by_location(self, location: str, **kwargs: Any) -> ItemPaged["_models.LocationResource"]: """List LocationResource resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py index 5fd2465d9f..f83db6b940 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -55,7 +55,7 @@ def __init__(self, *args, **kwargs) -> None: ) @distributed_trace - def link(self, **kwargs: Any) -> AsyncIterable["_models3.Pet"]: + def link(self, **kwargs: Any) -> AsyncItemPaged["_models3.Pet"]: """link. :return: An iterator like instance of Pet diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py index fdefe473c1..381e4de5db 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def request_query_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncItemPaged["_models4.Pet"]: """request_query_response_body. :keyword foo: Default value is None. @@ -123,7 +123,7 @@ async def get_next(_continuation_token=None): @distributed_trace def request_header_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncItemPaged["_models4.Pet"]: """request_header_response_body. :keyword foo: Default value is None. @@ -189,7 +189,7 @@ async def get_next(_continuation_token=None): @distributed_trace def request_query_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncItemPaged["_models4.Pet"]: """request_query_response_header. :keyword foo: Default value is None. @@ -255,7 +255,7 @@ async def get_next(_continuation_token=None): @distributed_trace def request_header_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncItemPaged["_models4.Pet"]: """request_header_response_header. :keyword foo: Default value is None. diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py index 4b453a23d1..47d2ad88c1 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core import PipelineClient from azure.core.exceptions import ( @@ -156,7 +156,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def request_query_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> ItemPaged["_models3.Pet"]: """request_query_response_body. :keyword foo: Default value is None. @@ -222,7 +222,7 @@ def get_next(_continuation_token=None): @distributed_trace def request_header_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> ItemPaged["_models3.Pet"]: """request_header_response_body. :keyword foo: Default value is None. @@ -288,7 +288,7 @@ def get_next(_continuation_token=None): @distributed_trace def request_query_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> ItemPaged["_models3.Pet"]: """request_query_response_header. :keyword foo: Default value is None. @@ -354,7 +354,7 @@ def get_next(_continuation_token=None): @distributed_trace def request_header_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> ItemPaged["_models3.Pet"]: """request_header_response_header. :keyword foo: Default value is None. diff --git a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py index 6dfe0ffca8..f6b813825b 100644 --- a/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core import PipelineClient from azure.core.exceptions import ( @@ -72,7 +72,7 @@ def __init__(self, *args, **kwargs) -> None: ) @distributed_trace - def link(self, **kwargs: Any) -> Iterable["_models2.Pet"]: + def link(self, **kwargs: Any) -> ItemPaged["_models2.Pet"]: """link. :return: An iterator like instance of Pet diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/_metadata.json b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/_metadata.json new file mode 100644 index 0000000000..539264d9b9 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "v1" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/_metadata.json b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/_metadata.json new file mode 100644 index 0000000000..6a8f062bd4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "v2" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/_metadata.json b/packages/typespec-python/test/azure/generated/server-path-multiple/_metadata.json new file mode 100644 index 0000000000..1c9a8f8f6a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "v1.0" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/_metadata.json b/packages/typespec-python/test/azure/generated/server-versions-versioned/_metadata.json new file mode 100644 index 0000000000..d1a7203fa7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "2022-12-01-preview" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/versioning-added/_metadata.json b/packages/typespec-python/test/azure/generated/versioning-added/_metadata.json new file mode 100644 index 0000000000..6a8f062bd4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/versioning-added/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "v2" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/_metadata.json b/packages/typespec-python/test/azure/generated/versioning-madeoptional/_metadata.json new file mode 100644 index 0000000000..6a8f062bd4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "v2" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/_metadata.json b/packages/typespec-python/test/azure/generated/versioning-removed/_metadata.json new file mode 100644 index 0000000000..6a8f062bd4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/versioning-removed/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "v2" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/_metadata.json b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/_metadata.json new file mode 100644 index 0000000000..6a8f062bd4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "v2" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/_metadata.json b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/_metadata.json new file mode 100644 index 0000000000..6a8f062bd4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "v2" +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/_metadata.json b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/_metadata.json new file mode 100644 index 0000000000..6a8f062bd4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/_metadata.json @@ -0,0 +1,3 @@ +{ + "apiVersion": "v2" +} \ No newline at end of file diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py index 08eea3b1b1..8177c484a4 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/aio/operations/_operations.py @@ -1,6 +1,6 @@ # coding=utf-8 from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from corehttp.exceptions import ( ClientAuthenticationError, @@ -47,7 +47,7 @@ def __init__(self, *args, **kwargs) -> None: self._client, self._config, self._serialize, self._deserialize ) - def link(self, **kwargs: Any) -> AsyncIterable["_models3.Pet"]: + def link(self, **kwargs: Any) -> AsyncItemPaged["_models3.Pet"]: """link. :return: An iterator like instance of Pet diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py index 05722decc1..3c20b960e7 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/aio/operations/_operations.py @@ -1,6 +1,6 @@ # coding=utf-8 from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from corehttp.exceptions import ( ClientAuthenticationError, @@ -49,7 +49,7 @@ def __init__(self, *args, **kwargs) -> None: def request_query_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncItemPaged["_models4.Pet"]: """request_query_response_body. :keyword foo: Default value is None. @@ -112,7 +112,7 @@ async def get_next(_continuation_token=None): def request_header_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncItemPaged["_models4.Pet"]: """request_header_response_body. :keyword foo: Default value is None. @@ -175,7 +175,7 @@ async def get_next(_continuation_token=None): def request_query_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncItemPaged["_models4.Pet"]: """request_query_response_header. :keyword foo: Default value is None. @@ -238,7 +238,7 @@ async def get_next(_continuation_token=None): def request_header_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models4.Pet"]: + ) -> AsyncItemPaged["_models4.Pet"]: """request_header_response_header. :keyword foo: Default value is None. diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py index 031190242f..6b361291ce 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/continuationtoken/operations/_operations.py @@ -1,7 +1,7 @@ # pylint: disable=line-too-long,useless-suppression # coding=utf-8 from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from corehttp.exceptions import ( ClientAuthenticationError, @@ -148,7 +148,7 @@ def __init__(self, *args, **kwargs) -> None: def request_query_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> ItemPaged["_models3.Pet"]: """request_query_response_body. :keyword foo: Default value is None. @@ -211,7 +211,7 @@ def get_next(_continuation_token=None): def request_header_response_body( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> ItemPaged["_models3.Pet"]: """request_header_response_body. :keyword foo: Default value is None. @@ -274,7 +274,7 @@ def get_next(_continuation_token=None): def request_query_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> ItemPaged["_models3.Pet"]: """request_query_response_header. :keyword foo: Default value is None. @@ -337,7 +337,7 @@ def get_next(_continuation_token=None): def request_header_response_header( self, *, foo: Optional[str] = None, bar: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models3.Pet"]: + ) -> ItemPaged["_models3.Pet"]: """request_header_response_header. :keyword foo: Default value is None. diff --git a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py index 7ad2beeae6..e5e4166395 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-pageable/payload/pageable/serverdrivenpagination/operations/_operations.py @@ -1,6 +1,6 @@ # coding=utf-8 from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from corehttp.exceptions import ( ClientAuthenticationError, @@ -64,7 +64,7 @@ def __init__(self, *args, **kwargs) -> None: self._client, self._config, self._serialize, self._deserialize ) - def link(self, **kwargs: Any) -> Iterable["_models2.Pet"]: + def link(self, **kwargs: Any) -> ItemPaged["_models2.Pet"]: """link. :return: An iterator like instance of Pet From cea2901b9ca4d8cc0feb9a1d07c0ba7445cfa97d Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Fri, 16 May 2025 02:00:19 +0000 Subject: [PATCH 3/6] Regenerate for autorest.python (2025-05-16 02:00:19) --- .../sample/_operations/_operations.py | 5 +- .../sample/aio/_operations/_operations.py | 6 +- .../multiapi/sample/_operations_mixin.py | 6 +- .../multiapi/sample/aio/_operations_mixin.py | 6 +- .../azure/multiapi/sample/v1/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../azure/multiapi/sample/v3/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../aio/operations/_paging_operations.py | 52 +++++++------- .../operations/_paging_operations.py | 52 +++++++------- .../aio/operations/_paging_operations.py | 6 +- .../operations/_paging_operations.py | 6 +- .../aio/operations/_paging_operations.py | 52 +++++++------- .../paging/operations/_paging_operations.py | 52 +++++++------- .../aio/operations/_paging_operations.py | 52 +++++++------- .../paging/operations/_paging_operations.py | 52 +++++++------- .../_storage_accounts_operations.py | 6 +- .../_storage_accounts_operations.py | 6 +- .../aio/operations/_operations.py | 69 ++++++++----------- .../operations/_operations.py | 56 +++++++-------- .../aio/operations/_operations.py | 6 +- .../operations/_operations.py | 6 +- .../aio/operations/_operations.py | 14 ++-- .../operations/_operations.py | 14 ++-- .../aio/operations/_operations.py | 69 ++++++++----------- .../operations/_operations.py | 56 +++++++-------- .../aio/operations/_operations.py | 6 +- .../operations/_operations.py | 6 +- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../_operations/_operations.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../Multiapi/multiapi/_operations_mixin.py | 6 +- .../multiapi/aio/_operations_mixin.py | 6 +- .../Multiapi/multiapi/v1/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../Multiapi/multiapi/v3/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_operations_mixin.py | 6 +- .../aio/_operations_mixin.py | 6 +- .../v1/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../v3/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../multiapidataplane/_operations_mixin.py | 6 +- .../aio/_operations_mixin.py | 6 +- .../multiapidataplane/v1/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../multiapidataplane/v3/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../multiapikeywordonly/_operations_mixin.py | 6 +- .../aio/_operations_mixin.py | 6 +- .../multiapikeywordonly/v1/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../multiapikeywordonly/v3/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../multiapinoasync/_operations_mixin.py | 6 +- .../multiapinoasync/v1/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../multiapinoasync/v3/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../multiapisecurity/_operations_mixin.py | 4 +- .../multiapisecurity/aio/_operations_mixin.py | 4 +- .../multiapisecurity/v1/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../submodule/_operations_mixin.py | 6 +- .../submodule/aio/_operations_mixin.py | 6 +- .../submodule/v1/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../_multiapi_service_client_operations.py | 8 +-- .../submodule/v3/_metadata.json | 8 +-- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- .../_multiapi_service_client_operations.py | 4 +- .../_operation_group_one_operations.py | 4 +- 99 files changed, 539 insertions(+), 564 deletions(-) diff --git a/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py b/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py index 6d13408684..85d38d68e6 100644 --- a/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py +++ b/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload from my.library import CustomDefaultPollingMethod, CustomPager, CustomPoller @@ -22,6 +22,7 @@ StreamConsumedError, map_error, ) +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.polling import NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse @@ -274,7 +275,7 @@ def get_long_running_output(pipeline_response): return CustomPoller[JSON](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def basic_paging(self, **kwargs: Any) -> Iterable[JSON]: + def basic_paging(self, **kwargs: Any) -> ItemPaged[JSON]: """A simple paging operation. :return: An iterator like instance of JSON object diff --git a/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py b/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py index 9e7523f361..d1e5417eda 100644 --- a/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py +++ b/packages/autorest.python/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py @@ -8,12 +8,12 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from my.library.aio import AsyncCustomDefaultPollingMethod, AsyncCustomPager, AsyncCustomPoller from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncList +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -250,7 +250,7 @@ def get_long_running_output(pipeline_response): ) @distributed_trace - def basic_paging(self, **kwargs: Any) -> AsyncIterable[JSON]: + def basic_paging(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A simple paging operation. :return: An iterator like instance of JSON object diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/_operations_mixin.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/_operations_mixin.py index 07f62adea1..66c1a5d249 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/_operations_mixin.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from ._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, IO, Iterable, Iterator, Optional, Union +from typing import Any, IO, Iterator, Optional, Union from azure.core.paging import ItemPaged from azure.core.polling import LROPoller @@ -53,7 +53,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -152,7 +152,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def test_paging( self, **kwargs: Any - ) -> Iterable["_models.ModelThree"]: + ) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/aio/_operations_mixin.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/aio/_operations_mixin.py index 9423ef48ca..b19a5764cc 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/aio/_operations_mixin.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/aio/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from .._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, IO, Optional, Union +from typing import Any, AsyncIterator, IO, Optional, Union from azure.core.async_paging import AsyncItemPaged from azure.core.polling import AsyncLROPoller @@ -54,7 +54,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -153,7 +153,7 @@ async def test_one( def test_paging( self, **kwargs: Any - ) -> AsyncIterable["_models.ModelThree"]: + ) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/_metadata.json b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/_metadata.json index 0d02a936b1..08d9877fc4 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/_metadata.json +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/_metadata.json @@ -95,8 +95,8 @@ "operation_group_one": "OperationGroupOneOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { @@ -154,13 +154,13 @@ }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.Product\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[ItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~azure.multiapi.sample.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.multiapi.sample.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.Product\"]]:\n", + "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~azure.multiapi.sample.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.multiapi.sample.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" } diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py index 2d2cc22662..e84e9fb235 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/aio/operations/_multiapi_service_client_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -322,7 +322,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -435,13 +435,13 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable["_models.Product"]]( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_multiapi_service_client_operations.py index e44c6a0e8f..404ae4f31c 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v1/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -398,7 +398,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -511,13 +511,13 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/_metadata.json b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/_metadata.json index 9859688637..eb481e5805 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/_metadata.json +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/_metadata.json @@ -96,20 +96,20 @@ "operation_group_two": "OperationGroupTwoOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { "test_paging" : { "sync": { - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e ItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.multiapi.sample.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.multiapi.sample.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" } diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_multiapi_service_client_operations.py index d3687f5952..95b3d4cf3a 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import AsyncPipelineClient @@ -49,7 +49,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_one_operations.py index 4213a70cf6..bd30e2ff1e 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -60,7 +60,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_multiapi_service_client_operations.py index 91c2056ee2..af4a9288fa 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_multiapi_service_client_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import PipelineClient @@ -91,7 +91,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_one_operations.py index 68d3070d20..e1f441f20b 100644 --- a/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/samples/specification/multiapi/generated/azure/multiapi/sample/v3/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -94,7 +94,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/aio/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/aio/operations/_paging_operations.py index 7610af2f0c..4b2b92f534 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/aio/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/aio/operations/_paging_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar, Union, cast +from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar, Union, cast import urllib.parse from custompollerpagerdefinitions.aio import AsyncCustomPager, AsyncCustomPoller @@ -89,7 +89,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_no_item_name_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of either Product or the result of cls(response) @@ -160,7 +160,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -231,7 +231,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -302,7 +302,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_single_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of either Product or the result of cls(response) @@ -375,7 +375,7 @@ async def get_next(next_link=None): @distributed_trace def get_single_pages_with_body_params( self, name: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that finishes on the first call with body params without a nextlink. :param name: Default value is None. @@ -453,7 +453,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def first_response_empty(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -530,7 +530,7 @@ def get_multiple_pages( client_request_id: Optional[str] = None, paging_get_multiple_pages_options: Optional[_models.PagingGetMultiplePagesOptions] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -614,7 +614,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -686,7 +686,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -764,7 +764,7 @@ async def get_next(next_link=None): @distributed_trace def page_with_max_page_size( self, maxpagesize: Literal["5"] = "5", **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """Paging with max page size. We don't want to. :param maxpagesize: Max page size query param. Don't send. Known values are "5" and None. @@ -844,7 +844,7 @@ def get_odata_multiple_pages( client_request_id: Optional[str] = None, paging_get_odata_multiple_pages_options: Optional[_models.PagingGetOdataMultiplePagesOptions] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink in odata format that has 10 pages. :param client_request_id: Default value is None. @@ -933,7 +933,7 @@ def get_multiple_pages_with_offset( paging_get_multiple_pages_with_offset_options: _models.PagingGetMultiplePagesWithOffsetOptions, client_request_id: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param paging_get_multiple_pages_with_offset_options: Parameter group. Required. @@ -1020,7 +1020,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1092,7 +1092,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1164,7 +1164,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_single_pages_failure(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1235,7 +1235,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1306,7 +1306,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of either Product or the result of cls(response) @@ -1379,7 +1379,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_next_link( self, api_version: str, tenant: str, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment. :param api_version: Sets the api version to use. Required. @@ -1454,7 +1454,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, custom_parameter_group: _models.CustomParameterGroup, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param custom_parameter_group: Parameter group. Required. @@ -1597,7 +1597,7 @@ async def begin_get_multiple_pages_lro( client_request_id: Optional[str] = None, paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any - ) -> AsyncCustomPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncCustomPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -1711,18 +1711,18 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncCustomPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncCustomPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncCustomPoller[AsyncIterable["_models.Product"]]( + return AsyncCustomPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def append_api_version(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -1796,7 +1796,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def replace_api_version(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -1872,7 +1872,7 @@ async def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/operations/_paging_operations.py index e0f7b5a00c..761e0e17b3 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomPollerPager/custompollerpager/operations/_paging_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Iterator, Literal, Optional, TypeVar, Union, cast +from typing import Any, Callable, Dict, Iterator, Literal, Optional, TypeVar, Union, cast import urllib.parse from custompollerpagerdefinitions import CustomPager, CustomPoller @@ -549,7 +549,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_no_item_name_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of either Product or the result of cls(response) @@ -620,7 +620,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -691,7 +691,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -762,7 +762,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_single_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of either Product or the result of cls(response) @@ -835,7 +835,7 @@ def get_next(next_link=None): @distributed_trace def get_single_pages_with_body_params( self, name: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that finishes on the first call with body params without a nextlink. :param name: Default value is None. @@ -913,7 +913,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> Iterable["_models.Product"]: + def first_response_empty(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -990,7 +990,7 @@ def get_multiple_pages( client_request_id: Optional[str] = None, paging_get_multiple_pages_options: Optional[_models.PagingGetMultiplePagesOptions] = None, **kwargs: Any, - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -1074,7 +1074,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> Iterable["_models.Product"]: + def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -1146,7 +1146,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models.Product"]: + def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.Product"]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -1222,7 +1222,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def page_with_max_page_size(self, maxpagesize: Literal["5"] = "5", **kwargs: Any) -> Iterable["_models.Product"]: + def page_with_max_page_size(self, maxpagesize: Literal["5"] = "5", **kwargs: Any) -> ItemPaged["_models.Product"]: """Paging with max page size. We don't want to. :param maxpagesize: Max page size query param. Don't send. Known values are "5" and None. @@ -1302,7 +1302,7 @@ def get_odata_multiple_pages( client_request_id: Optional[str] = None, paging_get_odata_multiple_pages_options: Optional[_models.PagingGetOdataMultiplePagesOptions] = None, **kwargs: Any, - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink in odata format that has 10 pages. :param client_request_id: Default value is None. @@ -1391,7 +1391,7 @@ def get_multiple_pages_with_offset( paging_get_multiple_pages_with_offset_options: _models.PagingGetMultiplePagesWithOffsetOptions, client_request_id: Optional[str] = None, **kwargs: Any, - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param paging_get_multiple_pages_with_offset_options: Parameter group. Required. @@ -1478,7 +1478,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1550,7 +1550,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1622,7 +1622,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_single_pages_failure(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1693,7 +1693,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_failure(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1764,7 +1764,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of either Product or the result of cls(response) @@ -1837,7 +1837,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_next_link( self, api_version: str, tenant: str, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment. :param api_version: Sets the api version to use. Required. @@ -1912,7 +1912,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, custom_parameter_group: _models.CustomParameterGroup, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param custom_parameter_group: Parameter group. Required. @@ -2055,7 +2055,7 @@ def begin_get_multiple_pages_lro( client_request_id: Optional[str] = None, paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any, - ) -> CustomPoller[Iterable["_models.Product"]]: + ) -> CustomPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -2169,18 +2169,18 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return CustomPoller[Iterable["_models.Product"]].from_continuation_token( + return CustomPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return CustomPoller[Iterable["_models.Product"]]( + return CustomPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: + def append_api_version(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -2254,7 +2254,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: + def replace_api_version(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -2330,7 +2330,7 @@ def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py index cbfd9df60b..339eb18ab2 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that combines custom url, paging and partial URL and expect to concat after host. @@ -128,7 +128,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that combines custom url, paging and partial URL with next operation. :param account_name: Account Name. Required. diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py index c886c4d8c2..3de84db4e7 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core import PipelineClient from azure.core.exceptions import ( @@ -105,7 +105,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> Iterable["_models.Product"]: + def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that combines custom url, paging and partial URL and expect to concat after host. @@ -176,7 +176,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> Iterable["_models.Product"]: + def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that combines custom url, paging and partial URL with next operation. :param account_name: Account Name. Required. diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/aio/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/aio/operations/_paging_operations.py index 29d1be2813..bc4083c072 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/aio/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/aio/operations/_paging_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar, Union, cast +from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar, Union, cast import urllib.parse from azure.core import AsyncPipelineClient @@ -87,7 +87,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_no_item_name_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of either Product or the result of cls(response) @@ -158,7 +158,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -229,7 +229,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -300,7 +300,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_single_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of either Product or the result of cls(response) @@ -373,7 +373,7 @@ async def get_next(next_link=None): @distributed_trace def get_single_pages_with_body_params( self, name: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that finishes on the first call with body params without a nextlink. :param name: Default value is None. @@ -451,7 +451,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def first_response_empty(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -528,7 +528,7 @@ def get_multiple_pages( client_request_id: Optional[str] = None, paging_get_multiple_pages_options: Optional[_models.PagingGetMultiplePagesOptions] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -612,7 +612,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -684,7 +684,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -762,7 +762,7 @@ async def get_next(next_link=None): @distributed_trace def page_with_max_page_size( self, maxpagesize: Literal["5"] = "5", **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """Paging with max page size. We don't want to. :param maxpagesize: Max page size query param. Don't send. Known values are "5" and None. @@ -842,7 +842,7 @@ def get_odata_multiple_pages( client_request_id: Optional[str] = None, paging_get_odata_multiple_pages_options: Optional[_models.PagingGetOdataMultiplePagesOptions] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink in odata format that has 10 pages. :param client_request_id: Default value is None. @@ -931,7 +931,7 @@ def get_multiple_pages_with_offset( paging_get_multiple_pages_with_offset_options: _models.PagingGetMultiplePagesWithOffsetOptions, client_request_id: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param paging_get_multiple_pages_with_offset_options: Parameter group. Required. @@ -1018,7 +1018,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1090,7 +1090,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1162,7 +1162,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_single_pages_failure(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1233,7 +1233,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1304,7 +1304,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of either Product or the result of cls(response) @@ -1377,7 +1377,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_next_link( self, api_version: str, tenant: str, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment. :param api_version: Sets the api version to use. Required. @@ -1452,7 +1452,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, custom_parameter_group: _models.CustomParameterGroup, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param custom_parameter_group: Parameter group. Required. @@ -1595,7 +1595,7 @@ async def begin_get_multiple_pages_lro( client_request_id: Optional[str] = None, paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -1709,18 +1709,18 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable["_models.Product"]]( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def append_api_version(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -1794,7 +1794,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def replace_api_version(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -1870,7 +1870,7 @@ async def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/operations/_paging_operations.py index c8a425de03..2bfd54590c 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/PackageModeBatch/azure/packagemode/batch/paging/operations/_paging_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Iterator, Literal, Optional, TypeVar, Union, cast +from typing import Any, Callable, Dict, Iterator, Literal, Optional, TypeVar, Union, cast import urllib.parse from azure.core import PipelineClient @@ -547,7 +547,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_no_item_name_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of either Product or the result of cls(response) @@ -618,7 +618,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -689,7 +689,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -760,7 +760,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_single_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of either Product or the result of cls(response) @@ -833,7 +833,7 @@ def get_next(next_link=None): @distributed_trace def get_single_pages_with_body_params( self, name: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that finishes on the first call with body params without a nextlink. :param name: Default value is None. @@ -911,7 +911,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> Iterable["_models.Product"]: + def first_response_empty(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -988,7 +988,7 @@ def get_multiple_pages( client_request_id: Optional[str] = None, paging_get_multiple_pages_options: Optional[_models.PagingGetMultiplePagesOptions] = None, **kwargs: Any, - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -1072,7 +1072,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> Iterable["_models.Product"]: + def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -1144,7 +1144,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models.Product"]: + def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.Product"]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -1220,7 +1220,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def page_with_max_page_size(self, maxpagesize: Literal["5"] = "5", **kwargs: Any) -> Iterable["_models.Product"]: + def page_with_max_page_size(self, maxpagesize: Literal["5"] = "5", **kwargs: Any) -> ItemPaged["_models.Product"]: """Paging with max page size. We don't want to. :param maxpagesize: Max page size query param. Don't send. Known values are "5" and None. @@ -1300,7 +1300,7 @@ def get_odata_multiple_pages( client_request_id: Optional[str] = None, paging_get_odata_multiple_pages_options: Optional[_models.PagingGetOdataMultiplePagesOptions] = None, **kwargs: Any, - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink in odata format that has 10 pages. :param client_request_id: Default value is None. @@ -1389,7 +1389,7 @@ def get_multiple_pages_with_offset( paging_get_multiple_pages_with_offset_options: _models.PagingGetMultiplePagesWithOffsetOptions, client_request_id: Optional[str] = None, **kwargs: Any, - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param paging_get_multiple_pages_with_offset_options: Parameter group. Required. @@ -1476,7 +1476,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1548,7 +1548,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1620,7 +1620,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_single_pages_failure(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1691,7 +1691,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_failure(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1762,7 +1762,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of either Product or the result of cls(response) @@ -1835,7 +1835,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_next_link( self, api_version: str, tenant: str, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment. :param api_version: Sets the api version to use. Required. @@ -1910,7 +1910,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, custom_parameter_group: _models.CustomParameterGroup, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param custom_parameter_group: Parameter group. Required. @@ -2053,7 +2053,7 @@ def begin_get_multiple_pages_lro( client_request_id: Optional[str] = None, paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any, - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -2167,18 +2167,18 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: + def append_api_version(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -2252,7 +2252,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: + def replace_api_version(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -2328,7 +2328,7 @@ def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py index c7ac9fb484..d120d29bc1 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar, Union, cast +from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar, Union, cast import urllib.parse from azure.core import AsyncPipelineClient @@ -86,7 +86,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_no_item_name_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of either Product or the result of cls(response) @@ -157,7 +157,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -228,7 +228,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -299,7 +299,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_single_pages(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of either Product or the result of cls(response) @@ -372,7 +372,7 @@ async def get_next(next_link=None): @distributed_trace def get_single_pages_with_body_params( self, name: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that finishes on the first call with body params without a nextlink. :param name: Default value is None. @@ -450,7 +450,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def first_response_empty(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -527,7 +527,7 @@ def get_multiple_pages( client_request_id: Optional[str] = None, paging_get_multiple_pages_options: Optional[_models.PagingGetMultiplePagesOptions] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -610,7 +610,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -682,7 +682,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -760,7 +760,7 @@ async def get_next(next_link=None): @distributed_trace def page_with_max_page_size( self, maxpagesize: Literal["5"] = "5", **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """Paging with max page size. We don't want to. :param maxpagesize: Max page size query param. Don't send. Known values are "5" and None. @@ -840,7 +840,7 @@ def get_odata_multiple_pages( client_request_id: Optional[str] = None, paging_get_odata_multiple_pages_options: Optional[_models.PagingGetOdataMultiplePagesOptions] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink in odata format that has 10 pages. :param client_request_id: Default value is None. @@ -929,7 +929,7 @@ def get_multiple_pages_with_offset( paging_get_multiple_pages_with_offset_options: _models.PagingGetMultiplePagesWithOffsetOptions, client_request_id: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param paging_get_multiple_pages_with_offset_options: Parameter group. Required. @@ -1016,7 +1016,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1088,7 +1088,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1160,7 +1160,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_single_pages_failure(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1231,7 +1231,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1302,7 +1302,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of either Product or the result of cls(response) @@ -1375,7 +1375,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_next_link( self, api_version: str, tenant: str, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment. :param api_version: Sets the api version to use. Required. @@ -1450,7 +1450,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, custom_parameter_group: _models.CustomParameterGroup, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param custom_parameter_group: Parameter group. Required. @@ -1593,7 +1593,7 @@ async def begin_get_multiple_pages_lro( client_request_id: Optional[str] = None, paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -1706,18 +1706,18 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable["_models.Product"]]( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def append_api_version(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -1791,7 +1791,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def replace_api_version(self, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -1867,7 +1867,7 @@ async def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> AsyncIterable["_models.Product"]: + ) -> AsyncItemPaged["_models.Product"]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py index 9fce549e21..68e40c3664 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Iterator, Literal, Optional, TypeVar, Union, cast +from typing import Any, Callable, Dict, Iterator, Literal, Optional, TypeVar, Union, cast import urllib.parse from azure.core import PipelineClient @@ -546,7 +546,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_no_item_name_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of either Product or the result of cls(response) @@ -617,7 +617,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -688,7 +688,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of either Product or the result of cls(response) @@ -759,7 +759,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_single_pages(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of either Product or the result of cls(response) @@ -832,7 +832,7 @@ def get_next(next_link=None): @distributed_trace def get_single_pages_with_body_params( self, name: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that finishes on the first call with body params without a nextlink. :param name: Default value is None. @@ -910,7 +910,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> Iterable["_models.Product"]: + def first_response_empty(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -987,7 +987,7 @@ def get_multiple_pages( client_request_id: Optional[str] = None, paging_get_multiple_pages_options: Optional[_models.PagingGetMultiplePagesOptions] = None, **kwargs: Any, - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -1070,7 +1070,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> Iterable["_models.Product"]: + def get_with_query_params(self, required_query_parameter: int, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -1142,7 +1142,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models.Product"]: + def duplicate_params(self, filter: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.Product"]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -1218,7 +1218,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def page_with_max_page_size(self, maxpagesize: Literal["5"] = "5", **kwargs: Any) -> Iterable["_models.Product"]: + def page_with_max_page_size(self, maxpagesize: Literal["5"] = "5", **kwargs: Any) -> ItemPaged["_models.Product"]: """Paging with max page size. We don't want to. :param maxpagesize: Max page size query param. Don't send. Known values are "5" and None. @@ -1298,7 +1298,7 @@ def get_odata_multiple_pages( client_request_id: Optional[str] = None, paging_get_odata_multiple_pages_options: Optional[_models.PagingGetOdataMultiplePagesOptions] = None, **kwargs: Any, - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink in odata format that has 10 pages. :param client_request_id: Default value is None. @@ -1387,7 +1387,7 @@ def get_multiple_pages_with_offset( paging_get_multiple_pages_with_offset_options: _models.PagingGetMultiplePagesWithOffsetOptions, client_request_id: Optional[str] = None, **kwargs: Any, - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages. :param paging_get_multiple_pages_with_offset_options: Parameter group. Required. @@ -1474,7 +1474,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1546,7 +1546,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1618,7 +1618,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_single_pages_failure(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1689,7 +1689,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_failure(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of either Product or the result of cls(response) @@ -1760,7 +1760,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable["_models.Product"]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of either Product or the result of cls(response) @@ -1833,7 +1833,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_next_link( self, api_version: str, tenant: str, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment. :param api_version: Sets the api version to use. Required. @@ -1908,7 +1908,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, custom_parameter_group: _models.CustomParameterGroup, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param custom_parameter_group: Parameter group. Required. @@ -2051,7 +2051,7 @@ def begin_get_multiple_pages_lro( client_request_id: Optional[str] = None, paging_get_multiple_pages_lro_options: Optional[_models.PagingGetMultiplePagesLroOptions] = None, **kwargs: Any, - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -2163,18 +2163,18 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: + def append_api_version(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -2248,7 +2248,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> Iterable["_models.Product"]: + def replace_api_version(self, **kwargs: Any) -> ItemPaged["_models.Product"]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -2324,7 +2324,7 @@ def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> Iterable["_models.Product"]: + ) -> ItemPaged["_models.Product"]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py index ef4d69f0a7..ad4907b93b 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations/_storage_accounts_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -710,7 +710,7 @@ async def list_keys(self, resource_group_name: str, account_name: str, **kwargs: return deserialized # type: ignore @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.StorageAccount"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.StorageAccount"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -787,7 +787,7 @@ async def get_next(next_link=None): @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StorageAccount"]: + ) -> AsyncItemPaged["_models.StorageAccount"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. diff --git a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py index 03dfa81340..cd437c8bde 100644 --- a/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py +++ b/packages/autorest.python/test/azure/legacy/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -972,7 +972,7 @@ def list_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) return deserialized # type: ignore @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.StorageAccount"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.StorageAccount"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -1047,7 +1047,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.StorageAccount"]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.StorageAccount"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py index c691f36ceb..adab905718 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py @@ -8,20 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import ( - Any, - AsyncIterable, - AsyncIterator, - Callable, - Dict, - IO, - Literal, - Optional, - TypeVar, - Union, - cast, - overload, -) +from typing import Any, AsyncIterator, Callable, Dict, IO, Literal, Optional, TypeVar, Union, cast, overload import urllib.parse from custompollerpagerdefinitions.aio import AsyncCustomPager, AsyncCustomPoller @@ -101,7 +88,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_no_item_name_pages(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of JSON object @@ -183,7 +170,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of JSON object @@ -265,7 +252,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of JSON object @@ -347,7 +334,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_single_pages(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of JSON object @@ -431,7 +418,7 @@ async def get_next(next_link=None): @overload def get_single_pages_with_body_params( self, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Required. @@ -463,7 +450,7 @@ def get_single_pages_with_body_params( @overload def get_single_pages_with_body_params( self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Required. @@ -490,7 +477,7 @@ def get_single_pages_with_body_params( @distributed_trace def get_single_pages_with_body_params( self, parameters: Union[JSON, IO[bytes]], **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Is either a JSON type or a IO[bytes] @@ -591,7 +578,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> AsyncIterable[JSON]: + def first_response_empty(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -676,7 +663,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -766,7 +753,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) -> AsyncIterable[JSON]: + def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -849,7 +836,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable[JSON]: + def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged[JSON]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -936,7 +923,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def page_with_max_page_size(self, **kwargs: Any) -> AsyncIterable[JSON]: + def page_with_max_page_size(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """Paging with max page size. We don't want to. :return: An iterator like instance of JSON object @@ -1022,7 +1009,7 @@ async def get_next(next_link=None): @distributed_trace def get_odata_multiple_pages( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that includes a nextLink in odata format that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -1114,7 +1101,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_with_offset( self, offset: int, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages. :param offset: Offset of return value. Required. @@ -1207,7 +1194,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1290,7 +1277,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1373,7 +1360,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_single_pages_failure(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of JSON object @@ -1455,7 +1442,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of JSON object @@ -1537,7 +1524,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of JSON object @@ -1621,7 +1608,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_next_link( self, tenant: str, *, api_version: str, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that doesn't return a full URL, just a fragment. :param tenant: Sets the tenant to use. Required. @@ -1707,7 +1694,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, tenant: str, *, api_version: str, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param tenant: Sets the tenant to use. Required. @@ -1839,7 +1826,7 @@ async def _get_multiple_pages_lro_initial( @distributed_trace_async async def begin_get_multiple_pages_lro( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> AsyncCustomPoller[AsyncIterable[JSON]]: + ) -> AsyncCustomPoller[AsyncItemPaged[JSON]]: """A long-running paging operation that includes a nextLink that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -1958,18 +1945,18 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncCustomPoller[AsyncIterable[JSON]].from_continuation_token( + return AsyncCustomPoller[AsyncItemPaged[JSON]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncCustomPoller[AsyncIterable[JSON]]( + return AsyncCustomPoller[AsyncItemPaged[JSON]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> AsyncIterable[JSON]: + def append_api_version(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -2053,7 +2040,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> AsyncIterable[JSON]: + def replace_api_version(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -2139,7 +2126,7 @@ async def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py index 9676bfbaad..89422a09a7 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Literal, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Literal, Optional, TypeVar, Union, cast, overload import urllib.parse from custompollerpagerdefinitions import CustomPager, CustomPoller @@ -543,7 +543,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> Iterable[JSON]: + def get_no_item_name_pages(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of JSON object @@ -625,7 +625,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable[JSON]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of JSON object @@ -707,7 +707,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable[JSON]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of JSON object @@ -789,7 +789,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> Iterable[JSON]: + def get_single_pages(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of JSON object @@ -873,7 +873,7 @@ def get_next(next_link=None): @overload def get_single_pages_with_body_params( self, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Required. @@ -905,7 +905,7 @@ def get_single_pages_with_body_params( @overload def get_single_pages_with_body_params( self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Required. @@ -930,7 +930,7 @@ def get_single_pages_with_body_params( """ @distributed_trace - def get_single_pages_with_body_params(self, parameters: Union[JSON, IO[bytes]], **kwargs: Any) -> Iterable[JSON]: + def get_single_pages_with_body_params(self, parameters: Union[JSON, IO[bytes]], **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Is either a JSON type or a IO[bytes] @@ -1031,7 +1031,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> Iterable[JSON]: + def first_response_empty(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -1116,7 +1116,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -1206,7 +1206,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) -> Iterable[JSON]: + def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -1289,7 +1289,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> Iterable[JSON]: + def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> ItemPaged[JSON]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -1376,7 +1376,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def page_with_max_page_size(self, **kwargs: Any) -> Iterable[JSON]: + def page_with_max_page_size(self, **kwargs: Any) -> ItemPaged[JSON]: """Paging with max page size. We don't want to. :return: An iterator like instance of JSON object @@ -1462,7 +1462,7 @@ def get_next(next_link=None): @distributed_trace def get_odata_multiple_pages( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that includes a nextLink in odata format that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -1554,7 +1554,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_with_offset( self, offset: int, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages. :param offset: Offset of return value. Required. @@ -1647,7 +1647,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1730,7 +1730,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1813,7 +1813,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> Iterable[JSON]: + def get_single_pages_failure(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of JSON object @@ -1895,7 +1895,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_failure(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of JSON object @@ -1977,7 +1977,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of JSON object @@ -2059,7 +2059,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_fragment_next_link(self, tenant: str, *, api_version: str, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_fragment_next_link(self, tenant: str, *, api_version: str, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that doesn't return a full URL, just a fragment. :param tenant: Sets the tenant to use. Required. @@ -2145,7 +2145,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, tenant: str, *, api_version: str, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param tenant: Sets the tenant to use. Required. @@ -2277,7 +2277,7 @@ def _get_multiple_pages_lro_initial( @distributed_trace def begin_get_multiple_pages_lro( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> CustomPoller[Iterable[JSON]]: + ) -> CustomPoller[ItemPaged[JSON]]: """A long-running paging operation that includes a nextLink that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -2395,18 +2395,18 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return CustomPoller[Iterable[JSON]].from_continuation_token( + return CustomPoller[ItemPaged[JSON]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return CustomPoller[Iterable[JSON]]( + return CustomPoller[ItemPaged[JSON]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> Iterable[JSON]: + def append_api_version(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -2490,7 +2490,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> Iterable[JSON]: + def replace_api_version(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -2576,7 +2576,7 @@ def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py index 123dade20c..332ffc4308 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -55,7 +55,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> AsyncIterable[JSON]: + def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that combines custom url, paging and partial URL and expect to concat after host. @@ -137,7 +137,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> AsyncIterable[JSON]: + def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that combines custom url, paging and partial URL with next operation. :param account_name: Account Name. Required. diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py index 45ee66f43c..bcb5ec23b7 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core import PipelineClient from azure.core.exceptions import ( @@ -103,7 +103,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> Iterable[JSON]: + def get_pages_partial_url(self, account_name: str, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that combines custom url, paging and partial URL and expect to concat after host. @@ -185,7 +185,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> Iterable[JSON]: + def get_pages_partial_url_operation(self, account_name: str, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that combines custom url, paging and partial URL with next operation. :param account_name: Account Name. Required. diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/aio/operations/_operations.py index 8c983b9c8e..d248b717ad 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/aio/operations/_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -68,7 +68,7 @@ def get_qnas( top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """Gets all the QnAs of a project. Gets all the QnAs of a project. @@ -288,7 +288,7 @@ async def _update_qnas_initial( @overload async def begin_update_qnas( self, project_name: str, body: List[JSON], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable[JSON]]: + ) -> AsyncLROPoller[AsyncItemPaged[JSON]]: """Updates the QnAs of a project. Updates the QnAs of a project. @@ -413,7 +413,7 @@ async def begin_update_qnas( @overload async def begin_update_qnas( self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable[JSON]]: + ) -> AsyncLROPoller[AsyncItemPaged[JSON]]: """Updates the QnAs of a project. Updates the QnAs of a project. @@ -497,7 +497,7 @@ async def begin_update_qnas( @distributed_trace_async async def begin_update_qnas( self, project_name: str, body: Union[List[JSON], IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable[JSON]]: + ) -> AsyncLROPoller[AsyncItemPaged[JSON]]: """Updates the QnAs of a project. Updates the QnAs of a project. @@ -681,12 +681,12 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable[JSON]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged[JSON]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable[JSON]]( + return AsyncLROPoller[AsyncItemPaged[JSON]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/operations/_operations.py index 0024674c6b..2826de1a9f 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/LroPagingVersionTolerant/lropagingversiontolerant/operations/_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -135,7 +135,7 @@ def get_qnas( top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """Gets all the QnAs of a project. Gets all the QnAs of a project. @@ -355,7 +355,7 @@ def _update_qnas_initial( @overload def begin_update_qnas( self, project_name: str, body: List[JSON], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Iterable[JSON]]: + ) -> LROPoller[ItemPaged[JSON]]: """Updates the QnAs of a project. Updates the QnAs of a project. @@ -480,7 +480,7 @@ def begin_update_qnas( @overload def begin_update_qnas( self, project_name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[Iterable[JSON]]: + ) -> LROPoller[ItemPaged[JSON]]: """Updates the QnAs of a project. Updates the QnAs of a project. @@ -564,7 +564,7 @@ def begin_update_qnas( @distributed_trace def begin_update_qnas( self, project_name: str, body: Union[List[JSON], IO[bytes]], **kwargs: Any - ) -> LROPoller[Iterable[JSON]]: + ) -> LROPoller[ItemPaged[JSON]]: """Updates the QnAs of a project. Updates the QnAs of a project. @@ -748,12 +748,12 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable[JSON]].from_continuation_token( + return LROPoller[ItemPaged[JSON]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable[JSON]]( + return LROPoller[ItemPaged[JSON]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py index 826bd8c077..05496c980b 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py @@ -8,20 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import ( - Any, - AsyncIterable, - AsyncIterator, - Callable, - Dict, - IO, - Literal, - Optional, - TypeVar, - Union, - cast, - overload, -) +from typing import Any, AsyncIterator, Callable, Dict, IO, Literal, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -98,7 +85,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_no_item_name_pages(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of JSON object @@ -180,7 +167,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of JSON object @@ -262,7 +249,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of JSON object @@ -344,7 +331,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_single_pages(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of JSON object @@ -428,7 +415,7 @@ async def get_next(next_link=None): @overload def get_single_pages_with_body_params( self, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Required. @@ -460,7 +447,7 @@ def get_single_pages_with_body_params( @overload def get_single_pages_with_body_params( self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Required. @@ -487,7 +474,7 @@ def get_single_pages_with_body_params( @distributed_trace def get_single_pages_with_body_params( self, parameters: Union[JSON, IO[bytes]], **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Is either a JSON type or a IO[bytes] @@ -588,7 +575,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> AsyncIterable[JSON]: + def first_response_empty(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -673,7 +660,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -763,7 +750,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) -> AsyncIterable[JSON]: + def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -846,7 +833,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable[JSON]: + def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged[JSON]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -933,7 +920,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def page_with_max_page_size(self, **kwargs: Any) -> AsyncIterable[JSON]: + def page_with_max_page_size(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """Paging with max page size. We don't want to. :return: An iterator like instance of JSON object @@ -1019,7 +1006,7 @@ async def get_next(next_link=None): @distributed_trace def get_odata_multiple_pages( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that includes a nextLink in odata format that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -1111,7 +1098,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_with_offset( self, offset: int, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages. :param offset: Offset of return value. Required. @@ -1204,7 +1191,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1287,7 +1274,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1370,7 +1357,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_single_pages_failure(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of JSON object @@ -1452,7 +1439,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_multiple_pages_failure(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of JSON object @@ -1534,7 +1521,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncIterable[JSON]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of JSON object @@ -1618,7 +1605,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_next_link( self, tenant: str, *, api_version: str, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that doesn't return a full URL, just a fragment. :param tenant: Sets the tenant to use. Required. @@ -1704,7 +1691,7 @@ async def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, tenant: str, *, api_version: str, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param tenant: Sets the tenant to use. Required. @@ -1836,7 +1823,7 @@ async def _get_multiple_pages_lro_initial( @distributed_trace_async async def begin_get_multiple_pages_lro( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable[JSON]]: + ) -> AsyncLROPoller[AsyncItemPaged[JSON]]: """A long-running paging operation that includes a nextLink that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -1954,18 +1941,18 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable[JSON]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged[JSON]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable[JSON]]( + return AsyncLROPoller[AsyncItemPaged[JSON]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> AsyncIterable[JSON]: + def append_api_version(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -2049,7 +2036,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> AsyncIterable[JSON]: + def replace_api_version(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -2135,7 +2122,7 @@ async def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> AsyncIterable[JSON]: + ) -> AsyncItemPaged[JSON]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py index 5e282a64a9..f6fd675c86 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Literal, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Literal, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -540,7 +540,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get_no_item_name_pages(self, **kwargs: Any) -> Iterable[JSON]: + def get_no_item_name_pages(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that must return result of the default 'value' node. :return: An iterator like instance of JSON object @@ -622,7 +622,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_empty_next_link_name_pages(self, **kwargs: Any) -> Iterable[JSON]: + def get_empty_next_link_name_pages(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that gets an empty next link and should stop after page 1. :return: An iterator like instance of JSON object @@ -704,7 +704,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_null_next_link_name_pages(self, **kwargs: Any) -> Iterable[JSON]: + def get_null_next_link_name_pages(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that must ignore any kind of nextLink, and stop after page 1. :return: An iterator like instance of JSON object @@ -786,7 +786,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages(self, **kwargs: Any) -> Iterable[JSON]: + def get_single_pages(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that finishes on the first call without a nextlink. :return: An iterator like instance of JSON object @@ -870,7 +870,7 @@ def get_next(next_link=None): @overload def get_single_pages_with_body_params( self, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Required. @@ -902,7 +902,7 @@ def get_single_pages_with_body_params( @overload def get_single_pages_with_body_params( self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Required. @@ -927,7 +927,7 @@ def get_single_pages_with_body_params( """ @distributed_trace - def get_single_pages_with_body_params(self, parameters: Union[JSON, IO[bytes]], **kwargs: Any) -> Iterable[JSON]: + def get_single_pages_with_body_params(self, parameters: Union[JSON, IO[bytes]], **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that finishes on the first call with body params without a nextlink. :param parameters: put {'name': 'body'} to pass the test. Is either a JSON type or a IO[bytes] @@ -1028,7 +1028,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def first_response_empty(self, **kwargs: Any) -> Iterable[JSON]: + def first_response_empty(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation whose first response's items list is empty, but still returns a next link. Second (and final) call, will give you an items list of 1. @@ -1113,7 +1113,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -1203,7 +1203,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) -> Iterable[JSON]: + def get_with_query_params(self, *, required_query_parameter: int, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that includes a next operation. It has a different query parameter from it's next operation nextOperationWithQueryParams. Returns a ProductResult. @@ -1286,7 +1286,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> Iterable[JSON]: + def duplicate_params(self, *, filter: Optional[str] = None, **kwargs: Any) -> ItemPaged[JSON]: """Define ``filter`` as a query param for all calls. However, the returned next link will also include the ``filter`` as part of it. Make sure you don't end up duplicating the ``filter`` param in the url sent. @@ -1373,7 +1373,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def page_with_max_page_size(self, **kwargs: Any) -> Iterable[JSON]: + def page_with_max_page_size(self, **kwargs: Any) -> ItemPaged[JSON]: """Paging with max page size. We don't want to. :return: An iterator like instance of JSON object @@ -1459,7 +1459,7 @@ def get_next(next_link=None): @distributed_trace def get_odata_multiple_pages( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that includes a nextLink in odata format that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -1551,7 +1551,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_with_offset( self, offset: int, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages. :param offset: Offset of return value. Required. @@ -1644,7 +1644,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_first(self, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_retry_first(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. @@ -1727,7 +1727,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_retry_second(self, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_retry_second(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -1810,7 +1810,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_single_pages_failure(self, **kwargs: Any) -> Iterable[JSON]: + def get_single_pages_failure(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that receives a 400 on the first call. :return: An iterator like instance of JSON object @@ -1892,7 +1892,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure(self, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_failure(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that receives a 400 on the second call. :return: An iterator like instance of JSON object @@ -1974,7 +1974,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_failure_uri(self, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_failure_uri(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that receives an invalid nextLink. :return: An iterator like instance of JSON object @@ -2056,7 +2056,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_multiple_pages_fragment_next_link(self, tenant: str, *, api_version: str, **kwargs: Any) -> Iterable[JSON]: + def get_multiple_pages_fragment_next_link(self, tenant: str, *, api_version: str, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation that doesn't return a full URL, just a fragment. :param tenant: Sets the tenant to use. Required. @@ -2142,7 +2142,7 @@ def get_next(next_link=None): @distributed_trace def get_multiple_pages_fragment_with_grouping_next_link( # pylint: disable=name-too-long self, tenant: str, *, api_version: str, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that doesn't return a full URL, just a fragment with parameters grouped. :param tenant: Sets the tenant to use. Required. @@ -2274,7 +2274,7 @@ def _get_multiple_pages_lro_initial( @distributed_trace def begin_get_multiple_pages_lro( self, *, maxresults: Optional[int] = None, timeout: int = 30, **kwargs: Any - ) -> LROPoller[Iterable[JSON]]: + ) -> LROPoller[ItemPaged[JSON]]: """A long-running paging operation that includes a nextLink that has 10 pages. :keyword maxresults: Sets the maximum number of items to return in the response. Default value @@ -2392,18 +2392,18 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable[JSON]].from_continuation_token( + return LROPoller[ItemPaged[JSON]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable[JSON]]( + return LROPoller[ItemPaged[JSON]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace - def append_api_version(self, **kwargs: Any) -> Iterable[JSON]: + def append_api_version(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation with api version. When calling the next link, you want to append your client's api version to the next link. @@ -2487,7 +2487,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def replace_api_version(self, **kwargs: Any) -> Iterable[JSON]: + def replace_api_version(self, **kwargs: Any) -> ItemPaged[JSON]: """A paging operation with api version. When calling the next link, you want to reformat it and override the returned api version with your client's api version. @@ -2573,7 +2573,7 @@ def get_next(next_link=None): @distributed_trace def get_paging_model_with_item_name_with_xms_client_name( # pylint: disable=name-too-long self, **kwargs: Any - ) -> Iterable[JSON]: + ) -> ItemPaged[JSON]: """A paging operation that returns a paging model whose item name is is overriden by x-ms-client-name 'indexes'. diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py index 6319db1465..1e7661a46b 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -1155,7 +1155,7 @@ async def list_keys(self, resource_group_name: str, account_name: str, **kwargs: return cast(JSON, deserialized) # type: ignore @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable[JSON]: + def list(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -1279,7 +1279,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable[JSON]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged[JSON]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. diff --git a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py index 9bf4482984..7b3b7b4ea3 100644 --- a/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py +++ b/packages/autorest.python/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -1424,7 +1424,7 @@ def list_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) return cast(JSON, deserialized) # type: ignore @distributed_trace - def list(self, **kwargs: Any) -> Iterable[JSON]: + def list(self, **kwargs: Any) -> ItemPaged[JSON]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -1548,7 +1548,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable[JSON]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged[JSON]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py index cbedbabceb..842b8a8dc1 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -325,7 +325,7 @@ def post_model(self, mode: str, input: Union[JSON, IO[bytes]], **kwargs: Any) -> return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_pages(self, mode: str, **kwargs: Any) -> Iterable[JSON]: + def get_pages(self, mode: str, **kwargs: Any) -> ItemPaged[JSON]: """Get pages that you will either return to users in pages of raw bodies, or pages of models following growup. diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py index bc649f96e1..c6b4928303 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -256,7 +256,7 @@ async def post_model(self, mode: str, input: Union[JSON, IO[bytes]], **kwargs: A return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_pages(self, mode: str, **kwargs: Any) -> AsyncIterable[JSON]: + def get_pages(self, mode: str, **kwargs: Any) -> AsyncItemPaged[JSON]: """Get pages that you will either return to users in pages of raw bodies, or pages of models following growup. diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py index cbedbabceb..842b8a8dc1 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -325,7 +325,7 @@ def post_model(self, mode: str, input: Union[JSON, IO[bytes]], **kwargs: Any) -> return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_pages(self, mode: str, **kwargs: Any) -> Iterable[JSON]: + def get_pages(self, mode: str, **kwargs: Any) -> ItemPaged[JSON]: """Get pages that you will either return to users in pages of raw bodies, or pages of models following growup. diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py index bc649f96e1..c6b4928303 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -256,7 +256,7 @@ async def post_model(self, mode: str, input: Union[JSON, IO[bytes]], **kwargs: A return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_pages(self, mode: str, **kwargs: Any) -> AsyncIterable[JSON]: + def get_pages(self, mode: str, **kwargs: Any) -> AsyncItemPaged[JSON]: """Get pages that you will either return to users in pages of raw bodies, or pages of models following growup. diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py index 0e8c1b45d4..72ddb33dc7 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -281,7 +281,7 @@ def post_model(self, mode: str, input: Union[_models.Input, IO[bytes]], **kwargs return deserialized # type: ignore @distributed_trace - def get_pages(self, mode: str, **kwargs: Any) -> Iterable["_models.Product"]: + def get_pages(self, mode: str, **kwargs: Any) -> ItemPaged["_models.Product"]: """Get pages that you will either return to users in pages of raw bodies, or pages of models following growup. diff --git a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py index 0c649ec202..511667fbd8 100644 --- a/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py +++ b/packages/autorest.python/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -208,7 +208,7 @@ async def post_model(self, mode: str, input: Union[_models.Input, IO[bytes]], ** return deserialized # type: ignore @distributed_trace - def get_pages(self, mode: str, **kwargs: Any) -> AsyncIterable["_models.Product"]: + def get_pages(self, mode: str, **kwargs: Any) -> AsyncItemPaged["_models.Product"]: """Get pages that you will either return to users in pages of raw bodies, or pages of models following growup. diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py index 06147c51c8..bb75f26d07 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from ._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, IO, Iterable, Iterator, Optional, Union +from typing import Any, IO, Iterator, Optional, Union from azure.core.paging import ItemPaged from azure.core.polling import LROPoller @@ -53,7 +53,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -152,7 +152,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def test_paging( self, **kwargs: Any - ) -> Iterable["_models.ModelThree"]: + ) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin.py index 12cc546f38..f1258485c9 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from .._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, IO, Optional, Union +from typing import Any, AsyncIterator, IO, Optional, Union from azure.core.async_paging import AsyncItemPaged from azure.core.polling import AsyncLROPoller @@ -54,7 +54,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -153,7 +153,7 @@ async def test_one( def test_paging( self, **kwargs: Any - ) -> AsyncIterable["_models.ModelThree"]: + ) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json index 281296057d..77bec61b15 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json @@ -95,8 +95,8 @@ "operation_group_one": "OperationGroupOneOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { @@ -154,13 +154,13 @@ }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.Product\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[ItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapi.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapi.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.Product\"]]:\n", + "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapi.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapi.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py index 235aa0c1cb..f62d1ee5f9 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations/_multiapi_service_client_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -322,7 +322,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -435,13 +435,13 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable["_models.Product"]]( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py index d68abe5b3a..46ae34565a 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -398,7 +398,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -511,13 +511,13 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json index d7e23a53fd..d9c627abce 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json @@ -96,20 +96,20 @@ "operation_group_two": "OperationGroupTwoOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { "test_paging" : { "sync": { - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e ItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~multiapi.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapi.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py index 5393cf788c..2220a85bc5 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import AsyncPipelineClient @@ -49,7 +49,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py index 5876185e12..40f3818e5e 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -60,7 +60,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py index d8c9428546..333abf6b24 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_multiapi_service_client_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import PipelineClient @@ -91,7 +91,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py index ae63732ee9..d929f8bf2d 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -94,7 +94,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/_operations_mixin.py index 8cf864d356..c7929d1997 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from ._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, IO, Iterable, Iterator, Optional, Union +from typing import Any, IO, Iterator, Optional, Union from azure.core.paging import ItemPaged from azure.core.polling import LROPoller @@ -53,7 +53,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -153,7 +153,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def test_paging( self, **kwargs: Any - ) -> Iterable["_models.ModelThree"]: + ) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/aio/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/aio/_operations_mixin.py index a7b1292d53..ccc4538e00 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/aio/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/aio/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from .._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, IO, Optional, Union +from typing import Any, AsyncIterator, IO, Optional, Union from azure.core.async_paging import AsyncItemPaged from azure.core.polling import AsyncLROPoller @@ -54,7 +54,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -154,7 +154,7 @@ async def test_one( def test_paging( self, **kwargs: Any - ) -> AsyncIterable["_models.ModelThree"]: + ) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/_metadata.json index 568d2b808c..ae2f15327a 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/_metadata.json @@ -95,8 +95,8 @@ "operation_group_one": "OperationGroupOneOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { @@ -154,13 +154,13 @@ }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.Product\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[ItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options:\n ~multiapicredentialdefaultpolicy.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapicredentialdefaultpolicy.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.Product\"]]:\n", + "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options:\n ~multiapicredentialdefaultpolicy.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapicredentialdefaultpolicy.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py index a73099ecfb..6038b3223f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/aio/operations/_multiapi_service_client_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -322,7 +322,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -436,13 +436,13 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable["_models.Product"]]( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py index 63d762a5b0..0e903fbf35 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v1/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -398,7 +398,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -512,13 +512,13 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/_metadata.json index 24d50359f6..6c207ef751 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/_metadata.json @@ -96,20 +96,20 @@ "operation_group_two": "OperationGroupTwoOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { "test_paging" : { "sync": { - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e ItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~multiapicredentialdefaultpolicy.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~multiapicredentialdefaultpolicy.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py index 92d4503ab1..bd6949a090 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import AsyncPipelineClient @@ -49,7 +49,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py index 936785d219..e7acc80c0c 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -60,7 +60,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py index 5568070286..fd547820ca 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_multiapi_service_client_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import PipelineClient @@ -91,7 +91,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py index af186ed716..4de630b1cb 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiCredentialDefaultPolicy/multiapicredentialdefaultpolicy/v3/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -94,7 +94,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py index 00d6558779..ee1ff99a10 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from ._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, IO, Iterable, Iterator, Optional, Union +from typing import Any, IO, Iterator, Optional, Union from azure.core.paging import ItemPaged from azure.core.polling import LROPoller @@ -53,7 +53,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -152,7 +152,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def test_paging( self, **kwargs: Any - ) -> Iterable["_models.ModelThree"]: + ) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/aio/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/aio/_operations_mixin.py index 254843ab36..f57b3ff86f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/aio/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/aio/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from .._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, IO, Optional, Union +from typing import Any, AsyncIterator, IO, Optional, Union from azure.core.async_paging import AsyncItemPaged from azure.core.polling import AsyncLROPoller @@ -54,7 +54,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -153,7 +153,7 @@ async def test_one( def test_paging( self, **kwargs: Any - ) -> AsyncIterable["_models.ModelThree"]: + ) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/_metadata.json index 09140c7930..bd04d5a031 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/_metadata.json @@ -95,8 +95,8 @@ "operation_group_one": "OperationGroupOneOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { @@ -154,13 +154,13 @@ }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.Product\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[ItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapidataplane.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapidataplane.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.Product\"]]:\n", + "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapidataplane.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapidataplane.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py index dc534b9271..78dabac667 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/aio/operations/_multiapi_service_client_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -321,7 +321,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -434,13 +434,13 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable["_models.Product"]]( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py index 71816e435a..515829ea49 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v1/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -397,7 +397,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -510,13 +510,13 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/_metadata.json index 68d2ba21f1..e770010973 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/_metadata.json @@ -96,20 +96,20 @@ "operation_group_two": "OperationGroupTwoOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { "test_paging" : { "sync": { - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e ItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~multiapidataplane.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapidataplane.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py index 14b081c7f3..8ba241fd8e 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import AsyncPipelineClient @@ -48,7 +48,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py index 81019a543f..4810e0d7a8 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py index 475f732418..e8e8fd73de 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_multiapi_service_client_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import PipelineClient @@ -90,7 +90,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py index 2a6adc8df7..0de3bce040 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v3/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -93,7 +93,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/_operations_mixin.py index efdc378987..d922098ce0 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from ._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, IO, Iterable, Iterator, Optional, Union +from typing import Any, IO, Iterator, Optional, Union from azure.core.paging import ItemPaged from azure.core.polling import LROPoller @@ -54,7 +54,7 @@ def begin_test_lro_and_paging( *, client_request_id: Optional[str] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param test_lro_and_paging_options: Parameter group. Default value is None. @@ -155,7 +155,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def test_paging( self, **kwargs: Any - ) -> Iterable["_models.ModelThree"]: + ) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/aio/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/aio/_operations_mixin.py index 6a029aa520..3aa39626a2 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/aio/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/aio/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from .._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, IO, Optional, Union +from typing import Any, AsyncIterator, IO, Optional, Union from azure.core.async_paging import AsyncItemPaged from azure.core.polling import AsyncLROPoller @@ -55,7 +55,7 @@ async def begin_test_lro_and_paging( *, client_request_id: Optional[str] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param test_lro_and_paging_options: Parameter group. Default value is None. @@ -156,7 +156,7 @@ async def test_one( def test_paging( self, **kwargs: Any - ) -> AsyncIterable["_models.ModelThree"]: + ) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/_metadata.json index ddb890b56d..b9f74ce34f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/_metadata.json @@ -95,8 +95,8 @@ "operation_group_one": "OperationGroupOneOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { @@ -154,13 +154,13 @@ }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n *,\n client_request_id: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.Product\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n *,\n client_request_id: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[ItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapikeywordonly.v1.models.TestLroAndPagingOptions\n:keyword client_request_id: Default value is None.\n:paramtype client_request_id: str\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapikeywordonly.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "test_lro_and_paging_options, client_request_id=client_request_id, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro_and_paging(\n self,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n *,\n client_request_id: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.Product\"]]:\n", + "signature": "async def begin_test_lro_and_paging(\n self,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n *,\n client_request_id: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapikeywordonly.v1.models.TestLroAndPagingOptions\n:keyword client_request_id: Default value is None.\n:paramtype client_request_id: str\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapikeywordonly.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "test_lro_and_paging_options, client_request_id=client_request_id, **kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_multiapi_service_client_operations.py index f854f0496e..eb6b1c9132 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/aio/operations/_multiapi_service_client_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -323,7 +323,7 @@ async def begin_test_lro_and_paging( *, client_request_id: Optional[str] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param test_lro_and_paging_options: Parameter group. Default value is None. @@ -436,13 +436,13 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable["_models.Product"]]( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_multiapi_service_client_operations.py index a754cb36c3..a95d32a500 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v1/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -399,7 +399,7 @@ def begin_test_lro_and_paging( *, client_request_id: Optional[str] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param test_lro_and_paging_options: Parameter group. Default value is None. @@ -512,13 +512,13 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/_metadata.json index 048049ad67..e02edd83ff 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/_metadata.json @@ -96,20 +96,20 @@ "operation_group_two": "OperationGroupTwoOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { "test_paging" : { "sync": { - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e ItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~multiapikeywordonly.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapikeywordonly.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_multiapi_service_client_operations.py index e52c9b5190..ec9d6d028f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import AsyncPipelineClient @@ -48,7 +48,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_one_operations.py index 1c4bcfbea9..f8111fd393 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_multiapi_service_client_operations.py index b83ba5e0a4..573b9f4feb 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_multiapi_service_client_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import PipelineClient @@ -90,7 +90,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_one_operations.py index 004486313f..58023a7016 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiKeywordOnly/multiapikeywordonly/v3/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -93,7 +93,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py index 4fd13508d1..368b3d6ba6 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from ._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, IO, Iterable, Iterator, Optional, Union +from typing import Any, IO, Iterator, Optional, Union from azure.core.paging import ItemPaged from azure.core.polling import LROPoller @@ -53,7 +53,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -152,7 +152,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def test_paging( self, **kwargs: Any - ) -> Iterable["_models.ModelThree"]: + ) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json index f98e2fbb18..3d486bd9c5 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json @@ -95,8 +95,8 @@ "operation_group_one": "OperationGroupOneOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { @@ -154,13 +154,13 @@ }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.Product\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[ItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapinoasync.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapinoasync.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.Product\"]]:\n", + "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapinoasync.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapinoasync.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py index 3f8d593de2..fbd91630cb 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -398,7 +398,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -511,13 +511,13 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json index 53721a45ac..296e2a4c33 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json @@ -96,20 +96,20 @@ "operation_group_two": "OperationGroupTwoOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { "test_paging" : { "sync": { - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e ItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~multiapinoasync.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~multiapinoasync.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py index 2c1c1acd56..c51d68a401 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_multiapi_service_client_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import PipelineClient @@ -91,7 +91,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py index b896d75713..cd3e27b7e2 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -94,7 +94,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/_operations_mixin.py index de7dab5ddf..af9fdef6b2 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from ._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, IO, Iterable, Iterator, Optional, Union +from typing import Any, IO, Iterator, Optional, Union from azure.core.paging import ItemPaged from azure.core.polling import LROPoller @@ -53,7 +53,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/aio/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/aio/_operations_mixin.py index cb351a3528..9162002a9f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/aio/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/aio/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from .._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, IO, Optional, Union +from typing import Any, AsyncIterator, IO, Optional, Union from azure.core.async_paging import AsyncItemPaged from azure.core.polling import AsyncLROPoller @@ -54,7 +54,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/_metadata.json index 991cb55d23..2bda02f247 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/_metadata.json @@ -95,8 +95,8 @@ "operation_group_one": "OperationGroupOneOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { @@ -154,13 +154,13 @@ }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.Product\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[ItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapisecurity.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapisecurity.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.Product\"]]:\n", + "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options: ~multiapisecurity.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapisecurity.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_multiapi_service_client_operations.py index e1c30e6a97..6355ac0bad 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/aio/operations/_multiapi_service_client_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -321,7 +321,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -434,13 +434,13 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable["_models.Product"]]( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_multiapi_service_client_operations.py index 8182ac5aa1..741e752ad6 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiSecurity/multiapisecurity/v1/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -397,7 +397,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -510,13 +510,13 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py index cc6cd7dc36..320eb30a02 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from ._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, IO, Iterable, Iterator, Optional, Union +from typing import Any, IO, Iterator, Optional, Union from azure.core.paging import ItemPaged from azure.core.polling import LROPoller @@ -53,7 +53,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -153,7 +153,7 @@ def test_one( # pylint: disable=inconsistent-return-statements def test_paging( self, **kwargs: Any - ) -> Iterable["_models.ModelThree"]: + ) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin.py index 0c8e9b3f9e..20786f80a5 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin.py @@ -10,7 +10,7 @@ # -------------------------------------------------------------------------- from .._utils.serialization import Serializer, Deserializer from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, IO, Optional, Union +from typing import Any, AsyncIterator, IO, Optional, Union from azure.core.async_paging import AsyncItemPaged from azure.core.polling import AsyncLROPoller @@ -54,7 +54,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -154,7 +154,7 @@ async def test_one( def test_paging( self, **kwargs: Any - ) -> AsyncIterable["_models.ModelThree"]: + ) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json index 81eaf38060..08987d595f 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json @@ -95,8 +95,8 @@ "operation_group_one": "OperationGroupOneOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"IO\", \"Iterator\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"LROPoller\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"stdlib\": {\"typing\": [\"AsyncIterator\", \"IO\", \"Optional\", \"Union\"], \"io\": [\"IOBase\"]}, \"sdkcore\": {\"azure.core.polling\": [\"AsyncLROPoller\"], \"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { @@ -154,13 +154,13 @@ }, "begin_test_lro_and_paging" : { "sync": { - "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[Iterable[\"_models.Product\"]]:\n", + "signature": "def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e LROPoller[ItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options:\n ~multiapiwithsubmodule.submodule.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~multiapiwithsubmodule.submodule.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" }, "async": { "coroutine": true, - "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncIterable[\"_models.Product\"]]:\n", + "signature": "async def begin_test_lro_and_paging(\n self,\n client_request_id: Optional[str] = None,\n test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[AsyncItemPaged[\"_models.Product\"]]:\n", "doc": "\"\"\"A long-running paging operation that includes a nextLink that has 10 pages.\n\n:param client_request_id: Default value is None.\n:type client_request_id: str\n:param test_lro_and_paging_options: Parameter group. Default value is None.\n:type test_lro_and_paging_options:\n ~multiapiwithsubmodule.submodule.v1.models.TestLroAndPagingOptions\n:return: An instance of LROPoller that returns an iterator like instance of either PagingResult\n or the result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~multiapiwithsubmodule.submodule.v1.models.Product]]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "client_request_id, test_lro_and_paging_options, **kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py index 08ed1df4c6..ed2abb12dc 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations/_multiapi_service_client_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -322,7 +322,7 @@ async def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> AsyncLROPoller[AsyncIterable["_models.Product"]]: + ) -> AsyncLROPoller[AsyncItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -436,13 +436,13 @@ async def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return AsyncLROPoller[AsyncIterable["_models.Product"]].from_continuation_token( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[AsyncIterable["_models.Product"]]( + return AsyncLROPoller[AsyncItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py index 67f7010864..460e97d1d0 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -398,7 +398,7 @@ def begin_test_lro_and_paging( client_request_id: Optional[str] = None, test_lro_and_paging_options: Optional[_models.TestLroAndPagingOptions] = None, **kwargs: Any - ) -> LROPoller[Iterable["_models.Product"]]: + ) -> LROPoller[ItemPaged["_models.Product"]]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: Default value is None. @@ -512,13 +512,13 @@ def internal_get_next(next_link=None): else: polling_method = polling if cont_token: - return LROPoller[Iterable["_models.Product"]].from_continuation_token( + return LROPoller[ItemPaged["_models.Product"]].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[Iterable["_models.Product"]]( + return LROPoller[ItemPaged["_models.Product"]]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json index 7a6d382829..e304942128 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json @@ -96,20 +96,20 @@ "operation_group_two": "OperationGroupTwoOperations" }, "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\".\": [[\"models\", \"_models\"]]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}, \"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}}, \"regular\": {\"sdkcore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"]}, \"stdlib\": {\"typing\": [\"Optional\"]}, \"local\": {\"..\": [[\"models\", \"_models\"]]}}}", "sync_mixin_typing_definitions": "", "async_mixin_typing_definitions": "", "operations": { "test_paging" : { "sync": { - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e ItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~multiapiwithsubmodule.submodule.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" }, "async": { "coroutine": false, - "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ModelThree\"]:\n", + "signature": "def test_paging(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.ModelThree\"]:\n", "doc": "\"\"\"Returns ModelThree with optionalProperty \u0027paged\u0027.\n\n:return: An iterator like instance of either ModelThree or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~multiapiwithsubmodule.submodule.v3.models.ModelThree]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", "call": "**kwargs" } diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py index 85b5f4f58c..4ba0d61e8b 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_multiapi_service_client_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import AsyncPipelineClient @@ -49,7 +49,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py index df8c55ccdb..ef98d169b6 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/aio/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -60,7 +60,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> AsyncIterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> AsyncItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py index 4a17e688fe..f1947c0c77 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_multiapi_service_client_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import PipelineClient @@ -91,7 +91,7 @@ def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument return "" @distributed_trace - def test_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) diff --git a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py index d1ad8e14ae..e36defb01b 100644 --- a/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py +++ b/packages/autorest.python/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/operations/_operation_group_one_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -94,7 +94,7 @@ def __init__(self, *args, **kwargs) -> None: self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def test_operation_group_paging(self, **kwargs: Any) -> Iterable["_models.ModelThree"]: + def test_operation_group_paging(self, **kwargs: Any) -> ItemPaged["_models.ModelThree"]: """Returns ModelThree with optionalProperty 'paged'. :return: An iterator like instance of either ModelThree or the result of cls(response) From 1e199dd9e57078b2798869da5a29edc9d45b768b Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 19 May 2025 03:04:14 +0000 Subject: [PATCH 4/6] bump dep --- packages/autorest.python/package.json | 6 +----- packages/typespec-python/package.json | 6 +----- pnpm-lock.yaml | 14 +++++++------- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 29494daa3b..7a53f7a890 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,11 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { -<<<<<<< HEAD - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz", -======= - "@typespec/http-client-python": "~0.12.0-dev.3", ->>>>>>> f53fe560c7d8a39b081fa6aa4b5f8f8a2c62ff34 + "@typespec/http-client-python": "~0.12.0-dev.4", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 99ce7479ac..9f545fbb2a 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -64,11 +64,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", -<<<<<<< HEAD - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg3MzUxMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.11.3.tgz", -======= - "@typespec/http-client-python": "~0.12.0-dev.3", ->>>>>>> f53fe560c7d8a39b081fa6aa4b5f8f8a2c62ff34 + "@typespec/http-client-python": "~0.12.0-dev.4", "fs-extra": "~11.2.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f18fdcb6d4..2cf7dfcbc1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: ~0.12.0-dev.3 - version: 0.12.0-dev.3(3wtk2dpxeawdlyhxiqauzpqcq4) + specifier: ~0.12.0-dev.4 + version: 0.12.0-dev.4(3wtk2dpxeawdlyhxiqauzpqcq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: ~0.12.0-dev.3 - version: 0.12.0-dev.3(3wtk2dpxeawdlyhxiqauzpqcq4) + specifier: ~0.12.0-dev.4 + version: 0.12.0-dev.4(3wtk2dpxeawdlyhxiqauzpqcq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1539,8 +1539,8 @@ packages: peerDependencies: '@typespec/compiler': ^1.0.0 - '@typespec/http-client-python@0.12.0-dev.3': - resolution: {integrity: sha512-NEm9JC78mczkFlP3tM2UY8/PN9TUJ7uyJPlpYsPURupA5Ge38dVmPRs5gdpj9tlbHKEvnjJ0jIy1rdIUb7DJ9A==} + '@typespec/http-client-python@0.12.0-dev.4': + resolution: {integrity: sha512-B4a6lU7IiYXHEUTGjcCJXOc8IBb3ev1b25V9H7OOcbTOM1nFuwwtrFwkQbA4rrP42Othgn3UHxcefKiWon8/Aw==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.56.0 <1.0.0' @@ -5955,7 +5955,7 @@ snapshots: dependencies: '@typespec/compiler': 1.0.0(@types/node@22.13.17) - '@typespec/http-client-python@0.12.0-dev.3(3wtk2dpxeawdlyhxiqauzpqcq4)': + '@typespec/http-client-python@0.12.0-dev.4(3wtk2dpxeawdlyhxiqauzpqcq4)': dependencies: '@azure-tools/typespec-autorest': 0.56.0(rnyagkipe6ane6slysupm3neby) '@azure-tools/typespec-azure-core': 0.56.0(@typespec/compiler@1.0.0(@types/node@22.13.17))(@typespec/http@1.0.0(@typespec/compiler@1.0.0(@types/node@22.13.17))(@typespec/streams@0.70.0(@typespec/compiler@1.0.0(@types/node@22.13.17))))(@typespec/rest@0.70.0(@typespec/compiler@1.0.0(@types/node@22.13.17))(@typespec/http@1.0.0(@typespec/compiler@1.0.0(@types/node@22.13.17))(@typespec/streams@0.70.0(@typespec/compiler@1.0.0(@types/node@22.13.17))))) From d756bb0a7652fc4bab12fffd95f9a3aea1b8ece4 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 19 May 2025 03:05:08 +0000 Subject: [PATCH 5/6] add changelog --- .../auto-microsoft-python-metadata-2025-4-19-3-4-49.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/auto-microsoft-python-metadata-2025-4-19-3-4-49.md diff --git a/.chronus/changes/auto-microsoft-python-metadata-2025-4-19-3-4-49.md b/.chronus/changes/auto-microsoft-python-metadata-2025-4-19-3-4-49.md new file mode 100644 index 0000000000..fecbe515d6 --- /dev/null +++ b/.chronus/changes/auto-microsoft-python-metadata-2025-4-19-3-4-49.md @@ -0,0 +1,8 @@ +--- +changeKind: feature +packages: + - "@autorest/python" + - "@azure-tools/typespec-python" +--- + +generate _metadata.json \ No newline at end of file From 6aec58c53f0cad7401602377ffcdff76bcada293 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 19 May 2025 11:38:18 +0800 Subject: [PATCH 6/6] Update auto-microsoft-python-metadata-2025-4-19-3-4-49.md --- .../changes/auto-microsoft-python-metadata-2025-4-19-3-4-49.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chronus/changes/auto-microsoft-python-metadata-2025-4-19-3-4-49.md b/.chronus/changes/auto-microsoft-python-metadata-2025-4-19-3-4-49.md index fecbe515d6..25ed75be78 100644 --- a/.chronus/changes/auto-microsoft-python-metadata-2025-4-19-3-4-49.md +++ b/.chronus/changes/auto-microsoft-python-metadata-2025-4-19-3-4-49.md @@ -5,4 +5,4 @@ packages: - "@azure-tools/typespec-python" --- -generate _metadata.json \ No newline at end of file +generate `_metadata.json` to store info from TCGC