diff --git a/autorest/codegen/serializers/builder_serializer.py b/autorest/codegen/serializers/builder_serializer.py index 1741da66186..3f85a6432a4 100644 --- a/autorest/codegen/serializers/builder_serializer.py +++ b/autorest/codegen/serializers/builder_serializer.py @@ -1133,9 +1133,16 @@ def call_next_link_request_builder(self, builder: PagingOperationType) -> List[s template_url = "next_link" request_builder = builder.next_request_builder or builder.request_builder - return self._call_request_builder_helper( - builder, request_builder, template_url=template_url, is_next_request=True - ) + if builder.next_request_builder or self.code_model.is_legacy: + return self._call_request_builder_helper( + builder, + request_builder, + template_url=template_url, + is_next_request=True, + ) + retval = ['request = HttpRequest("GET", next_link)'] + retval.extend(self._postprocess_http_request(builder, "request.url")) + return retval def _prepare_request_callback(self, builder: PagingOperationType) -> List[str]: retval = ["def prepare_request(next_link=None):"] @@ -1148,10 +1155,7 @@ def _prepare_request_callback(self, builder: PagingOperationType) -> List[str]: retval.extend( [f" {line}" for line in self.call_next_link_request_builder(builder)] ) - if not builder.next_request_builder and builder.parameters.path: - retval.append("") - retval.extend([f" {line}" for line in self.serialize_path(builder)]) - if not builder.next_request_builder: + if not builder.next_request_builder and self.code_model.is_legacy: retval.append(' request.method = "GET"') else: retval.append("") diff --git a/docs/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py b/docs/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py index 1645ad91896..c699fa27d19 100644 --- a/docs/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py +++ b/docs/samples/specification/directives/generated/azure/directives/sample/_operations/_operations.py @@ -311,13 +311,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_basic_paging_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): diff --git a/docs/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py b/docs/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py index c7acfd4299a..9b27bc32ae3 100644 --- a/docs/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py +++ b/docs/samples/specification/directives/generated/azure/directives/sample/aio/_operations/_operations.py @@ -283,13 +283,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_basic_paging_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): diff --git a/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py b/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py index d649a1644c0..4d2e613975b 100644 --- a/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py +++ b/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/aio/operations/_paging_operations.py @@ -100,11 +100,6 @@ def prepare_request(next_link=None): "host": self._serialize.url("self._config.host", self._config.host, "str", skip_quote=True), } request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - - path_format_arguments = { - "accountName": self._serialize.url("account_name", account_name, "str", skip_quote=True), - "host": self._serialize.url("self._config.host", self._config.host, "str", skip_quote=True), - } request.method = "GET" return request diff --git a/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py b/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py index e14092e0463..2102951286f 100644 --- a/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py +++ b/test/azure/legacy/Expected/AcceptanceTests/CustomUrlPaging/custombaseurlpaging/operations/_paging_operations.py @@ -147,11 +147,6 @@ def prepare_request(next_link=None): "host": self._serialize.url("self._config.host", self._config.host, "str", skip_quote=True), } request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - - path_format_arguments = { - "accountName": self._serialize.url("account_name", account_name, "str", skip_quote=True), - "host": self._serialize.url("self._config.host", self._config.host, "str", skip_quote=True), - } request.method = "GET" return request diff --git a/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py b/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py index 32d4277af02..73681d7f8af 100644 --- a/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py +++ b/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/aio/operations/_operations.py @@ -115,13 +115,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_no_item_name_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -184,13 +180,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_null_next_link_name_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -253,13 +245,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_single_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -323,13 +311,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_first_response_empty_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -410,16 +394,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -568,13 +545,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_duplicate_params_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -655,16 +628,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_odata_multiple_pages_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -749,17 +715,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_with_offset_request( - offset=offset, - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -823,13 +781,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_retry_first_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -893,13 +847,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_retry_second_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -962,13 +912,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_single_pages_failure_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -1031,13 +977,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_failure_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -1100,13 +1042,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_failure_uri_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -1401,16 +1339,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_lro_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -1510,13 +1441,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_paging_model_with_item_name_with_xms_client_name_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): diff --git a/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py b/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py index f25a027621a..04900070b70 100644 --- a/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py +++ b/test/azure/version-tolerant/Expected/AcceptanceTests/CustomPollerPagerVersionTolerant/custompollerpagerversiontolerant/operations/_operations.py @@ -492,13 +492,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_no_item_name_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -561,13 +557,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_null_next_link_name_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -630,13 +622,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_single_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -700,13 +688,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_first_response_empty_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -787,16 +771,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -945,13 +922,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_duplicate_params_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1032,16 +1005,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_odata_multiple_pages_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1126,17 +1092,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_with_offset_request( - offset=offset, - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1200,13 +1158,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_retry_first_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1270,13 +1224,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_retry_second_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1339,13 +1289,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_single_pages_failure_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1408,13 +1354,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_failure_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1477,13 +1419,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_failure_uri_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1775,16 +1713,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_lro_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1884,13 +1815,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_paging_model_with_item_name_with_xms_client_name_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): diff --git a/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py b/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py index 8e3cb479388..1ca340584e5 100644 --- a/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py +++ b/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/aio/operations/_operations.py @@ -98,22 +98,13 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore else: - - request = build_paging_get_pages_partial_url_request( - headers=_headers, - params=_params, - ) + request = HttpRequest("GET", next_link) path_format_arguments = { "accountName": self._serialize.url("account_name", account_name, "str", skip_quote=True), "host": self._serialize.url("self._config.host", self._config.host, "str", skip_quote=True), } - request.url = self._client.format_url(next_link, **path_format_arguments) # type: ignore + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - path_format_arguments = { - "accountName": self._serialize.url("account_name", account_name, "str", skip_quote=True), - "host": self._serialize.url("self._config.host", self._config.host, "str", skip_quote=True), - } - request.method = "GET" return request async def extract_data(pipeline_response): diff --git a/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py b/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py index b1b438127e7..dc83a2250c9 100644 --- a/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py +++ b/test/azure/version-tolerant/Expected/AcceptanceTests/CustomUrlPagingVersionTolerant/custombaseurlpagingversiontolerant/operations/_operations.py @@ -146,22 +146,13 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore else: - - request = build_paging_get_pages_partial_url_request( - headers=_headers, - params=_params, - ) + request = HttpRequest("GET", next_link) path_format_arguments = { "accountName": self._serialize.url("account_name", account_name, "str", skip_quote=True), "host": self._serialize.url("self._config.host", self._config.host, "str", skip_quote=True), } - request.url = self._client.format_url(next_link, **path_format_arguments) # type: ignore + request.url = self._client.format_url(request.url, **path_format_arguments) # type: ignore - path_format_arguments = { - "accountName": self._serialize.url("account_name", account_name, "str", skip_quote=True), - "host": self._serialize.url("self._config.host", self._config.host, "str", skip_quote=True), - } - request.method = "GET" return request def extract_data(pipeline_response): diff --git a/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py b/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py index 9423e7cd9f1..44997ec7d2a 100644 --- a/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py +++ b/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/aio/operations/_operations.py @@ -113,13 +113,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_no_item_name_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -182,13 +178,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_null_next_link_name_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -251,13 +243,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_single_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -321,13 +309,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_first_response_empty_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -408,16 +392,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -566,13 +543,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_duplicate_params_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -653,16 +626,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_odata_multiple_pages_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -747,17 +713,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_with_offset_request( - offset=offset, - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -821,13 +779,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_retry_first_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -891,13 +845,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_retry_second_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -960,13 +910,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_single_pages_failure_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -1029,13 +975,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_failure_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -1098,13 +1040,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_failure_uri_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -1398,16 +1336,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_lro_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -1509,13 +1440,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_paging_model_with_item_name_with_xms_client_name_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): diff --git a/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py b/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py index 79e6b143c3d..94c43df57c7 100644 --- a/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py +++ b/test/azure/version-tolerant/Expected/AcceptanceTests/PagingVersionTolerant/pagingversiontolerant/operations/_operations.py @@ -490,13 +490,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_no_item_name_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -559,13 +555,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_null_next_link_name_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -628,13 +620,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_single_pages_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -698,13 +686,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_first_response_empty_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -785,16 +769,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -943,13 +920,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_duplicate_params_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1030,16 +1003,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_odata_multiple_pages_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1124,17 +1090,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_with_offset_request( - offset=offset, - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1198,13 +1156,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_retry_first_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1268,13 +1222,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_retry_second_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1337,13 +1287,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_single_pages_failure_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1406,13 +1352,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_failure_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1475,13 +1417,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_failure_uri_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1773,16 +1711,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_multiple_pages_lro_request( - client_request_id=client_request_id, - maxresults=maxresults, - timeout=timeout, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1882,13 +1813,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_paging_get_paging_model_with_item_name_with_xms_client_name_request( - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): diff --git a/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py b/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py index b0346867856..d73cec9be13 100644 --- a/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py +++ b/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/aio/operations/_operations.py @@ -1373,14 +1373,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_storage_accounts_list_request( - subscription_id=self._config.subscription_id, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): @@ -1509,15 +1504,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_storage_accounts_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): diff --git a/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py b/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py index e77c337e60f..9b241fe14a4 100644 --- a/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py +++ b/test/azure/version-tolerant/Expected/AcceptanceTests/StorageManagementClientVersionTolerant/storageversiontolerant/operations/_operations.py @@ -1638,14 +1638,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_storage_accounts_list_request( - subscription_id=self._config.subscription_id, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): @@ -1774,15 +1769,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_storage_accounts_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): diff --git a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py index 7fb07f6bb96..0da78d4d2e5 100644 --- a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py +++ b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/_operations/_operations.py @@ -348,14 +348,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_get_pages_request( - mode=mode, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): diff --git a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py index 2a946f222ce..623309a93eb 100644 --- a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py +++ b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationCustomizedVersionTolerant/dpgcustomizationcustomizedversiontolerant/aio/_operations/_operations.py @@ -274,14 +274,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_get_pages_request( - mode=mode, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): diff --git a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py index 7fb07f6bb96..0da78d4d2e5 100644 --- a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py +++ b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/_operations/_operations.py @@ -348,14 +348,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_get_pages_request( - mode=mode, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): diff --git a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py index 2a946f222ce..623309a93eb 100644 --- a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py +++ b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGCustomizationInitialVersionTolerant/dpgcustomizationinitialversiontolerant/aio/_operations/_operations.py @@ -274,14 +274,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_get_pages_request( - mode=mode, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response): diff --git a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py index 360b89709b2..abc507fdf90 100644 --- a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py +++ b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/_operations/_operations.py @@ -297,14 +297,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_get_pages_request( - mode=mode, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request def extract_data(pipeline_response): diff --git a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py index 0a213245075..cb954b5513d 100644 --- a/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py +++ b/test/dpg/version-tolerant/Expected/AcceptanceTests/DPGTestModelsVersionTolerant/dpgtestmodelsversiontolerant/aio/_operations/_operations.py @@ -221,14 +221,9 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) # type: ignore else: + request = HttpRequest("GET", next_link) + request.url = self._client.format_url(request.url) # type: ignore - request = build_get_pages_request( - mode=mode, - headers=_headers, - params=_params, - ) - request.url = self._client.format_url(next_link) # type: ignore - request.method = "GET" return request async def extract_data(pipeline_response):